Commit 8a6b3710 authored by Gavin Shan's avatar Gavin Shan Committed by Michael Ellerman

powerpc/eeh: Rename flag EEH_PE_RESET to EEH_PE_CFG_BLOCKED

The flag EEH_PE_RESET indicates blocking config space of the PE
during reset time. We potentially need block PE's config space
other than reset time. So it's reasonable to replace it with
EEH_PE_CFG_BLOCKED to indicate its usage.

There are no substantial code or logic changes in this patch.
Signed-off-by: default avatarGavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 8315070c
...@@ -71,7 +71,7 @@ struct device_node; ...@@ -71,7 +71,7 @@ struct device_node;
#define EEH_PE_ISOLATED (1 << 0) /* Isolated PE */ #define EEH_PE_ISOLATED (1 << 0) /* Isolated PE */
#define EEH_PE_RECOVERING (1 << 1) /* Recovering PE */ #define EEH_PE_RECOVERING (1 << 1) /* Recovering PE */
#define EEH_PE_RESET (1 << 2) /* PE reset in progress */ #define EEH_PE_CFG_BLOCKED (1 << 2) /* Block config access */
#define EEH_PE_KEEP (1 << 8) /* Keep PE on hotplug */ #define EEH_PE_KEEP (1 << 8) /* Keep PE on hotplug */
......
...@@ -673,18 +673,18 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state stat ...@@ -673,18 +673,18 @@ 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_pe_state_clear(pe, EEH_PE_RESET); eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED);
break; break;
case pcie_hot_reset: case pcie_hot_reset:
eeh_pe_state_mark(pe, EEH_PE_RESET); eeh_pe_state_mark(pe, EEH_PE_CFG_BLOCKED);
eeh_ops->reset(pe, EEH_RESET_HOT); eeh_ops->reset(pe, EEH_RESET_HOT);
break; break;
case pcie_warm_reset: case pcie_warm_reset:
eeh_pe_state_mark(pe, EEH_PE_RESET); eeh_pe_state_mark(pe, EEH_PE_CFG_BLOCKED);
eeh_ops->reset(pe, EEH_RESET_FUNDAMENTAL); eeh_ops->reset(pe, EEH_RESET_FUNDAMENTAL);
break; break;
default: default:
eeh_pe_state_clear(pe, EEH_PE_RESET); eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED);
return -EINVAL; return -EINVAL;
}; };
...@@ -1523,7 +1523,7 @@ int eeh_pe_reset(struct eeh_pe *pe, int option) ...@@ -1523,7 +1523,7 @@ int eeh_pe_reset(struct eeh_pe *pe, int option)
switch (option) { switch (option) {
case EEH_RESET_DEACTIVATE: case EEH_RESET_DEACTIVATE:
ret = eeh_ops->reset(pe, option); ret = eeh_ops->reset(pe, option);
eeh_pe_state_clear(pe, EEH_PE_RESET); eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED);
if (ret) if (ret)
break; break;
...@@ -1538,7 +1538,7 @@ int eeh_pe_reset(struct eeh_pe *pe, int option) ...@@ -1538,7 +1538,7 @@ int eeh_pe_reset(struct eeh_pe *pe, int option)
*/ */
eeh_ops->set_option(pe, EEH_OPT_FREEZE_PE); eeh_ops->set_option(pe, EEH_OPT_FREEZE_PE);
eeh_pe_state_mark(pe, EEH_PE_RESET); eeh_pe_state_mark(pe, EEH_PE_CFG_BLOCKED);
ret = eeh_ops->reset(pe, option); ret = eeh_ops->reset(pe, option);
break; break;
default: default:
......
...@@ -528,13 +528,13 @@ int eeh_pe_reset_and_recover(struct eeh_pe *pe) ...@@ -528,13 +528,13 @@ int eeh_pe_reset_and_recover(struct eeh_pe *pe)
eeh_pe_dev_traverse(pe, eeh_report_error, &result); eeh_pe_dev_traverse(pe, eeh_report_error, &result);
/* Issue reset */ /* Issue reset */
eeh_pe_state_mark(pe, EEH_PE_RESET); eeh_pe_state_mark(pe, EEH_PE_CFG_BLOCKED);
ret = eeh_reset_pe(pe); ret = eeh_reset_pe(pe);
if (ret) { if (ret) {
eeh_pe_state_clear(pe, EEH_PE_RECOVERING | EEH_PE_RESET); eeh_pe_state_clear(pe, EEH_PE_RECOVERING | EEH_PE_CFG_BLOCKED);
return ret; return ret;
} }
eeh_pe_state_clear(pe, EEH_PE_RESET); eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED);
/* Unfreeze the PE */ /* Unfreeze the PE */
ret = eeh_clear_pe_frozen_state(pe, true); ret = eeh_clear_pe_frozen_state(pe, true);
...@@ -601,10 +601,10 @@ static int eeh_reset_device(struct eeh_pe *pe, struct pci_bus *bus) ...@@ -601,10 +601,10 @@ static int eeh_reset_device(struct eeh_pe *pe, struct pci_bus *bus)
* config accesses. So we prefer to block them. However, controlled * config accesses. So we prefer to block them. However, controlled
* PCI config accesses initiated from EEH itself are allowed. * PCI config accesses initiated from EEH itself are allowed.
*/ */
eeh_pe_state_mark(pe, EEH_PE_RESET); eeh_pe_state_mark(pe, EEH_PE_CFG_BLOCKED);
rc = eeh_reset_pe(pe); rc = eeh_reset_pe(pe);
if (rc) { if (rc) {
eeh_pe_state_clear(pe, EEH_PE_RESET); eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED);
return rc; return rc;
} }
...@@ -613,7 +613,7 @@ static int eeh_reset_device(struct eeh_pe *pe, struct pci_bus *bus) ...@@ -613,7 +613,7 @@ static int eeh_reset_device(struct eeh_pe *pe, struct pci_bus *bus)
/* Restore PE */ /* Restore PE */
eeh_ops->configure_bridge(pe); eeh_ops->configure_bridge(pe);
eeh_pe_restore_bars(pe); eeh_pe_restore_bars(pe);
eeh_pe_state_clear(pe, EEH_PE_RESET); eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED);
/* Clear frozen state */ /* Clear frozen state */
rc = eeh_clear_pe_frozen_state(pe, false); rc = eeh_clear_pe_frozen_state(pe, false);
......
...@@ -111,7 +111,7 @@ static int rtas_pci_read_config(struct pci_bus *bus, ...@@ -111,7 +111,7 @@ static int rtas_pci_read_config(struct pci_bus *bus,
return PCIBIOS_DEVICE_NOT_FOUND; return PCIBIOS_DEVICE_NOT_FOUND;
#ifdef CONFIG_EEH #ifdef CONFIG_EEH
edev = of_node_to_eeh_dev(dn); edev = of_node_to_eeh_dev(dn);
if (edev && edev->pe && edev->pe->state & EEH_PE_RESET) if (edev && edev->pe && edev->pe->state & EEH_PE_CFG_BLOCKED)
return PCIBIOS_DEVICE_NOT_FOUND; return PCIBIOS_DEVICE_NOT_FOUND;
#endif #endif
...@@ -175,7 +175,7 @@ static int rtas_pci_write_config(struct pci_bus *bus, ...@@ -175,7 +175,7 @@ static int rtas_pci_write_config(struct pci_bus *bus,
return PCIBIOS_DEVICE_NOT_FOUND; return PCIBIOS_DEVICE_NOT_FOUND;
#ifdef CONFIG_EEH #ifdef CONFIG_EEH
edev = of_node_to_eeh_dev(dn); edev = of_node_to_eeh_dev(dn);
if (edev && edev->pe && (edev->pe->state & EEH_PE_RESET)) if (edev && edev->pe && (edev->pe->state & EEH_PE_CFG_BLOCKED))
return PCIBIOS_DEVICE_NOT_FOUND; return PCIBIOS_DEVICE_NOT_FOUND;
#endif #endif
ret = rtas_write_config(pdn, where, size, val); ret = rtas_write_config(pdn, where, size, val);
......
...@@ -373,7 +373,7 @@ static int ioda_eeh_get_pe_state(struct eeh_pe *pe) ...@@ -373,7 +373,7 @@ static int ioda_eeh_get_pe_state(struct eeh_pe *pe)
* moving forward, we have to return operational * moving forward, we have to return operational
* state during PE reset. * state during PE reset.
*/ */
if (pe->state & EEH_PE_RESET) { if (pe->state & EEH_PE_CFG_BLOCKED) {
result = (EEH_STATE_MMIO_ACTIVE | result = (EEH_STATE_MMIO_ACTIVE |
EEH_STATE_DMA_ACTIVE | EEH_STATE_DMA_ACTIVE |
EEH_STATE_MMIO_ENABLED | EEH_STATE_MMIO_ENABLED |
......
...@@ -513,7 +513,7 @@ static bool pnv_pci_cfg_check(struct pci_controller *hose, ...@@ -513,7 +513,7 @@ static bool pnv_pci_cfg_check(struct pci_controller *hose,
edev = of_node_to_eeh_dev(dn); edev = of_node_to_eeh_dev(dn);
if (edev) { if (edev) {
if (edev->pe && if (edev->pe &&
(edev->pe->state & EEH_PE_RESET)) (edev->pe->state & EEH_PE_CFG_BLOCKED))
return false; return false;
if (edev->mode & EEH_DEV_REMOVED) if (edev->mode & EEH_DEV_REMOVED)
......
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