Commit 188fdea6 authored by Sam Bobroff's avatar Sam Bobroff Committed by Michael Ellerman

powerpc/eeh: remove sw_state from eeh_unfreeze_pe()

eeh_unfreeze_pe() performs two operations: unfreezing a PE (which may
cause firmware to unfreeze child PEs as well) and de-isolating the PE
and it's children.

To simplify this and support future work, separate out the
de-isolation and perform it at the call sites (when necessary).

There should be no change in behaviour.
Signed-off-by: default avatarSam Bobroff <sbobroff@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 3376cb91
...@@ -293,7 +293,7 @@ void eeh_add_device_late(struct pci_dev *); ...@@ -293,7 +293,7 @@ void eeh_add_device_late(struct pci_dev *);
void eeh_add_device_tree_late(struct pci_bus *); void eeh_add_device_tree_late(struct pci_bus *);
void eeh_add_sysfs_files(struct pci_bus *); void eeh_add_sysfs_files(struct pci_bus *);
void eeh_remove_device(struct pci_dev *); void eeh_remove_device(struct pci_dev *);
int eeh_unfreeze_pe(struct eeh_pe *pe, bool sw_state); int eeh_unfreeze_pe(struct eeh_pe *pe);
int eeh_pe_reset_and_recover(struct eeh_pe *pe); int eeh_pe_reset_and_recover(struct eeh_pe *pe);
int eeh_dev_open(struct pci_dev *pdev); int eeh_dev_open(struct pci_dev *pdev);
void eeh_dev_release(struct pci_dev *pdev); void eeh_dev_release(struct pci_dev *pdev);
......
...@@ -823,7 +823,7 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state stat ...@@ -823,7 +823,7 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state stat
switch (state) { switch (state) {
case pcie_deassert_reset: case pcie_deassert_reset:
eeh_ops->reset(pe, EEH_RESET_DEACTIVATE); eeh_ops->reset(pe, EEH_RESET_DEACTIVATE);
eeh_unfreeze_pe(pe, false); eeh_unfreeze_pe(pe);
if (!(pe->type & EEH_PE_VF)) if (!(pe->type & EEH_PE_VF))
eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED); eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED);
eeh_pe_dev_traverse(pe, eeh_restore_dev_state, dev); eeh_pe_dev_traverse(pe, eeh_restore_dev_state, dev);
...@@ -1309,7 +1309,7 @@ void eeh_remove_device(struct pci_dev *dev) ...@@ -1309,7 +1309,7 @@ void eeh_remove_device(struct pci_dev *dev)
edev->mode &= ~EEH_DEV_SYSFS; edev->mode &= ~EEH_DEV_SYSFS;
} }
int eeh_unfreeze_pe(struct eeh_pe *pe, bool sw_state) int eeh_unfreeze_pe(struct eeh_pe *pe)
{ {
int ret; int ret;
...@@ -1327,10 +1327,6 @@ int eeh_unfreeze_pe(struct eeh_pe *pe, bool sw_state) ...@@ -1327,10 +1327,6 @@ int eeh_unfreeze_pe(struct eeh_pe *pe, bool sw_state)
return ret; return ret;
} }
/* Clear software isolated state */
if (sw_state && (pe->state & EEH_PE_ISOLATED))
eeh_pe_state_clear(pe, EEH_PE_ISOLATED);
return ret; return ret;
} }
...@@ -1382,7 +1378,10 @@ static int eeh_pe_change_owner(struct eeh_pe *pe) ...@@ -1382,7 +1378,10 @@ static int eeh_pe_change_owner(struct eeh_pe *pe)
} }
} }
return eeh_unfreeze_pe(pe, true); ret = eeh_unfreeze_pe(pe);
if (!ret)
eeh_pe_state_clear(pe, EEH_PE_ISOLATED);
return ret;
} }
/** /**
...@@ -1639,7 +1638,10 @@ static int eeh_pe_reenable_devices(struct eeh_pe *pe) ...@@ -1639,7 +1638,10 @@ static int eeh_pe_reenable_devices(struct eeh_pe *pe)
} }
/* The PE is still in frozen state */ /* The PE is still in frozen state */
return eeh_unfreeze_pe(pe, true); ret = eeh_unfreeze_pe(pe);
if (!ret)
eeh_pe_state_clear(pe, EEH_PE_ISOLATED);
return ret;
} }
......
...@@ -598,7 +598,7 @@ static int eeh_clear_pe_frozen_state(struct eeh_pe *root) ...@@ -598,7 +598,7 @@ static int eeh_clear_pe_frozen_state(struct eeh_pe *root)
eeh_for_each_pe(root, pe) { eeh_for_each_pe(root, pe) {
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
if (!eeh_unfreeze_pe(pe, false)) if (!eeh_unfreeze_pe(pe))
break; break;
if (i >= 3) if (i >= 3)
return -EIO; return -EIO;
......
...@@ -82,8 +82,9 @@ static ssize_t eeh_pe_state_store(struct device *dev, ...@@ -82,8 +82,9 @@ static ssize_t eeh_pe_state_store(struct device *dev,
if (!(edev->pe->state & EEH_PE_ISOLATED)) if (!(edev->pe->state & EEH_PE_ISOLATED))
return count; return count;
if (eeh_unfreeze_pe(edev->pe, true)) if (eeh_unfreeze_pe(edev->pe))
return -EIO; return -EIO;
eeh_pe_state_clear(edev->pe, EEH_PE_ISOLATED);
return count; return count;
} }
......
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