aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGavin Shan <shangw@linux.vnet.ibm.com>2013-06-27 01:46:44 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-06-30 21:10:32 -0400
commit0b9e267d71d2e74d1108785928fd8c8c9dbf441e (patch)
treec4ec8c14eb6fd014ecea12283e2b16631ed769ba
parent652defed48757ae0dcc851beeb8fdd484bad40c6 (diff)
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>
-rw-r--r--arch/powerpc/platforms/powernv/eeh-ioda.c8
-rw-r--r--arch/powerpc/platforms/powernv/pci.c4
-rw-r--r--arch/powerpc/platforms/powernv/pci.h7
3 files changed, 11 insertions, 8 deletions
diff --git a/arch/powerpc/platforms/powernv/eeh-ioda.c b/arch/powerpc/platforms/powernv/eeh-ioda.c
index 84f3036511cb..85025d7e6396 100644
--- a/arch/powerpc/platforms/powernv/eeh-ioda.c
+++ b/arch/powerpc/platforms/powernv/eeh-ioda.c
@@ -132,7 +132,7 @@ static int ioda_eeh_post_init(struct pci_controller *hose)
132 &ioda_eeh_dbgfs_ops); 132 &ioda_eeh_dbgfs_ops);
133#endif 133#endif
134 134
135 phb->eeh_enabled = 1; 135 phb->eeh_state |= PNV_EEH_STATE_ENABLED;
136 } 136 }
137 137
138 return 0; 138 return 0;
@@ -815,7 +815,7 @@ static int ioda_eeh_next_error(struct eeh_pe **pe)
815 * removed, we needn't take care of it any more. 815 * removed, we needn't take care of it any more.
816 */ 816 */
817 phb = hose->private_data; 817 phb = hose->private_data;
818 if (phb->removed) 818 if (phb->eeh_state & PNV_EEH_STATE_REMOVED)
819 continue; 819 continue;
820 820
821 rc = opal_pci_next_error(phb->opal_id, 821 rc = opal_pci_next_error(phb->opal_id,
@@ -850,7 +850,7 @@ static int ioda_eeh_next_error(struct eeh_pe **pe)
850 list_for_each_entry_safe(hose, tmp, 850 list_for_each_entry_safe(hose, tmp,
851 &hose_list, list_node) { 851 &hose_list, list_node) {
852 phb = hose->private_data; 852 phb = hose->private_data;
853 phb->removed = 1; 853 phb->eeh_state |= PNV_EEH_STATE_REMOVED;
854 } 854 }
855 855
856 WARN(1, "EEH: dead IOC detected\n"); 856 WARN(1, "EEH: dead IOC detected\n");
@@ -867,7 +867,7 @@ static int ioda_eeh_next_error(struct eeh_pe **pe)
867 867
868 WARN(1, "EEH: dead PHB#%x detected\n", 868 WARN(1, "EEH: dead PHB#%x detected\n",
869 hose->global_number); 869 hose->global_number);
870 phb->removed = 1; 870 phb->eeh_state |= PNV_EEH_STATE_REMOVED;
871 ret = 3; 871 ret = 3;
872 goto out; 872 goto out;
873 } else if (severity == OPAL_EEH_SEV_PHB_FENCED) { 873 } else if (severity == OPAL_EEH_SEV_PHB_FENCED) {
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
index 577cbeadb0ea..4c91e6dd1af2 100644
--- a/arch/powerpc/platforms/powernv/pci.c
+++ b/arch/powerpc/platforms/powernv/pci.c
@@ -309,7 +309,7 @@ static int pnv_pci_read_config(struct pci_bus *bus,
309 if (phb_pe && (phb_pe->state & EEH_PE_ISOLATED)) 309 if (phb_pe && (phb_pe->state & EEH_PE_ISOLATED))
310 return PCIBIOS_SUCCESSFUL; 310 return PCIBIOS_SUCCESSFUL;
311 311
312 if (phb->eeh_enabled) { 312 if (phb->eeh_state & PNV_EEH_STATE_ENABLED) {
313 if (*val == EEH_IO_ERROR_VALUE(size)) { 313 if (*val == EEH_IO_ERROR_VALUE(size)) {
314 busdn = pci_bus_to_OF_node(bus); 314 busdn = pci_bus_to_OF_node(bus);
315 for (dn = busdn->child; dn; dn = dn->sibling) { 315 for (dn = busdn->child; dn; dn = dn->sibling) {
@@ -359,7 +359,7 @@ static int pnv_pci_write_config(struct pci_bus *bus,
359 359
360 /* Check if the PHB got frozen due to an error (no response) */ 360 /* Check if the PHB got frozen due to an error (no response) */
361#ifdef CONFIG_EEH 361#ifdef CONFIG_EEH
362 if (!phb->eeh_enabled) 362 if (!(phb->eeh_state & PNV_EEH_STATE_ENABLED))
363 pnv_pci_config_check_eeh(phb, bus, bdfn); 363 pnv_pci_config_check_eeh(phb, bus, bdfn);
364#else 364#else
365 pnv_pci_config_check_eeh(phb, bus, bdfn); 365 pnv_pci_config_check_eeh(phb, bus, bdfn);
diff --git a/arch/powerpc/platforms/powernv/pci.h b/arch/powerpc/platforms/powernv/pci.h
index 43906e3ab26f..40bdf0219b96 100644
--- a/arch/powerpc/platforms/powernv/pci.h
+++ b/arch/powerpc/platforms/powernv/pci.h
@@ -78,6 +78,10 @@ struct pnv_eeh_ops {
78 int (*configure_bridge)(struct eeh_pe *pe); 78 int (*configure_bridge)(struct eeh_pe *pe);
79 int (*next_error)(struct eeh_pe **pe); 79 int (*next_error)(struct eeh_pe **pe);
80}; 80};
81
82#define PNV_EEH_STATE_ENABLED (1 << 0) /* EEH enabled */
83#define PNV_EEH_STATE_REMOVED (1 << 1) /* PHB removed */
84
81#endif /* CONFIG_EEH */ 85#endif /* CONFIG_EEH */
82 86
83struct pnv_phb { 87struct pnv_phb {
@@ -92,8 +96,7 @@ struct pnv_phb {
92 96
93#ifdef CONFIG_EEH 97#ifdef CONFIG_EEH
94 struct pnv_eeh_ops *eeh_ops; 98 struct pnv_eeh_ops *eeh_ops;
95 int eeh_enabled; 99 int eeh_state;
96 int removed;
97#endif 100#endif
98 101
99#ifdef CONFIG_DEBUG_FS 102#ifdef CONFIG_DEBUG_FS