powerpc/powernv: Rework EEH initialization on powernv
Subsystems (2)
PATCH 2/2 powerpc/powernv: Rework EEH initialization on powernv
Remove the post_init callback which is only used by powernv, we can just call it explicitly from the powernv code.
This partially kills the ability to "disable" eeh at runtime via debugfs as this was calling that same callback again, but this is both unused and broken in several ways. If we want to revive it, we need to create a dedicated enable/disable callback on the backend that does the right thing.
Let the bulk of eeh initialize normally at core_initcall() like it does on pseries by removing the hack in eeh_init() that delays it.
Instead we make sure our eeh->probe cleanly bails out of the PEs haven't been created yet and we force a re-probe where we used to call eeh_init() again.
--- arch/powerpc/include/asm/eeh.h | 8 ++--- arch/powerpc/kernel/eeh.c | 46 +++++++++------------------ arch/powerpc/platforms/powernv/eeh-powernv.c | 47 +++++++++++++++------------- arch/powerpc/platforms/powernv/pci-ioda.c | 3 +- arch/powerpc/platforms/powernv/pci.h | 1 + 5 files changed, 43 insertions(+), 62 deletions(-)
arch/powerpc/include/asm/eeh.h +2 -6
@@ -202,7 +202,6 @@ enum {struct eeh_ops {char *name;int (*init)(void ); -int (*post_init)(void );void * (*probe)(struct pci_dn *pdn,void *data);int (*set_option)(struct eeh_pe *pe,int option);int (*get_pe_addr)(struct eeh_pe *pe);
@@ -276,7 +275,7 @@ struct pci_bus *eeh_pe_bus_get(struct eeh_pe *pe);struct eeh_dev *eeh_dev_init (struct pci_dn *pdn);void eeh_dev_phb_init_dynamic (struct pci_controller *phb); -int eeh_init (void ); +void eeh_probe_devices (void );int __init eeh_ops_register (struct eeh_ops *ops); int __exit eeh_ops_unregister(const char *name);int eeh_check_failure (const volatile void __iomem *token);
@@ -322,10 +321,7 @@ static inline bool eeh_enabled(void)return false; } -static inline int eeh_init (void ) -{ -return 0 ; -} +static inline void eeh_probe_devices (void ) { }static inline void *eeh_dev_init (struct pci_dn *pdn,void *data) {
arch/powerpc/kernel/eeh.c +14 -32
74 lines not on this page · raw message
arch/powerpc/platforms/powernv/eeh-powernv.c +25 -22
90 lines not on this page · raw message
arch/powerpc/platforms/powernv/pci-ioda.c +1 -2
@@ -3294,8 +3294,7 @@ static void pnv_pci_ioda_fixup(void)pnv_pci_ioda_create_dbgfs ();#ifdef CONFIG_EEH -eeh_init (); -eeh_addr_cache_build (); +pnv_eeh_post_init ();#endif }
arch/powerpc/platforms/powernv/pci.h +1 -0
@@ -229,6 +229,7 @@ extern void pnv_teardown_msi_irqs(struct pci_dev *pdev);extern struct pnv_ioda_pe *pnv_ioda_get_pe (struct pci_dev *dev);extern void pnv_set_msi_irq_chip (struct pnv_phb *phb,unsigned int virq);extern bool pnv_pci_enable_device_hook (struct pci_dev *dev); +extern int pnv_eeh_post_init (void );extern void pe_level_printk (const struct pnv_ioda_pe *pe,const char *level,const char *fmt, ...);
Quoted 15 lines · Benjamin Herrenschmidt
Remove the
post_initcallback which is only used by powernv, we can just call it explicitly from the powernv code.This partially kills the ability to "disable" eeh at runtime via debugfs as this was calling that same callback again, but this is both unused and broken in several ways. If we want to revive it, we need to create a dedicated enable/disable callback on the backend that does the right thing.
Let the bulk of eeh initialize normally at
core_initcall()like it does on pseries by removing the hack ineeh_init()that delays it.
Quoted 5 lines
Instead we make sure our
eeh->probecleanly bails out of the PEs haven't been created yet and we force a re-probe where we used to calleeh_init()again.Signed-off-by Benjamin Herrenschmidt <[email protected]>
Quoted 15 lines · Benjamin Herrenschmidt
Remove the
post_initcallback which is only used by powernv, we can just call it explicitly from the powernv code.This partially kills the ability to "disable" eeh at runtime via debugfs as this was calling that same callback again, but this is both unused and broken in several ways. If we want to revive it, we need to create a dedicated enable/disable callback on the backend that does the right thing.
Let the bulk of eeh initialize normally at
core_initcall()like it does on pseries by removing the hack ineeh_init()that delays it.
Quoted 6 lines
Instead we make sure our
eeh->probecleanly bails out of the PEs haven't been created yet and we force a re-probe where we used to calleeh_init()again.Signed-off-by Benjamin Herrenschmidt <[email protected]>Acked-by Russell Currey <[email protected]>
Patch 2 applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/b9fde58db7e5738cacb740b0ec5479
cheers