Skip to content

Commit e2c1b0f

Browse files
Saravana KannanShawn Guo
authored andcommitted
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. Fixes: e590474 ("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]> Reviewed-by: Fabio Estevam <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
1 parent a38fd87 commit e2c1b0f

File tree

8 files changed

+15
-63
lines changed

8 files changed

+15
-63
lines changed

arch/arm/mach-imx/avic.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <linux/module.h>
88
#include <linux/irq.h>
99
#include <linux/irqdomain.h>
10+
#include <linux/irqchip.h>
1011
#include <linux/io.h>
1112
#include <linux/of.h>
1213
#include <linux/of_address.h>
@@ -162,7 +163,7 @@ static void __exception_irq_entry avic_handle_irq(struct pt_regs *regs)
162163
* interrupts. It registers the interrupt enable and disable functions
163164
* to the kernel for each interrupt source.
164165
*/
165-
void __init mxc_init_irq(void __iomem *irqbase)
166+
static void __init mxc_init_irq(void __iomem *irqbase)
166167
{
167168
struct device_node *np;
168169
int irq_base;
@@ -220,3 +221,16 @@ void __init mxc_init_irq(void __iomem *irqbase)
220221

221222
printk(KERN_INFO "MXC IRQ initialized\n");
222223
}
224+
225+
static int __init imx_avic_init(struct device_node *node,
226+
struct device_node *parent)
227+
{
228+
void __iomem *avic_base;
229+
230+
avic_base = of_iomap(node, 0);
231+
BUG_ON(!avic_base);
232+
mxc_init_irq(avic_base);
233+
return 0;
234+
}
235+
236+
IRQCHIP_DECLARE(imx_avic, "fsl,avic", imx_avic_init);

arch/arm/mach-imx/common.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ void mx35_map_io(void);
2222
void imx21_init_early(void);
2323
void imx31_init_early(void);
2424
void imx35_init_early(void);
25-
void mxc_init_irq(void __iomem *);
2625
void mx31_init_irq(void);
2726
void mx35_init_irq(void);
2827
void mxc_set_cpu_type(unsigned int type);

arch/arm/mach-imx/mach-imx1.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,13 @@ static void __init imx1_init_early(void)
1717
mxc_set_cpu_type(MXC_CPU_MX1);
1818
}
1919

20-
static void __init imx1_init_irq(void)
21-
{
22-
void __iomem *avic_addr;
23-
24-
avic_addr = ioremap(MX1_AVIC_ADDR, SZ_4K);
25-
WARN_ON(!avic_addr);
26-
27-
mxc_init_irq(avic_addr);
28-
}
29-
3020
static const char * const imx1_dt_board_compat[] __initconst = {
3121
"fsl,imx1",
3222
NULL
3323
};
3424

3525
DT_MACHINE_START(IMX1_DT, "Freescale i.MX1 (Device Tree Support)")
3626
.init_early = imx1_init_early,
37-
.init_irq = imx1_init_irq,
3827
.dt_compat = imx1_dt_board_compat,
3928
.restart = mxc_restart,
4029
MACHINE_END

arch/arm/mach-imx/mach-imx25.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,6 @@ static void __init imx25_dt_init(void)
2222
imx_aips_allow_unprivileged_access("fsl,imx25-aips");
2323
}
2424

25-
static void __init mx25_init_irq(void)
26-
{
27-
struct device_node *np;
28-
void __iomem *avic_base;
29-
30-
np = of_find_compatible_node(NULL, NULL, "fsl,avic");
31-
avic_base = of_iomap(np, 0);
32-
BUG_ON(!avic_base);
33-
mxc_init_irq(avic_base);
34-
}
35-
3625
static const char * const imx25_dt_board_compat[] __initconst = {
3726
"fsl,imx25",
3827
NULL
@@ -42,6 +31,5 @@ DT_MACHINE_START(IMX25_DT, "Freescale i.MX25 (Device Tree Support)")
4231
.init_early = imx25_init_early,
4332
.init_machine = imx25_dt_init,
4433
.init_late = imx25_pm_init,
45-
.init_irq = mx25_init_irq,
4634
.dt_compat = imx25_dt_board_compat,
4735
MACHINE_END

arch/arm/mach-imx/mach-imx27.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,6 @@ static void __init imx27_init_early(void)
5656
mxc_set_cpu_type(MXC_CPU_MX27);
5757
}
5858

59-
static void __init mx27_init_irq(void)
60-
{
61-
void __iomem *avic_base;
62-
struct device_node *np;
63-
64-
np = of_find_compatible_node(NULL, NULL, "fsl,avic");
65-
avic_base = of_iomap(np, 0);
66-
BUG_ON(!avic_base);
67-
mxc_init_irq(avic_base);
68-
}
69-
7059
static const char * const imx27_dt_board_compat[] __initconst = {
7160
"fsl,imx27",
7261
NULL
@@ -75,7 +64,6 @@ static const char * const imx27_dt_board_compat[] __initconst = {
7564
DT_MACHINE_START(IMX27_DT, "Freescale i.MX27 (Device Tree Support)")
7665
.map_io = mx27_map_io,
7766
.init_early = imx27_init_early,
78-
.init_irq = mx27_init_irq,
7967
.init_late = imx27_pm_init,
8068
.dt_compat = imx27_dt_board_compat,
8169
MACHINE_END

arch/arm/mach-imx/mach-imx31.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@ static const char * const imx31_dt_board_compat[] __initconst = {
1414
DT_MACHINE_START(IMX31_DT, "Freescale i.MX31 (Device Tree Support)")
1515
.map_io = mx31_map_io,
1616
.init_early = imx31_init_early,
17-
.init_irq = mx31_init_irq,
1817
.dt_compat = imx31_dt_board_compat,
1918
MACHINE_END

arch/arm/mach-imx/mach-imx35.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,5 @@ DT_MACHINE_START(IMX35_DT, "Freescale i.MX35 (Device Tree Support)")
2727
.l2c_aux_mask = ~0,
2828
.map_io = mx35_map_io,
2929
.init_early = imx35_init_early,
30-
.init_irq = mx35_init_irq,
3130
.dt_compat = imx35_dt_board_compat,
3231
MACHINE_END

arch/arm/mach-imx/mm-imx3.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,6 @@ void __init imx31_init_early(void)
109109
mx3_ccm_base = of_iomap(np, 0);
110110
BUG_ON(!mx3_ccm_base);
111111
}
112-
113-
void __init mx31_init_irq(void)
114-
{
115-
void __iomem *avic_base;
116-
struct device_node *np;
117-
118-
np = of_find_compatible_node(NULL, NULL, "fsl,imx31-avic");
119-
avic_base = of_iomap(np, 0);
120-
BUG_ON(!avic_base);
121-
122-
mxc_init_irq(avic_base);
123-
}
124112
#endif /* ifdef CONFIG_SOC_IMX31 */
125113

126114
#ifdef CONFIG_SOC_IMX35
@@ -158,16 +146,4 @@ void __init imx35_init_early(void)
158146
mx3_ccm_base = of_iomap(np, 0);
159147
BUG_ON(!mx3_ccm_base);
160148
}
161-
162-
void __init mx35_init_irq(void)
163-
{
164-
void __iomem *avic_base;
165-
struct device_node *np;
166-
167-
np = of_find_compatible_node(NULL, NULL, "fsl,imx35-avic");
168-
avic_base = of_iomap(np, 0);
169-
BUG_ON(!avic_base);
170-
171-
mxc_init_irq(avic_base);
172-
}
173149
#endif /* ifdef CONFIG_SOC_IMX35 */

0 commit comments

Comments
 (0)