Skip to content

Commit

Permalink
ARM: remove mach .handle_irq for VIC users
Browse files Browse the repository at this point in the history
Now that the VIC initialization sets up the handle_arch_irq pointer, we
can remove it for all machines and make it static. Move vic_handle_irq
to avoid a forward declaration.

Signed-off-by: Rob Herring <[email protected]>
Cc: Ryan Mallon <[email protected]>
Cc: Russell King <[email protected]>
Cc: Hubert Feurstein <[email protected]>
Cc: Alessandro Rubini <[email protected]>
Cc: STEricsson <[email protected]>
Cc: Ben Dooks <[email protected]>
Cc: Kyungmin Park <[email protected]>
Cc: Shiraz Hashim <[email protected]>
Cc: Rajeev Kumar <[email protected]>
Acked-by: H Hartley Sweeten <[email protected]>
Acked-by: Jamie Iles <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Acked-by: Mark Brown <[email protected]>
Acked-by: Viresh Kumar <[email protected]>
Acked-by: Kukjin Kim <[email protected]>
Acked-by: Olof Johansson <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
  • Loading branch information
Rob Herring committed Jan 12, 2013
1 parent 7fb7d8a commit a036802
Show file tree
Hide file tree
Showing 41 changed files with 36 additions and 87 deletions.
70 changes: 36 additions & 34 deletions arch/arm/common/vic.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ static struct vic_device vic_devices[CONFIG_ARM_VIC_NR];

static int vic_id;

static void vic_handle_irq(struct pt_regs *regs);

/**
* vic_init2 - common initialisation code
* @base: Base of the VIC.
Expand Down Expand Up @@ -199,6 +201,40 @@ static int vic_irqdomain_map(struct irq_domain *d, unsigned int irq,
return 0;
}

/*
* Handle each interrupt in a single VIC. Returns non-zero if we've
* handled at least one interrupt. This reads the status register
* before handling each interrupt, which is necessary given that
* handle_IRQ may briefly re-enable interrupts for soft IRQ handling.
*/
static int handle_one_vic(struct vic_device *vic, struct pt_regs *regs)
{
u32 stat, irq;
int handled = 0;

while ((stat = readl_relaxed(vic->base + VIC_IRQ_STATUS))) {
irq = ffs(stat) - 1;
handle_IRQ(irq_find_mapping(vic->domain, irq), regs);
handled = 1;
}

return handled;
}

/*
* Keep iterating over all registered VIC's until there are no pending
* interrupts.
*/
static asmlinkage void __exception_irq_entry vic_handle_irq(struct pt_regs *regs)
{
int i, handled;

do {
for (i = 0, handled = 0; i < vic_id; ++i)
handled |= handle_one_vic(&vic_devices[i], regs);
} while (handled);
}

static struct irq_domain_ops vic_irqdomain_ops = {
.map = vic_irqdomain_map,
.xlate = irq_domain_xlate_onetwocell,
Expand Down Expand Up @@ -446,37 +482,3 @@ int __init vic_of_init(struct device_node *node, struct device_node *parent)
return 0;
}
#endif /* CONFIG OF */

/*
* Handle each interrupt in a single VIC. Returns non-zero if we've
* handled at least one interrupt. This reads the status register
* before handling each interrupt, which is necessary given that
* handle_IRQ may briefly re-enable interrupts for soft IRQ handling.
*/
static int handle_one_vic(struct vic_device *vic, struct pt_regs *regs)
{
u32 stat, irq;
int handled = 0;

while ((stat = readl_relaxed(vic->base + VIC_IRQ_STATUS))) {
irq = ffs(stat) - 1;
handle_IRQ(irq_find_mapping(vic->domain, irq), regs);
handled = 1;
}

return handled;
}

