powerpc/powernv: Move PNV_EEH_STATE_ENABLED around
authorGavin Shan <gwshan@linux.vnet.ibm.com>
Thu, 24 Apr 2014 08:00:09 +0000 (18:00 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 28 Apr 2014 07:33:48 +0000 (17:33 +1000)
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>
arch/powerpc/platforms/powernv/eeh-ioda.c
arch/powerpc/platforms/powernv/pci.c
arch/powerpc/platforms/powernv/pci.h

index 5432598447d9875e576a3bc3cd79cfe4ac7808ca..9ff7b2de119c39f063041417ce0077a0c4df4dd0 100644 (file)
@@ -154,7 +154,7 @@ static int ioda_eeh_post_init(struct pci_controller *hose)
        }
 #endif
 
-       phb->eeh_state |= PNV_EEH_STATE_ENABLED;
+       phb->flags |= PNV_PHB_FLAG_EEH;
 
        return 0;
 }
index 8518817dcdfdc95d04e3b1fc10bfe54432330079..114e1a700446c183c34cac5478e0fe0b0180cbdf 100644 (file)
@@ -426,7 +426,7 @@ int pnv_pci_cfg_read(struct device_node *dn,
        if (phb_pe && (phb_pe->state & EEH_PE_ISOLATED))
                return PCIBIOS_SUCCESSFUL;
 
-       if (phb->eeh_state & PNV_EEH_STATE_ENABLED) {
+       if (phb->flags & PNV_PHB_FLAG_EEH) {
                if (*val == EEH_IO_ERROR_VALUE(size) &&
                    eeh_dev_check_failure(of_node_to_eeh_dev(dn)))
                        return PCIBIOS_DEVICE_NOT_FOUND;
@@ -464,12 +464,8 @@ int pnv_pci_cfg_write(struct device_node *dn,
        }
 
        /* Check if the PHB got frozen due to an error (no response) */
-#ifdef CONFIG_EEH
-       if (!(phb->eeh_state & PNV_EEH_STATE_ENABLED))
+       if (!(phb->flags & PNV_PHB_FLAG_EEH))
                pnv_pci_config_check_eeh(phb, dn);
-#else
-       pnv_pci_config_check_eeh(phb, dn);
-#endif
 
        return PCIBIOS_SUCCESSFUL;
 }
index 6870f60b9799ab3d4a3cbae92df8dea574b515d2..94e3495b7f2b87e201b68a8c0aa26227858e9364 100644 (file)
@@ -81,24 +81,23 @@ struct pnv_eeh_ops {
        int (*configure_bridge)(struct eeh_pe *pe);
        int (*next_error)(struct eeh_pe **pe);
 };
-
-#define PNV_EEH_STATE_ENABLED  (1 << 0)        /* EEH enabled  */
-
 #endif /* CONFIG_EEH */
 
+#define PNV_PHB_FLAG_EEH       (1 << 0)
+
 struct pnv_phb {
        struct pci_controller   *hose;
        enum pnv_phb_type       type;
        enum pnv_phb_model      model;
        u64                     hub_id;
        u64                     opal_id;
+       int                     flags;
        void __iomem            *regs;
        int                     initialized;
        spinlock_t              lock;
 
 #ifdef CONFIG_EEH
        struct pnv_eeh_ops      *eeh_ops;
-       int                     eeh_state;
 #endif
 
 #ifdef CONFIG_DEBUG_FS