powerpc/eeh: Remove EEH_PE_PHB_DEAD
authorGavin Shan <gwshan@linux.vnet.ibm.com>
Thu, 24 Apr 2014 08:00:07 +0000 (18:00 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 28 Apr 2014 07:33:39 +0000 (17:33 +1000)
The PE state (for eeh_pe instance) EEH_PE_PHB_DEAD is duplicate to
EEH_PE_ISOLATED. Originally, those PHBs (PHB PE) with EEH_PE_PHB_DEAD
would be removed from the system. However, it's safe to replace
that with EEH_PE_ISOLATED.

The patch also clear EEH_PE_RECOVERING after fenced PHB has been handled,
either failure or success. It makes the PHB PE state consistent with:

PHB functions normally   NONE
PHB has been removed   EEH_PE_ISOLATED
PHB fenced, recovery in progress  EEH_PE_ISOLATED | RECOVERING

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/include/asm/eeh.h
arch/powerpc/kernel/eeh.c
arch/powerpc/kernel/eeh_driver.c

index d4dd41fb951b343918dda3db91399702d0e86423..a61b06f86d80981fa1628cf44acaf2dc7d8089af 100644 (file)
@@ -53,7 +53,6 @@ struct device_node;
 
 #define EEH_PE_ISOLATED                (1 << 0)        /* Isolated PE          */
 #define EEH_PE_RECOVERING      (1 << 1)        /* Recovering PE        */
-#define EEH_PE_PHB_DEAD                (1 << 2)        /* Dead PHB             */
 
 #define EEH_PE_KEEP            (1 << 8)        /* Keep PE on hotplug   */
 
index e7b76a6bf15083704136459dc1dc69f2c6c9183e..f1676762f6de0fe3a5cb033115b87dacc4191c0f 100644 (file)
@@ -232,7 +232,6 @@ void eeh_slot_error_detail(struct eeh_pe *pe, int severity)
 {
        size_t loglen = 0;
        struct eeh_dev *edev, *tmp;
-       bool valid_cfg_log = true;
 
        /*
         * When the PHB is fenced or dead, it's pointless to collect
@@ -240,12 +239,7 @@ void eeh_slot_error_detail(struct eeh_pe *pe, int severity)
         * 0xFF's. For ER, we still retrieve the data from the PCI
         * config space.
         */
-       if (eeh_probe_mode_dev() &&
-           (pe->type & EEH_PE_PHB) &&
-           (pe->state & (EEH_PE_ISOLATED | EEH_PE_PHB_DEAD)))
-               valid_cfg_log = false;
-
-       if (valid_cfg_log) {
+       if (!(pe->type & EEH_PE_PHB)) {
                eeh_pci_enable(pe, EEH_OPT_THAW_MMIO);
                eeh_ops->configure_bridge(pe);
                eeh_pe_restore_bars(pe);
@@ -309,7 +303,7 @@ static int eeh_phb_check_failure(struct eeh_pe *pe)
 
        /* If the PHB has been in problematic state */
        eeh_serialize_lock(&flags);
-       if (phb_pe->state & (EEH_PE_ISOLATED | EEH_PE_PHB_DEAD)) {
+       if (phb_pe->state & EEH_PE_ISOLATED) {
                ret = 0;
                goto out;
        }
index bb61ca58ca6d8272955d7023852f97cbe180c676..1ddc046c69cf8f55dc633988a1f81fef1c202478 100644 (file)
@@ -682,8 +682,7 @@ static void eeh_handle_special_event(void)
                                phb_pe = eeh_phb_pe_get(hose);
                                if (!phb_pe) continue;
 
-                               eeh_pe_state_mark(phb_pe,
-                                       EEH_PE_ISOLATED | EEH_PE_PHB_DEAD);
+                               eeh_pe_state_mark(phb_pe, EEH_PE_ISOLATED);
                        }
 
                        eeh_serialize_unlock(flags);
@@ -699,8 +698,7 @@ static void eeh_handle_special_event(void)
                        eeh_remove_event(pe);
 
                        if (rc == EEH_NEXT_ERR_DEAD_PHB)
-                               eeh_pe_state_mark(pe,
-                                       EEH_PE_ISOLATED | EEH_PE_PHB_DEAD);
+                               eeh_pe_state_mark(pe, EEH_PE_ISOLATED);
                        else
                                eeh_pe_state_mark(pe,
                                        EEH_PE_ISOLATED | EEH_PE_RECOVERING);
@@ -724,12 +722,14 @@ static void eeh_handle_special_event(void)
                if (rc == EEH_NEXT_ERR_FROZEN_PE ||
                    rc == EEH_NEXT_ERR_FENCED_PHB) {
                        eeh_handle_normal_event(pe);
+                       eeh_pe_state_clear(pe, EEH_PE_RECOVERING);
                } else {
                        pci_lock_rescan_remove();
                        list_for_each_entry(hose, &hose_list, list_node) {
                                phb_pe = eeh_phb_pe_get(hose);
                                if (!phb_pe ||
-                                   !(phb_pe->state & EEH_PE_PHB_DEAD))
+                                   !(phb_pe->state & EEH_PE_ISOLATED) ||
+                                   (phb_pe->state & EEH_PE_RECOVERING))
                                        continue;
 
                                /* Notify all devices to be down */