/*
* Keep iterating over all registered VIC's until there are no pending
* interrupts.
*/
asmlinkage void __exception_irq_entry vic_handle_irq(struct pt_regs *regs)
{
int i, handled;

do {
for (i = 0, handled = 0; i < vic_id; ++i)
handled |= handle_one_vic(&vic_devices[i], regs);
} while (handled);
}
1 change: 0 additions & 1 deletion arch/arm/include/asm/hardware/vic.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,5 @@ void __vic_init(void __iomem *base, int irq_start, u32 vic_sources,
u32 resume_sources, struct device_node *node);
void vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources, u32 resume_sources);
int vic_of_init(struct device_node *node, struct device_node *parent);
void vic_handle_irq(struct pt_regs *regs);

#endif
1 change: 0 additions & 1 deletion arch/arm/mach-ep93xx/adssphere.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ MACHINE_START(ADSSPHERE, "ADS Sphere board")
.atag_offset = 0x100,
.map_io = ep93xx_map_io,
.init_irq = ep93xx_init_irq,
.handle_irq = vic_handle_irq,
.timer = &ep93xx_timer,
.init_machine = adssphere_init_machine,
.init_late = ep93xx_init_late,
Expand Down
8 changes: 0 additions & 8 deletions arch/arm/mach-ep93xx/edb93xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ MACHINE_START(EDB9301, "Cirrus Logic EDB9301 Evaluation Board")
.atag_offset = 0x100,
.map_io = ep93xx_map_io,
.init_irq = ep93xx_init_irq,
.handle_irq = vic_handle_irq,
.timer = &ep93xx_timer,
.init_machine = edb93xx_init_machine,
.init_late = ep93xx_init_late,
Expand All @@ -290,7 +289,6 @@ MACHINE_START(EDB9302, "Cirrus Logic EDB9302 Evaluation Board")
.atag_offset = 0x100,
.map_io = ep93xx_map_io,
.init_irq = ep93xx_init_irq,
.handle_irq = vic_handle_irq,
.timer = &ep93xx_timer,
.init_machine = edb93xx_init_machine,
.init_late = ep93xx_init_late,
Expand All @@ -304,7 +302,6 @@ MACHINE_START(EDB9302A, "Cirrus Logic EDB9302A Evaluation Board")
.atag_offset = 0x100,
.map_io = ep93xx_map_io,
.init_irq = ep93xx_init_irq,
.handle_irq = vic_handle_irq,
.timer = &ep93xx_timer,
.init_machine = edb93xx_init_machine,
.init_late = ep93xx_init_late,
Expand All @@ -318,7 +315,6 @@ MACHINE_START(EDB9307, "Cirrus Logic EDB9307 Evaluation Board")
.atag_offset = 0x100,
.map_io = ep93xx_map_io,
.init_irq = ep93xx_init_irq,
.handle_irq = vic_handle_irq,
.timer = &ep93xx_timer,
.init_machine = edb93xx_init_machine,
.init_late = ep93xx_init_late,
Expand All @@ -332,7 +328,6 @@ MACHINE_START(EDB9307A, "Cirrus Logic EDB9307A Evaluation Board")
.atag_offset = 0x100,
.map_io = ep93xx_map_io,
.init_irq = ep93xx_init_irq,
.handle_irq = vic_handle_irq,
.timer = &ep93xx_timer,
.init_machine = edb93xx_init_machine,
.init_late = ep93xx_init_late,
Expand All @@ -346,7 +341,6 @@ MACHINE_START(EDB9312, "Cirrus Logic EDB9312 Evaluation Board")
.atag_offset = 0x100,
.map_io = ep93xx_map_io,
.init_irq = ep93xx_init_irq,
.handle_irq = vic_handle_irq,
.timer = &ep93xx_timer,
.init_machine = edb93xx_init_machine,
.init_late = ep93xx_init_late,
Expand All @@ -360,7 +354,6 @@ MACHINE_START(EDB9315, "Cirrus Logic EDB9315 Evaluation Board")
.atag_offset = 0x100,
.map_io = ep93xx_map_io,
.init_irq = ep93xx_init_irq,
.handle_irq = vic_handle_irq,
.timer = &ep93xx_timer,
.init_machine = edb93xx_init_machine,
.init_late = ep93xx_init_late,
Expand All @@ -374,7 +367,6 @@ MACHINE_START(EDB9315A, "Cirrus Logic EDB9315A Evaluation Board")
.atag_offset = 0x100,
.map_io = ep93xx_map_io,
.init_irq = ep93xx_init_irq,
.handle_irq = vic_handle_irq,
.timer = &ep93xx_timer,
.init_machine = edb93xx_init_machine,
.init_late = ep93xx_init_late,
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-ep93xx/gesbc9312.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ MACHINE_START(GESBC9312, "Glomation GESBC-9312-sx")
.atag_offset = 0x100,
.map_io = ep93xx_map_io,
.init_irq = ep93xx_init_irq,
.handle_irq = vic_handle_irq,
.timer = &ep93xx_timer,
.init_machine = gesbc9312_init_machine,
.init_late = ep93xx_init_late,
Expand Down
4 changes: 0 additions & 4 deletions arch/arm/mach-ep93xx/micro9.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ MACHINE_START(MICRO9, "Contec Micro9-High")
.atag_offset = 0x100,
.map_io = ep93xx_map_io,
.init_irq = ep93xx_init_irq,
.handle_irq = vic_handle_irq,
.timer = &ep93xx_timer,
.init_machine = micro9_init_machine,
.init_late = ep93xx_init_late,
Expand All @@ -96,7 +95,6 @@ MACHINE_START(MICRO9M, "Contec Micro9-Mid")
.atag_offset = 0x100,
.map_io = ep93xx_map_io,
.init_irq = ep93xx_init_irq,
.handle_irq = vic_handle_irq,
.timer = &ep93xx_timer,
.init_machine = micro9_init_machine,
.init_late = ep93xx_init_late,
Expand All @@ -110,7 +108,6 @@ MACHINE_START(MICRO9L, "Contec Micro9-Lite")
.atag_offset = 0x100,
.map_io = ep93xx_map_io,
.init_irq = ep93xx_init_irq,
.handle_irq = vic_handle_irq,
.timer = &ep93xx_timer,
.init_machine = micro9_init_machine,
.init_late = ep93xx_init_late,
Expand All @@ -124,7 +121,6 @@ MACHINE_START(MICRO9S, "Contec Micro9-Slim")
.atag_offset = 0x100,
.map_io = ep93xx_map_io,
.init_irq = ep93xx_init_irq,
.handle_irq = vic_handle_irq,
.timer = &ep93xx_timer,
.init_machine = micro9_init_machine,
.init_late = ep93xx_init_late,
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-ep93xx/simone.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ MACHINE_START(SIM_ONE, "Simplemachines Sim.One Board")
.atag_offset = 0x100,
.map_io = ep93xx_map_io,
.init_irq = ep93xx_init_irq,
.handle_irq = vic_handle_irq,
.timer = &ep93xx_timer,
.init_machine = simone_init_machine,
.init_late = ep93xx_init_late,
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-ep93xx/snappercl15.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ MACHINE_START(SNAPPER_CL15, "Bluewater Systems Snapper CL15")
.atag_offset = 0x100,
.map_io = ep93xx_map_io,
.init_irq = ep93xx_init_irq,
.handle_irq = vic_handle_irq,
.timer = &ep93xx_timer,
.init_machine = snappercl15_init_machine,
.init_late = ep93xx_init_late,
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-ep93xx/ts72xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")
.atag_offset = 0x100,
.map_io = ts72xx_map_io,
.init_irq = ep93xx_init_irq,
.handle_irq = vic_handle_irq,
.timer = &ep93xx_timer,
.init_machine = ts72xx_init_machine,
.init_late = ep93xx_init_late,
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-ep93xx/vision_ep9307.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@ MACHINE_START(VISION_EP9307, "Vision Engraving Systems EP9307")
.atag_offset = 0x100,
.map_io = vision_map_io,
.init_irq = ep93xx_init_irq,
.handle_irq = vic_handle_irq,
.timer = &ep93xx_timer,
.init_machine = vision_init_machine,
.init_late = ep93xx_init_late,
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-netx/nxdb500.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ MACHINE_START(NXDB500, "Hilscher nxdb500")
.atag_offset = 0x100,
.map_io = netx_map_io,
.init_irq = netx_init_irq,
.handle_irq = vic_handle_irq,
.timer = &netx_timer,
.init_machine = nxdb500_init,
.restart = netx_restart,
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-netx/nxdkn.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ MACHINE_START(NXDKN, "Hilscher nxdkn")
.atag_offset = 0x100,
.map_io = netx_map_io,
.init_irq = netx_init_irq,
.handle_irq = vic_handle_irq,
.timer = &netx_timer,
.init_machine = nxdkn_init,
.restart = netx_restart,
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-netx/nxeb500hmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ MACHINE_START(NXEB500HMI, "Hilscher nxeb500hmi")
.atag_offset = 0x100,
.map_io = netx_map_io,
.init_irq = netx_init_irq,
.handle_irq = vic_handle_irq,
.timer = &netx_timer,
.init_machine = nxeb500hmi_init,
.restart = netx_restart,
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-nomadik/board-nhk8815.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ MACHINE_START(NOMADIK, "NHK8815")
.atag_offset = 0x100,
.map_io = cpu8815_map_io,
.init_irq = cpu8815_init_irq,
.handle_irq = vic_handle_irq,
.timer = &nomadik_timer,
.init_machine = nhk8815_platform_init,
.restart = cpu8815_restart,
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-picoxcell/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ DT_MACHINE_START(PICOXCELL, "Picochip picoXcell")
.map_io = picoxcell_map_io,
.nr_irqs = NR_IRQS_LEGACY,
.init_irq = picoxcell_init_irq,
.handle_irq = vic_handle_irq,
.timer = &dw_apb_timer,
.init_machine = picoxcell_init_machine,
.dt_compat = picoxcell_dt_match,
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-s3c64xx/mach-anw6410.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ MACHINE_START(ANW6410, "A&W6410")
.atag_offset = 0x100,

.init_irq = s3c6410_init_irq,
.handle_irq = vic_handle_irq,
.map_io = anw6410_map_io,
.init_machine = anw6410_machine_init,
.init_late = s3c64xx_init_late,
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-s3c64xx/mach-crag6410.c
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,6 @@ MACHINE_START(WLF_CRAGG_6410, "Wolfson Cragganmore 6410")
/* Maintainer: Mark Brown <[email protected]> */
.atag_offset = 0x100,
.init_irq = s3c6410_init_irq,
.handle_irq = vic_handle_irq,
.map_io = crag6410_map_io,
.init_machine = crag6410_machine_init,
.init_late = s3c64xx_init_late,
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-s3c64xx/mach-hmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ MACHINE_START(HMT, "Airgoo-HMT")
/* Maintainer: Peter Korsgaard <[email protected]> */
.atag_offset = 0x100,
.init_irq = s3c6410_init_irq,
.handle_irq = vic_handle_irq,
.map_io = hmt_map_io,
.init_machine = hmt_machine_init,
.init_late = s3c64xx_init_late,
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-s3c64xx/mach-mini6410.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ MACHINE_START(MINI6410, "MINI6410")
/* Maintainer: Darius Augulis <[email protected]> */
.atag_offset = 0x100,
.init_irq = s3c6410_init_irq,
.handle_irq = vic_handle_irq,
.map_io = mini6410_map_io,
.init_machine = mini6410_machine_init,
.init_late = s3c64xx_init_late,
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-s3c64xx/mach-ncp.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ MACHINE_START(NCP, "NCP")
/* Maintainer: Samsung Electronics */
.atag_offset = 0x100,
.init_irq = s3c6410_init_irq,
.handle_irq = vic_handle_irq,
.map_io = ncp_map_io,
.init_machine = ncp_machine_init,
.init_late = s3c64xx_init_late,
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-s3c64xx/mach-real6410.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ MACHINE_START(REAL6410, "REAL6410")
.atag_offset = 0x100,

