MIPS: Allow modules to set board_be_handler
Guenter Roeck
Tested-byQuoted 9 lines · Florian Fainelli
After making the
brcmstb_gisbdriver modular with707a4cdf86e5("bus:brcmstb_gisb: Allow building as module") Guenter reported that mips allmodconfig failed to link becauseboard_be_handlerwas referenced.Thomas indicated that if we were to continue making the
brcmstb_gisbdriver modular for MIPS we would need to introduce a function that allows setting theboard_be_handlerand export that function towards modules.
Quoted 7 lines
This is what is being done here:
board_be_handleris made static and is now settable with amips_set_be_handler()function which is exported.Reported-by Guenter Roeck <[email protected]>Suggested-by Thomas Bogendoerfer <[email protected]>Fixes 707a4cdf86e5 ("bus: brcmstb_gisb: Allow building as module")Signed-off-by Florian Fainelli <[email protected]>
Tested-by Guenter Roeck <[email protected]>
Quoted 198 lines
--- arch/mips/dec/setup.c | 6 +++--- arch/mips/include/asm/traps.h | 2 +- arch/mips/kernel/traps.c | 8 +++++++- arch/mips/sgi-ip22/ip22-berr.c | 2 +- arch/mips/sgi-ip22/ip28-berr.c | 2 +- arch/mips/sgi-ip27/ip27-berr.c | 2 +- arch/mips/sgi-ip32/ip32-berr.c | 2 +- arch/mips/sibyte/swarm/setup.c | 2 +- arch/mips/txx9/generic/setup_tx4927.c | 2 +- arch/mips/txx9/generic/setup_tx4938.c | 2 +- arch/mips/txx9/generic/setup_tx4939.c | 2 +- drivers/bus/brcmstb_gisb.c | 2 +- 12 files changed, 20 insertions(+), 14 deletions(-)arch/mips/dec/setup.c +3
-3@@ -117,21 +117,21 @@ static void __init dec_be_init(void) {switch (mips_machtype) {case MACH_DS23100 :/* DS2100/DS3100 Pmin/Pmax */ - board_be_handler = dec_kn01_be_handler; +mips_set_be_handler (dec_kn01_be_handler); busirq_handler = dec_kn01_be_interrupt; busirq_flags |=IRQF_SHARED ;dec_kn01_be_init ();break ;case MACH_DS5000_1XX :/* DS5000/1xx 3min */ case MACH_DS5000_XX :/* DS5000/xx Maxine */ - board_be_handler = dec_kn02xa_be_handler; +mips_set_be_handler (dec_kn02xa_be_handler); busirq_handler = dec_kn02xa_be_interrupt;dec_kn02xa_be_init ();break ;case MACH_DS5000_200 :/* DS5000/200 3max */ case MACH_DS5000_2X0 :/* DS5000/240 3max+ */ case MACH_DS5900 :/* DS5900 bigmax */ - board_be_handler = dec_ecc_be_handler; +mips_set_be_handler (dec_ecc_be_handler); busirq_handler = dec_ecc_be_interrupt;dec_ecc_be_init ();break ;arch/mips/include/asm/traps.h +1
-1@@ -15,7 +15,7 @@#define MIPS_BE_FATAL 2/* treat as an unrecoverable error */ extern void (*board_be_init)(void ); -extern int (*board_be_handler)(struct pt_regs *regs,int is_fixup); +void mips_set_be_handler (int (*handler)(struct pt_regs *reg,int is_fixup));extern void (*board_nmi_handler_setup)(void );extern void (*board_ejtag_handler_setup)(void );arch/mips/kernel/traps.c +7
-1@@ -103,13 +103,19 @@ extern asmlinkage void handle_reserved(void);extern void tlb_do_page_fault_0 (void );void (*board_be_init)(void ); -int (*board_be_handler)(struct pt_regs *regs,int is_fixup); +static int (*board_be_handler)(struct pt_regs *regs,int is_fixup);void (*board_nmi_handler_setup)(void );void (*board_ejtag_handler_setup)(void );void (*board_bind_eic_interrupt)(int irq,int regset);void (*board_ebase_setup)(void );void (*board_cache_error_setup)(void ); +void mips_set_be_handler (int (*handler)(struct pt_regs *regs,int is_fixup)) +{ + board_be_handler = handler; +} +EXPORT_SYMBOL_GPL (mips_set_be_handler); +static void show_raw_backtrace (unsigned long reg29,const char *loglvl,bool user) {arch/mips/sgi-ip22/ip22-berr.c +1
-1@@ -112,5 +112,5 @@ static int ip22_be_handler(struct pt_regs *regs, int is_fixup)void __init ip22_be_init (void ) { - board_be_handler = ip22_be_handler; +mips_set_be_handler (ip22_be_handler); }arch/mips/sgi-ip22/ip28-berr.c +1
-1@@ -468,7 +468,7 @@ static int ip28_be_handler(struct pt_regs *regs, int is_fixup)void __init ip22_be_init (void ) { - board_be_handler = ip28_be_handler; +mips_set_be_handler (ip28_be_handler); }int ip28_show_be_info (struct seq_file *m)arch/mips/sgi-ip27/ip27-berr.c +1
-1@@ -85,7 +85,7 @@ void __init ip27_be_init(void)int cpu =LOCAL_HUB_L (PI_CPU_NUM );int cpuoff = cpu <<8 ; - board_be_handler = ip27_be_handler; +mips_set_be_handler (ip27_be_handler);LOCAL_HUB_S (PI_ERR_INT_PEND , cpu ?PI_ERR_CLEAR_ALL_B :PI_ERR_CLEAR_ALL_A );arch/mips/sgi-ip32/ip32-berr.c +1
-1@@ -34,5 +34,5 @@ static int ip32_be_handler(struct pt_regs *regs, int is_fixup)void __init ip32_be_init (void ) { - board_be_handler = ip32_be_handler; +mips_set_be_handler (ip32_be_handler); }arch/mips/sibyte/swarm/setup.c +1
-1@@ -122,7 +122,7 @@ void __init plat_mem_setup(void)#error invalid SiByte board configuration#endif - board_be_handler = swarm_be_handler; +mips_set_be_handler (swarm_be_handler);if (xicor_probe ()) swarm_rtc_type =RTC_XICOR ;arch/mips/txx9/generic/setup_tx4927.c +1
-1@@ -80,7 +80,7 @@ static int tx4927_be_handler(struct pt_regs *regs, int is_fixup) }static void __init tx4927_be_init (void ) { - board_be_handler = tx4927_be_handler; +mips_set_be_handler (tx4927_be_handler); }static struct resource tx4927_sdram_resource[4 ];arch/mips/txx9/generic/setup_tx4938.c +1
-1@@ -82,7 +82,7 @@ static int tx4938_be_handler(struct pt_regs *regs, int is_fixup) }static void __init tx4938_be_init (void ) { - board_be_handler = tx4938_be_handler; +mips_set_be_handler (tx4938_be_handler); }static struct resource tx4938_sdram_resource[4 ];arch/mips/txx9/generic/setup_tx4939.c +1
-1@@ -86,7 +86,7 @@ static int tx4939_be_handler(struct pt_regs *regs, int is_fixup) }static void __init tx4939_be_init (void ) { - board_be_handler = tx4939_be_handler; +mips_set_be_handler (tx4939_be_handler); }static struct resource tx4939_sdram_resource[4 ];drivers/bus/brcmstb_gisb.c +1
-1@@ -485,7 +485,7 @@ static int __init brcmstb_gisb_arb_probe(struct platform_device *pdev)list_add_tail (&gdev->next, &brcmstb_gisb_arb_device_list);#ifdef CONFIG_MIPS - board_be_handler = brcmstb_bus_error_handler; +mips_set_be_handler (brcmstb_bus_error_handler);#endif if (list_is_singular (&brcmstb_gisb_arb_device_list)) {Signature · 1 line
2.25.1