powerpc/powernv: Sync OpalPciResetScope with firmware
authorGavin Shan <gwshan@linux.vnet.ibm.com>
Tue, 30 Sep 2014 02:39:05 +0000 (12:39 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 30 Sep 2014 07:15:17 +0000 (17:15 +1000)
The names of PCI reset scopes aren't sychronized with firmware.
The patch fixes it.

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/opal.h
arch/powerpc/platforms/powernv/eeh-ioda.c
arch/powerpc/platforms/powernv/pci-ioda.c

index f1579419e5c8aad9f6d41e98be0fa106b6118d1a..a084cf5bd76c724867dda64cdb455e26b3985500 100644 (file)
@@ -387,9 +387,12 @@ enum OpalM64EnableAction {
 };
 
 enum OpalPciResetScope {
-       OPAL_PHB_COMPLETE = 1, OPAL_PCI_LINK = 2, OPAL_PHB_ERROR = 3,
-       OPAL_PCI_HOT_RESET = 4, OPAL_PCI_FUNDAMENTAL_RESET = 5,
-       OPAL_PCI_IODA_TABLE_RESET = 6,
+       OPAL_RESET_PHB_COMPLETE         = 1,
+       OPAL_RESET_PCI_LINK             = 2,
+       OPAL_RESET_PHB_ERROR            = 3,
+       OPAL_RESET_PCI_HOT              = 4,
+       OPAL_RESET_PCI_FUNDAMENTAL      = 5,
+       OPAL_RESET_PCI_IODA_TABLE       = 6
 };
 
 enum OpalPciReinitScope {
index d6fb90b32525e39abb69c8c80b848c9893ca9c65..ecb293ef1fec226ca73d5ace4a63373ed7a430e5 100644 (file)
@@ -514,11 +514,11 @@ int ioda_eeh_phb_reset(struct pci_controller *hose, int option)
        if (option == EEH_RESET_FUNDAMENTAL ||
            option == EEH_RESET_HOT)
                rc = opal_pci_reset(phb->opal_id,
-                               OPAL_PHB_COMPLETE,
+                               OPAL_RESET_PHB_COMPLETE,
                                OPAL_ASSERT_RESET);
        else if (option == EEH_RESET_DEACTIVATE)
                rc = opal_pci_reset(phb->opal_id,
-                               OPAL_PHB_COMPLETE,
+                               OPAL_RESET_PHB_COMPLETE,
                                OPAL_DEASSERT_RESET);
        if (rc < 0)
                goto out;
@@ -558,15 +558,15 @@ static int ioda_eeh_root_reset(struct pci_controller *hose, int option)
         */
        if (option == EEH_RESET_FUNDAMENTAL)
                rc = opal_pci_reset(phb->opal_id,
-                               OPAL_PCI_FUNDAMENTAL_RESET,
+                               OPAL_RESET_PCI_FUNDAMENTAL,
                                OPAL_ASSERT_RESET);
        else if (option == EEH_RESET_HOT)
                rc = opal_pci_reset(phb->opal_id,
-                               OPAL_PCI_HOT_RESET,
+                               OPAL_RESET_PCI_HOT,
                                OPAL_ASSERT_RESET);
        else if (option == EEH_RESET_DEACTIVATE)
                rc = opal_pci_reset(phb->opal_id,
-                               OPAL_PCI_HOT_RESET,
+                               OPAL_RESET_PCI_HOT,
                                OPAL_DEASSERT_RESET);
        if (rc < 0)
                goto out;
@@ -697,7 +697,7 @@ static int ioda_eeh_reset(struct eeh_pe *pe, int option)
                    (option == EEH_RESET_HOT ||
                    option == EEH_RESET_FUNDAMENTAL)) {
                        rc = opal_pci_reset(phb->opal_id,
-                                           OPAL_PHB_ERROR,
+                                           OPAL_RESET_PHB_ERROR,
                                            OPAL_ASSERT_RESET);
                        if (rc != OPAL_SUCCESS) {
                                pr_warn("%s: Failure %lld clearing "
index bc79bbdbb6c74a828e59428fe989b6527f2f7d09..8685dacccb0b9d9dc0f35bce089d62a5ab81fef4 100644 (file)
@@ -1626,7 +1626,7 @@ static u32 pnv_ioda_bdfn_to_pe(struct pnv_phb *phb, struct pci_bus *bus,
 
 static void pnv_pci_ioda_shutdown(struct pnv_phb *phb)
 {
-       opal_pci_reset(phb->opal_id, OPAL_PCI_IODA_TABLE_RESET,
+       opal_pci_reset(phb->opal_id, OPAL_RESET_PCI_IODA_TABLE,
                       OPAL_ASSERT_RESET);
 }
 
@@ -1802,7 +1802,7 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np,
        pci_add_flags(PCI_REASSIGN_ALL_RSRC);
 
        /* Reset IODA tables to a clean state */
-       rc = opal_pci_reset(phb_id, OPAL_PCI_IODA_TABLE_RESET, OPAL_ASSERT_RESET);
+       rc = opal_pci_reset(phb_id, OPAL_RESET_PCI_IODA_TABLE, OPAL_ASSERT_RESET);
        if (rc)
                pr_warning("  OPAL Error %ld performing IODA table reset !\n", rc);