.init_irq = s3c6410_init_irq,
.handle_irq = vic_handle_irq,
.map_io = real6410_map_io,
.init_machine = real6410_machine_init,
.init_late = s3c64xx_init_late,
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-s3c64xx/mach-smartq5.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ MACHINE_START(SMARTQ5, "SmartQ 5")
/* Maintainer: Maurus Cuelenaere <mcuelenaere AT gmail DOT com> */
.atag_offset = 0x100,
.init_irq = s3c6410_init_irq,
.handle_irq = vic_handle_irq,
.map_io = smartq_map_io,
.init_machine = smartq5_machine_init,
.init_late = s3c64xx_init_late,
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-s3c64xx/mach-smartq7.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ MACHINE_START(SMARTQ7, "SmartQ 7")
/* Maintainer: Maurus Cuelenaere <mcuelenaere AT gmail DOT com> */
.atag_offset = 0x100,
.init_irq = s3c6410_init_irq,
.handle_irq = vic_handle_irq,
.map_io = smartq_map_io,
.init_machine = smartq7_machine_init,
.init_late = s3c64xx_init_late,
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-s3c64xx/mach-smdk6400.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ MACHINE_START(SMDK6400, "SMDK6400")
.atag_offset = 0x100,

.init_irq = s3c6400_init_irq,
.handle_irq = vic_handle_irq,
.map_io = smdk6400_map_io,
.init_machine = smdk6400_machine_init,
.init_late = s3c64xx_init_late,
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-s3c64xx/mach-smdk6410.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,6 @@ MACHINE_START(SMDK6410, "SMDK6410")
.atag_offset = 0x100,

.init_irq = s3c6410_init_irq,
.handle_irq = vic_handle_irq,
.map_io = smdk6410_map_io,
.init_machine = smdk6410_machine_init,
.init_late = s3c64xx_init_late,
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-s5p64x0/mach-smdk6440.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ MACHINE_START(SMDK6440, "SMDK6440")
.atag_offset = 0x100,

.init_irq = s5p6440_init_irq,
.handle_irq = vic_handle_irq,
.map_io = smdk6440_map_io,
.init_machine = smdk6440_machine_init,
.timer = &s5p_timer,
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-s5p64x0/mach-smdk6450.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ MACHINE_START(SMDK6450, "SMDK6450")
.atag_offset = 0x100,

.init_irq = s5p6450_init_irq,
.handle_irq = vic_handle_irq,
.map_io = smdk6450_map_io,
.init_machine = smdk6450_machine_init,
.timer = &s5p_timer,
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-s5pc100/mach-smdkc100.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ MACHINE_START(SMDKC100, "SMDKC100")
/* Maintainer: Byungho Min <[email protected]> */
.atag_offset = 0x100,
.init_irq = s5pc100_init_irq,
.handle_irq = vic_handle_irq,
.map_io = smdkc100_map_io,
.init_machine = smdkc100_machine_init,
.timer = &s3c24xx_timer,
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-s5pv210/mach-aquila.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,6 @@ MACHINE_START(AQUILA, "Aquila")
Kyungmin Park <[email protected]> */
.atag_offset = 0x100,
.init_irq = s5pv210_init_irq,
.handle_irq = vic_handle_irq,
.map_io = aquila_map_io,
.init_machine = aquila_machine_init,
.timer = &s5p_timer,
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-s5pv210/mach-goni.c
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,6 @@ MACHINE_START(GONI, "GONI")
/* Maintainers: Kyungmin Park <[email protected]> */
.atag_offset = 0x100,
.init_irq = s5pv210_init_irq,
.handle_irq = vic_handle_irq,
.map_io = goni_map_io,
.init_machine = goni_machine_init,
.timer = &s5p_timer,
Expand Down
Loading

0 comments on commit a036802

Please sign in to comment.