Commit 4d8e325d authored by Sam Bobroff's avatar Sam Bobroff Committed by Michael Ellerman

powerpc/eeh: Add include_passed to eeh_clear_pe_frozen_state()

Add a parameter to eeh_clear_pe_frozen_state() that allows
passed-through PEs to be excluded. Update callers to always pass true
so that there is no change in behaviour.

This is to prepare for follow-up work for passed-through devices.
Signed-off-by: default avatarSam Bobroff <sbobroff@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 9ed5ca66
...@@ -591,19 +591,21 @@ static void *eeh_pe_detach_dev(struct eeh_pe *pe, void *userdata) ...@@ -591,19 +591,21 @@ static void *eeh_pe_detach_dev(struct eeh_pe *pe, void *userdata)
* PE reset (for 3 times), we try to clear the frozen state * PE reset (for 3 times), we try to clear the frozen state
* for 3 times as well. * for 3 times as well.
*/ */
static int eeh_clear_pe_frozen_state(struct eeh_pe *root) static int eeh_clear_pe_frozen_state(struct eeh_pe *root, bool include_passed)
{ {
struct eeh_pe *pe; struct eeh_pe *pe;
int i; int i;
eeh_for_each_pe(root, pe) { eeh_for_each_pe(root, pe) {
if (include_passed || !eeh_pe_passed(pe)) {
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
if (!eeh_unfreeze_pe(pe)) if (!eeh_unfreeze_pe(pe))
break; break;
if (i >= 3) if (i >= 3)
return -EIO; return -EIO;
} }
eeh_pe_state_clear(root, EEH_PE_ISOLATED, true); }
eeh_pe_state_clear(root, EEH_PE_ISOLATED, include_passed);
return 0; return 0;
} }
...@@ -629,7 +631,7 @@ int eeh_pe_reset_and_recover(struct eeh_pe *pe) ...@@ -629,7 +631,7 @@ int eeh_pe_reset_and_recover(struct eeh_pe *pe)
} }
/* Unfreeze the PE */ /* Unfreeze the PE */
ret = eeh_clear_pe_frozen_state(pe); ret = eeh_clear_pe_frozen_state(pe, true);
if (ret) { if (ret) {
eeh_pe_state_clear(pe, EEH_PE_RECOVERING, true); eeh_pe_state_clear(pe, EEH_PE_RECOVERING, true);
return ret; return ret;
...@@ -702,7 +704,7 @@ static int eeh_reset_device(struct eeh_pe *pe, struct pci_bus *bus, ...@@ -702,7 +704,7 @@ static int eeh_reset_device(struct eeh_pe *pe, struct pci_bus *bus,
eeh_pe_restore_bars(pe); eeh_pe_restore_bars(pe);
/* Clear frozen state */ /* Clear frozen state */
rc = eeh_clear_pe_frozen_state(pe); rc = eeh_clear_pe_frozen_state(pe, true);
if (rc) { if (rc) {
pci_unlock_rescan_remove(); pci_unlock_rescan_remove();
return rc; return rc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment