diff options
author | Gavin Shan <gwshan@linux.vnet.ibm.com> | 2014-04-24 04:00:09 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-04-28 03:33:48 -0400 |
commit | f5bc6b70d2f1e4d7c6d2956e9e66a6a55821460d (patch) | |
tree | 10dae1ff7373c408a1443e6db36d938a15afa4e6 /arch/powerpc | |
parent | 467f79a9564b8fafa83adb53471aebe8cf75fb8e (diff) |
powerpc/powernv: Move PNV_EEH_STATE_ENABLED around
The flag PNV_EEH_STATE_ENABLED is put into pnv_phb::eeh_state,
which is protected by CONFIG_EEH. We needn't that. Instead, we
can have pnv_phb::flags and maintain all flags there, which is
the purpose of the patch. The patch also renames PNV_EEH_STATE_ENABLED
to PNV_PHB_FLAG_EEH.
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/platforms/powernv/eeh-ioda.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/powernv/pci.c | 8 | ||||
-rw-r--r-- | arch/powerpc/platforms/powernv/pci.h | 7 |
3 files changed, 6 insertions, 11 deletions
diff --git a/arch/powerpc/platforms/powernv/eeh-ioda.c b/arch/powerpc/platforms/powernv/eeh-ioda.c index 5432598447d9..9ff7b2de119c 100644 --- a/arch/powerpc/platforms/powernv/eeh-ioda.c +++ b/arch/powerpc/platforms/powernv/eeh-ioda.c | |||
@@ -154,7 +154,7 @@ static int ioda_eeh_post_init(struct pci_controller *hose) | |||
154 | } | 154 | } |
155 | #endif | 155 | #endif |
156 | 156 | ||
157 | phb->eeh_state |= PNV_EEH_STATE_ENABLED; | 157 | phb->flags |= PNV_PHB_FLAG_EEH; |
158 | 158 | ||
159 | return 0; | 159 | return 0; |
160 | } | 160 | } |
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c index 8518817dcdfd..114e1a700446 100644 --- a/arch/powerpc/platforms/powernv/pci.c +++ b/arch/powerpc/platforms/powernv/pci.c | |||
@@ -426,7 +426,7 @@ int pnv_pci_cfg_read(struct device_node *dn, | |||
426 | if (phb_pe && (phb_pe->state & EEH_PE_ISOLATED)) | 426 | if (phb_pe && (phb_pe->state & EEH_PE_ISOLATED)) |
427 | return PCIBIOS_SUCCESSFUL; | 427 | return PCIBIOS_SUCCESSFUL; |
428 | 428 | ||
429 | if (phb->eeh_state & PNV_EEH_STATE_ENABLED) { | 429 | if (phb->flags & PNV_PHB_FLAG_EEH) { |
430 | if (*val == EEH_IO_ERROR_VALUE(size) && | 430 | if (*val == EEH_IO_ERROR_VALUE(size) && |
431 | eeh_dev_check_failure(of_node_to_eeh_dev(dn))) | 431 | eeh_dev_check_failure(of_node_to_eeh_dev(dn))) |
432 | return PCIBIOS_DEVICE_NOT_FOUND; | 432 | return PCIBIOS_DEVICE_NOT_FOUND; |
@@ -464,12 +464,8 @@ int pnv_pci_cfg_write(struct device_node *dn, | |||
464 | } | 464 | } |
465 | 465 | ||
466 | /* Check if the PHB got frozen due to an error (no response) */ | 466 | /* Check if the PHB got frozen due to an error (no response) */ |
467 | #ifdef CONFIG_EEH | 467 | if (!(phb->flags & PNV_PHB_FLAG_EEH)) |
468 | if (!(phb->eeh_state & PNV_EEH_STATE_ENABLED)) | ||
469 | pnv_pci_config_check_eeh(phb, dn); | 468 | pnv_pci_config_check_eeh(phb, dn); |
470 | #else | ||
471 | pnv_pci_config_check_eeh(phb, dn); | ||
472 | #endif | ||
473 | 469 | ||
474 | return PCIBIOS_SUCCESSFUL; | 470 | return PCIBIOS_SUCCESSFUL; |
475 | } | 471 | } |
diff --git a/arch/powerpc/platforms/powernv/pci.h b/arch/powerpc/platforms/powernv/pci.h index 6870f60b9799..94e3495b7f2b 100644 --- a/arch/powerpc/platforms/powernv/pci.h +++ b/arch/powerpc/platforms/powernv/pci.h | |||
@@ -81,24 +81,23 @@ struct pnv_eeh_ops { | |||
81 | int (*configure_bridge)(struct eeh_pe *pe); | 81 | int (*configure_bridge)(struct eeh_pe *pe); |
82 | int (*next_error)(struct eeh_pe **pe); | 82 | int (*next_error)(struct eeh_pe **pe); |
83 | }; | 83 | }; |
84 | |||
85 | #define PNV_EEH_STATE_ENABLED (1 << 0) /* EEH enabled */ | ||
86 | |||
87 | #endif /* CONFIG_EEH */ | 84 | #endif /* CONFIG_EEH */ |
88 | 85 | ||
86 | #define PNV_PHB_FLAG_EEH (1 << 0) | ||
87 | |||
89 | struct pnv_phb { | 88 | struct pnv_phb { |
90 | struct pci_controller *hose; | 89 | struct pci_controller *hose; |
91 | enum pnv_phb_type type; | 90 | enum pnv_phb_type type; |
92 | enum pnv_phb_model model; | 91 | enum pnv_phb_model model; |
93 | u64 hub_id; | 92 | u64 hub_id; |
94 | u64 opal_id; | 93 | u64 opal_id; |
94 | int flags; | ||
95 | void __iomem *regs; | 95 | void __iomem *regs; |
96 | int initialized; | 96 | int initialized; |
97 | spinlock_t lock; | 97 | spinlock_t lock; |
98 | 98 | ||
99 | #ifdef CONFIG_EEH | 99 | #ifdef CONFIG_EEH |
100 | struct pnv_eeh_ops *eeh_ops; | 100 | struct pnv_eeh_ops *eeh_ops; |
101 | int eeh_state; | ||
102 | #endif | 101 | #endif |
103 | 102 | ||
104 | #ifdef CONFIG_DEBUG_FS | 103 | #ifdef CONFIG_DEBUG_FS |