mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 04:42:04 -04:00
pci/hotplug/pnv-php: Improve error msg on power state change failure
[ Upstream commit 323c2a26ff43500a96799250330fab68903d776f ] When changing the slot state, if opal hits an error and tells as such in the asynchronous reply, the warning "Wrong msg" is logged, which is rather confusing. Instead we can reuse the better message which is already used when we couldn't submit the asynchronous opal request initially. Reviewed-by: Alastair D'Silva <alastair@d-silva.org> Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com> Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20191121134918.7155-8-fbarrat@linux.ibm.com Stable-dep-of: 466861909255 ("PCI: pnv_php: Clean up allocated IRQs on unplug") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
651a71f931
commit
0f28008b27
1 changed files with 11 additions and 5 deletions
|
|
@ -341,18 +341,19 @@ int pnv_php_set_slot_power_state(struct hotplug_slot *slot,
|
|||
ret = pnv_pci_set_power_state(php_slot->id, state, &msg);
|
||||
if (ret > 0) {
|
||||
if (be64_to_cpu(msg.params[1]) != php_slot->dn->phandle ||
|
||||
be64_to_cpu(msg.params[2]) != state ||
|
||||
be64_to_cpu(msg.params[3]) != OPAL_SUCCESS) {
|
||||
be64_to_cpu(msg.params[2]) != state) {
|
||||
pci_warn(php_slot->pdev, "Wrong msg (%lld, %lld, %lld)\n",
|
||||
be64_to_cpu(msg.params[1]),
|
||||
be64_to_cpu(msg.params[2]),
|
||||
be64_to_cpu(msg.params[3]));
|
||||
return -ENOMSG;
|
||||
}
|
||||
if (be64_to_cpu(msg.params[3]) != OPAL_SUCCESS) {
|
||||
ret = -ENODEV;
|
||||
goto error;
|
||||
}
|
||||
} else if (ret < 0) {
|
||||
pci_warn(php_slot->pdev, "Error %d powering %s\n",
|
||||
ret, (state == OPAL_PCI_SLOT_POWER_ON) ? "on" : "off");
|
||||
return ret;
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (state == OPAL_PCI_SLOT_POWER_OFF || state == OPAL_PCI_SLOT_OFFLINE)
|
||||
|
|
@ -361,6 +362,11 @@ int pnv_php_set_slot_power_state(struct hotplug_slot *slot,
|
|||
ret = pnv_php_add_devtree(php_slot);
|
||||
|
||||
return ret;
|
||||
|
||||
error:
|
||||
pci_warn(php_slot->pdev, "Error %d powering %s\n",
|
||||
ret, (state == OPAL_PCI_SLOT_POWER_ON) ? "on" : "off");
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pnv_php_set_slot_power_state);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue