OSDN Git Service

powerpc/eeh: Cleanup EEH_POSTPONED_PROBE
authorSam Bobroff <sbobroff@linux.ibm.com>
Wed, 12 Sep 2018 01:23:23 +0000 (11:23 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sat, 13 Oct 2018 11:21:25 +0000 (22:21 +1100)
Currently a flag, EEH_POSTPONED_PROBE, is used to prevent an incorrect
message "EEH: No capable adapters found" from being displayed during
the boot of powernv systems.

It is necessary because, on powernv, the call to eeh_probe_devices()
made from eeh_init() is too early and EEH can't yet be enabled. A
second call is made later from eeh_pnv_post_init(), which succeeds.

(On pseries, the first call succeeds because PCI devices are set up
early enough and no second call is made.)

This can be simplified by moving the early call to eeh_probe_devices()
from eeh_init() (where it's seen by both platforms) to
pSeries_final_fixup(), so that each platform only calls
eeh_probe_devices() once, at a point where it can succeed.
This is slightly later in the boot sequence, but but still early
enough and it is now in the same place in the sequence for both
platforms (the pcibios_fixup hook).

The display of the message can be cleaned up as well, by moving it
into eeh_probe_devices().

Signed-off-by: Sam Bobroff <sbobroff@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/eeh.h
arch/powerpc/kernel/eeh.c
arch/powerpc/platforms/powernv/eeh-powernv.c
arch/powerpc/platforms/pseries/pci.c

index 219637e..147f011 100644 (file)
@@ -43,7 +43,6 @@ struct pci_dn;
 #define EEH_VALID_PE_ZERO      0x10    /* PE#0 is valid                     */
 #define EEH_ENABLE_IO_FOR_LOG  0x20    /* Enable IO for log                 */
 #define EEH_EARLY_DUMP_LOG     0x40    /* Dump log immediately              */
-#define EEH_POSTPONED_PROBE    0x80    /* Powernv may postpone device probe */
 
 /*
  * Delay for PE reset, all in ms
index c72767a..8801ada 100644 (file)
@@ -1041,6 +1041,11 @@ void eeh_probe_devices(void)
                pdn = hose->pci_data;
                traverse_pci_dn(pdn, eeh_ops->probe, NULL);
        }
+       if (eeh_enabled())
+               pr_info("EEH: PCI Enhanced I/O Error Handling Enabled\n");
+       else
+               pr_info("EEH: No capable adapters found\n");
+
 }
 
 /**
@@ -1084,18 +1089,7 @@ static int eeh_init(void)
                eeh_dev_phb_init_dynamic(hose);
 
        /* Initialize EEH event */
-       ret = eeh_event_init();
-       if (ret)
-               return ret;
-
-       eeh_probe_devices();
-
-       if (eeh_enabled())
-               pr_info("EEH: PCI Enhanced I/O Error Handling Enabled\n");
-       else if (!eeh_has_flag(EEH_POSTPONED_PROBE))
-               pr_info("EEH: No capable adapters found\n");
-
-       return ret;
+       return eeh_event_init();
 }
 
 core_initcall_sync(eeh_init);
index 3c1beae..d0764f2 100644 (file)
@@ -223,14 +223,6 @@ int pnv_eeh_post_init(void)
        eeh_probe_devices();
        eeh_addr_cache_build();
 
-       if (eeh_has_flag(EEH_POSTPONED_PROBE)) {
-               eeh_clear_flag(EEH_POSTPONED_PROBE);
-               if (eeh_enabled())
-                       pr_info("EEH: PCI Enhanced I/O Error Handling Enabled\n");
-               else
-                       pr_info("EEH: No capable adapters found\n");
-       }
-
        /* Register OPAL event notifier */
        eeh_event_irq = opal_event_request(ilog2(OPAL_EVENT_PCI_ERROR));
        if (eeh_event_irq < 0) {
@@ -391,12 +383,6 @@ static void *pnv_eeh_probe(struct pci_dn *pdn, void *data)
        if ((pdn->class_code >> 8) == PCI_CLASS_BRIDGE_ISA)
                return NULL;
 
-       /* Skip if we haven't probed yet */
-       if (phb->ioda.pe_rmap[config_addr] == IODA_INVALID_PE) {
-               eeh_add_flag(EEH_POSTPONED_PROBE);
-               return NULL;
-       }
-
        /* Initialize eeh device */
        edev->class_code = pdn->class_code;
        edev->mode      &= 0xFFFFFF00;
index eab9663..41d8a4d 100644 (file)
@@ -239,6 +239,7 @@ void __init pSeries_final_fixup(void)
 {
        pSeries_request_regions();
 
+       eeh_probe_devices();
        eeh_addr_cache_build();
 
 #ifdef CONFIG_PCI_IOV