ARM: imx: avic: Convert to using IRQCHIP_DECLARE
Subsystems (3)
PATCH v3 1/1 ARM: imx: avic: Convert to using IRQCHIP_DECLARE
Using IRQCHIP_DECLARE lets fw_devlink know that it should not wait for these interrupt controllers to be populated as struct devices. Without this change, fw_devlink=on will make the consumers of these interrupt controllers wait for the struct device to be added and thereby block the consumers' probes forever. Converting to IRQCHIP_DECLARE addresses boot issues on imx25 with fw_devlink=on that were reported by Martin.
This also removes a lot of boilerplate code.
---
v1 -> v2:
- Fixed compatible string
- Added Tested-by
v2 -> v3:
- Improved commit text
arch/arm/mach-imx/avic.c | 16 +++++++++++++++- arch/arm/mach-imx/common.h | 1 - arch/arm/mach-imx/mach-imx1.c | 11 ----------- arch/arm/mach-imx/mach-imx25.c | 12 ------------ arch/arm/mach-imx/mach-imx27.c | 12 ------------ arch/arm/mach-imx/mach-imx31.c | 1 - arch/arm/mach-imx/mach-imx35.c | 1 - arch/arm/mach-imx/mm-imx3.c | 24 ------------------------ 8 files changed, 15 insertions(+), 63 deletions(-)
arch/arm/mach-imx/avic.c +15 -1
@@ -7,6 +7,7 @@#include <linux/module.h> #include <linux/irq.h> #include <linux/irqdomain.h> +#include <linux/irqchip.h> #include <linux/io.h> #include <linux/of.h> #include <linux/of_address.h>
@@ -162,7 +163,7 @@ static void __exception_irq_entry avic_handle_irq(struct pt_regs *regs)* interrupts. It registers the interrupt enable and disable functions * to the kernel for each interrupt source. */ -void __init mxc_init_irq (void __iomem *irqbase) +static void __init mxc_init_irq (void __iomem *irqbase) {struct device_node *np;int irq_base;
@@ -220,3 +221,16 @@ void __init mxc_init_irq(void __iomem *irqbase)printk (KERN_INFO "MXC IRQ initialized\n" ); } + +static int __init imx_avic_init (struct device_node *node, +struct device_node *parent) +{ +void __iomem *avic_base; + + avic_base =of_iomap (node,0 ); +BUG_ON (!avic_base); +mxc_init_irq (avic_base); +return 0 ; +} + +IRQCHIP_DECLARE (imx_avic,"fsl,avic" , imx_avic_init);
arch/arm/mach-imx/common.h +0 -1
@@ -22,7 +22,6 @@ void mx35_map_io(void);void imx21_init_early (void );void imx31_init_early (void );void imx35_init_early (void ); -void mxc_init_irq (void __iomem *);void mx31_init_irq (void );void mx35_init_irq (void );void mxc_set_cpu_type (unsigned int type);
arch/arm/mach-imx/mach-imx1.c +0 -11
@@ -17,16 +17,6 @@ static void __init imx1_init_early(void)mxc_set_cpu_type (MXC_CPU_MX1 ); } -static void __init imx1_init_irq (void ) -{ -void __iomem *avic_addr; - - avic_addr =ioremap (MX1_AVIC_ADDR ,SZ_4K ); -WARN_ON (!avic_addr); - -mxc_init_irq (avic_addr); -} -static const char *const imx1_dt_board_compat[]__initconst = {"fsl,imx1" ,NULL
@@ -34,7 +24,6 @@ static const char * const imx1_dt_board_compat[] __initconst = {DT_MACHINE_START (IMX1_DT ,"Freescale i.MX1 (Device Tree Support)" ) .init_early = imx1_init_early, - .init_irq = imx1_init_irq, .dt_compat = imx1_dt_board_compat, .restart = mxc_restart,MACHINE_END
arch/arm/mach-imx/mach-imx25.c +0 -12
@@ -22,17 +22,6 @@ static void __init imx25_dt_init(void)imx_aips_allow_unprivileged_access ("fsl,imx25-aips" ); } -static void __init mx25_init_irq (void ) -{ -struct device_node *np; -void __iomem *avic_base; - - np =of_find_compatible_node (NULL ,NULL ,"fsl,avic" ); - avic_base =of_iomap (np,0 ); -BUG_ON (!avic_base); -mxc_init_irq (avic_base); -} -static const char *const imx25_dt_board_compat[]__initconst = {"fsl,imx25" ,NULL
@@ -42,6 +31,5 @@ DT_MACHINE_START(IMX25_DT, "Freescale i.MX25 (Device Tree Support)") .init_early = imx25_init_early, .init_machine = imx25_dt_init, .init_late = imx25_pm_init, - .init_irq = mx25_init_irq, .dt_compat = imx25_dt_board_compat,MACHINE_END
arch/arm/mach-imx/mach-imx27.c +0 -12
@@ -56,17 +56,6 @@ static void __init imx27_init_early(void)mxc_set_cpu_type (MXC_CPU_MX27 ); } -static void __init mx27_init_irq (void ) -{ -void __iomem *avic_base; -struct device_node *np; - - np =of_find_compatible_node (NULL ,NULL ,"fsl,avic" ); - avic_base =of_iomap (np,0 ); -BUG_ON (!avic_base); -mxc_init_irq (avic_base); -} -static const char *const imx27_dt_board_compat[]__initconst = {"fsl,imx27" ,NULL
@@ -75,7 +64,6 @@ static const char * const imx27_dt_board_compat[] __initconst = {DT_MACHINE_START (IMX27_DT ,"Freescale i.MX27 (Device Tree Support)" ) .map_io = mx27_map_io, .init_early = imx27_init_early, - .init_irq = mx27_init_irq, .init_late = imx27_pm_init, .dt_compat = imx27_dt_board_compat,MACHINE_END
arch/arm/mach-imx/mach-imx31.c +0 -1
@@ -14,6 +14,5 @@ static const char * const imx31_dt_board_compat[] __initconst = {DT_MACHINE_START (IMX31_DT ,"Freescale i.MX31 (Device Tree Support)" ) .map_io = mx31_map_io, .init_early = imx31_init_early, - .init_irq = mx31_init_irq, .dt_compat = imx31_dt_board_compat,MACHINE_END
arch/arm/mach-imx/mach-imx35.c +0 -1
@@ -27,6 +27,5 @@ DT_MACHINE_START(IMX35_DT, "Freescale i.MX35 (Device Tree Support)") .l2c_aux_mask = ~0, .map_io = mx35_map_io, .init_early = imx35_init_early, - .init_irq = mx35_init_irq, .dt_compat = imx35_dt_board_compat,MACHINE_END
arch/arm/mach-imx/mm-imx3.c +0 -24
@@ -109,18 +109,6 @@ void __init imx31_init_early(void) mx3_ccm_base =of_iomap (np,0 ); BUG_ON(!mx3_ccm_base); } - -void __init mx31_init_irq (void ) -{ -void __iomem *avic_base; -struct device_node *np; - - np =of_find_compatible_node (NULL ,NULL ,"fsl,imx31-avic" ); - avic_base =of_iomap (np,0 ); -BUG_ON (!avic_base); - -mxc_init_irq (avic_base); -}#endif /* ifdef CONFIG_SOC_IMX31 */ #ifdef CONFIG_SOC_IMX35
@@ -158,16 +146,4 @@ void __init imx35_init_early(void) mx3_ccm_base =of_iomap (np,0 ); BUG_ON(!mx3_ccm_base); } - -void __init mx35_init_irq (void ) -{ -void __iomem *avic_base; -struct device_node *np; - - np =of_find_compatible_node (NULL ,NULL ,"fsl,imx35-avic" ); - avic_base =of_iomap (np,0 ); -BUG_ON (!avic_base); - -mxc_init_irq (avic_base); -}#endif /* ifdef CONFIG_SOC_IMX35 */
Signature · 1 line
2.30.0.365.g02bc693789-goog
Hi Saravana,
Quoted 8 lines · Saravana Kannan
Using
IRQCHIP_DECLAREletsfw_devlinkknow that it should not wait for these interrupt controllers to be populated as struct devices. Without this change, fw_devlink=on will make the consumers of these interrupt controllers wait for the struct device to be added and thereby block the consumers' probes forever. Converting toIRQCHIP_DECLAREaddresses boot issues on imx25 with fw_devlink=on that were reported by Martin.
Quoted 6 lines
This also removes a lot of boilerplate code.
Fixes e590474768f1 ("driver core: Set fw_devlink=on by default")Reported-by Martin Kaiser <[email protected]>Signed-off-by Saravana Kannan <[email protected]>Tested-by Martin Kaiser <[email protected]>
Thanks for the respin:
Quoted 14 lines · Fabio Estevam
Hi Saravana,
Quoted 10 lines · Saravana Kannan
Using
IRQCHIP_DECLAREletsfw_devlinkknow that it should not wait for these interrupt controllers to be populated as struct devices. Without this change, fw_devlink=on will make the consumers of these interrupt controllers wait for the struct device to be added and thereby block the consumers' probes forever. Converting toIRQCHIP_DECLAREaddresses boot issues on imx25 with fw_devlink=on that were reported by Martin.This also removes a lot of boilerplate code.
Quoted 8 lines
Quoted 4 lines
Fixes e590474768f1 ("driver core: Set fw_devlink=on by default")Reported-by Martin Kaiser <[email protected]>Signed-off-by Saravana Kannan <[email protected]>Tested-by Martin Kaiser <[email protected]>Thanks for the respin:
Reviewed-by Fabio Estevam <[email protected]>
Thanks for the quick review.
-Saravana
Quoted 21 lines · Saravana Kannan
Quoted 19 lines · Fabio Estevam
Hi Saravana,
Quoted 14 lines · Saravana Kannan
Using
IRQCHIP_DECLAREletsfw_devlinkknow that it should not wait for these interrupt controllers to be populated as struct devices. Without this change, fw_devlink=on will make the consumers of these interrupt controllers wait for the struct device to be added and thereby block the consumers' probes forever. Converting toIRQCHIP_DECLAREaddresses boot issues on imx25 with fw_devlink=on that were reported by Martin.This also removes a lot of boilerplate code.
Fixes e590474768f1 ("driver core: Set fw_devlink=on by default")Reported-by Martin Kaiser <[email protected]>Signed-off-by Saravana Kannan <[email protected]>Tested-by Martin Kaiser <[email protected]>
Quoted 6 lines
Quoted 3 lines
Thanks for the respin:
Reviewed-by Fabio Estevam <[email protected]>Thanks for the quick review.
Maintainers,
Is this getting picked up for 5.12?
-Saravana
Quoted 25 lines · Saravana Kannan
Quoted 23 lines · Saravana Kannan
Quoted 21 lines · Fabio Estevam
Hi Saravana,
Quoted 8 lines · Saravana Kannan
Using
IRQCHIP_DECLAREletsfw_devlinkknow that it should not wait for these interrupt controllers to be populated as struct devices. Without this change, fw_devlink=on will make the consumers of these interrupt controllers wait for the struct device to be added and thereby block the consumers' probes forever. Converting toIRQCHIP_DECLAREaddresses boot issues on imx25 with fw_devlink=on that were reported by Martin.Quoted 6 lines
This also removes a lot of boilerplate code.
Fixes e590474768f1 ("driver core: Set fw_devlink=on by default")Reported-by Martin Kaiser <[email protected]>Signed-off-by Saravana Kannan <[email protected]>Tested-by Martin Kaiser <[email protected]>Thanks for the respin:
Quoted 9 lines
Quoted 4 lines
Quoted 1 line
Reviewed-by Fabio Estevam <[email protected]>Thanks for the quick review.
Maintainers,
Is this getting picked up for 5.12?
Gentle reminder.
-Saravana
Shawn Guo
AppliedQuoted 7 lines · Saravana Kannan
Using
IRQCHIP_DECLAREletsfw_devlinkknow that it should not wait for these interrupt controllers to be populated as struct devices. Without this change, fw_devlink=on will make the consumers of these interrupt controllers wait for the struct device to be added and thereby block the consumers' probes forever. Converting toIRQCHIP_DECLAREaddresses boot issues on imx25 with fw_devlink=on that were reported by Martin.
Quoted 6 lines
This also removes a lot of boilerplate code.
Fixes e590474768f1 ("driver core: Set fw_devlink=on by default")Reported-by Martin Kaiser <[email protected]>Signed-off-by Saravana Kannan <[email protected]>Tested-by Martin Kaiser <[email protected]>
Applied, thanks.
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel