powerpc/powernv: Replace variables with flags
We have 2 fields in "struct pnv_phb" to trace the states. The patch replace the fields with one and introduces flags for that. The patch doesn't impact the logic. Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
parent
652defed48
commit
0b9e267d71
|
@ -132,7 +132,7 @@ static int ioda_eeh_post_init(struct pci_controller *hose)
|
||||||
&ioda_eeh_dbgfs_ops);
|
&ioda_eeh_dbgfs_ops);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
phb->eeh_enabled = 1;
|
phb->eeh_state |= PNV_EEH_STATE_ENABLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -815,7 +815,7 @@ static int ioda_eeh_next_error(struct eeh_pe **pe)
|
||||||
* removed, we needn't take care of it any more.
|
* removed, we needn't take care of it any more.
|
||||||
*/
|
*/
|
||||||
phb = hose->private_data;
|
phb = hose->private_data;
|
||||||
if (phb->removed)
|
if (phb->eeh_state & PNV_EEH_STATE_REMOVED)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
rc = opal_pci_next_error(phb->opal_id,
|
rc = opal_pci_next_error(phb->opal_id,
|
||||||
|
@ -850,7 +850,7 @@ static int ioda_eeh_next_error(struct eeh_pe **pe)
|
||||||
list_for_each_entry_safe(hose, tmp,
|
list_for_each_entry_safe(hose, tmp,
|
||||||
&hose_list, list_node) {
|
&hose_list, list_node) {
|
||||||
phb = hose->private_data;
|
phb = hose->private_data;
|
||||||
phb->removed = 1;
|
phb->eeh_state |= PNV_EEH_STATE_REMOVED;
|
||||||
}
|
}
|
||||||
|
|
||||||
WARN(1, "EEH: dead IOC detected\n");
|
WARN(1, "EEH: dead IOC detected\n");
|
||||||
|
@ -867,7 +867,7 @@ static int ioda_eeh_next_error(struct eeh_pe **pe)
|
||||||
|
|
||||||
WARN(1, "EEH: dead PHB#%x detected\n",
|
WARN(1, "EEH: dead PHB#%x detected\n",
|
||||||
hose->global_number);
|
hose->global_number);
|
||||||
phb->removed = 1;
|
phb->eeh_state |= PNV_EEH_STATE_REMOVED;
|
||||||
ret = 3;
|
ret = 3;
|
||||||
goto out;
|
goto out;
|
||||||
} else if (severity == OPAL_EEH_SEV_PHB_FENCED) {
|
} else if (severity == OPAL_EEH_SEV_PHB_FENCED) {
|
||||||
|
|
|
@ -309,7 +309,7 @@ static int pnv_pci_read_config(struct pci_bus *bus,
|
||||||
if (phb_pe && (phb_pe->state & EEH_PE_ISOLATED))
|
if (phb_pe && (phb_pe->state & EEH_PE_ISOLATED))
|
||||||
return PCIBIOS_SUCCESSFUL;
|
return PCIBIOS_SUCCESSFUL;
|
||||||
|
|
||||||
if (phb->eeh_enabled) {
|
if (phb->eeh_state & PNV_EEH_STATE_ENABLED) {
|
||||||
if (*val == EEH_IO_ERROR_VALUE(size)) {
|
if (*val == EEH_IO_ERROR_VALUE(size)) {
|
||||||
busdn = pci_bus_to_OF_node(bus);
|
busdn = pci_bus_to_OF_node(bus);
|
||||||
for (dn = busdn->child; dn; dn = dn->sibling) {
|
for (dn = busdn->child; dn; dn = dn->sibling) {
|
||||||
|
@ -359,7 +359,7 @@ static int pnv_pci_write_config(struct pci_bus *bus,
|
||||||
|
|
||||||
/* Check if the PHB got frozen due to an error (no response) */
|
/* Check if the PHB got frozen due to an error (no response) */
|
||||||
#ifdef CONFIG_EEH
|
#ifdef CONFIG_EEH
|
||||||
if (!phb->eeh_enabled)
|
if (!(phb->eeh_state & PNV_EEH_STATE_ENABLED))
|
||||||
pnv_pci_config_check_eeh(phb, bus, bdfn);
|
pnv_pci_config_check_eeh(phb, bus, bdfn);
|
||||||
#else
|
#else
|
||||||
pnv_pci_config_check_eeh(phb, bus, bdfn);
|
pnv_pci_config_check_eeh(phb, bus, bdfn);
|
||||||
|
|
|
@ -78,6 +78,10 @@ struct pnv_eeh_ops {
|
||||||
int (*configure_bridge)(struct eeh_pe *pe);
|
int (*configure_bridge)(struct eeh_pe *pe);
|
||||||
int (*next_error)(struct eeh_pe **pe);
|
int (*next_error)(struct eeh_pe **pe);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define PNV_EEH_STATE_ENABLED (1 << 0) /* EEH enabled */
|
||||||
|
#define PNV_EEH_STATE_REMOVED (1 << 1) /* PHB removed */
|
||||||
|
|
||||||
#endif /* CONFIG_EEH */
|
#endif /* CONFIG_EEH */
|
||||||
|
|
||||||
struct pnv_phb {
|
struct pnv_phb {
|
||||||
|
@ -92,8 +96,7 @@ struct pnv_phb {
|
||||||
|
|
||||||
#ifdef CONFIG_EEH
|
#ifdef CONFIG_EEH
|
||||||
struct pnv_eeh_ops *eeh_ops;
|
struct pnv_eeh_ops *eeh_ops;
|
||||||
int eeh_enabled;
|
int eeh_state;
|
||||||
int removed;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG_FS
|
#ifdef CONFIG_DEBUG_FS
|
||||||
|
|
Loading…
Reference in New Issue