diff options
author | Will Deacon <will.deacon@arm.com> | 2012-04-05 14:42:10 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-04-10 04:27:42 -0400 |
commit | 34af657916332e89564566bc8d35e3e06cc0c236 (patch) | |
tree | bcde46e4d6cc24c84372342c507d9964e90dea8b /arch/arm/common/vic.c | |
parent | dff2aa7af8c96a11f75d858859f0e0c78b193d12 (diff) |
ARM: 7377/1: vic: re-read status register before dispatching each IRQ handler
handle_IRQ may briefly cause interrupts to be re-enabled during soft IRQ
processing on the exit path, leading to nested handling of VIC interrupts.
Since the current code does not re-read the VIC_IRQ_STATUS register, this
can lead to multiple invocations of the same interrupt handler and
spurious interrupts to be reported.
This patch changes the VIC interrupt dispatching code to re-read the
status register each time, avoiding duplicate invocations of the same
handler.
Acked-and-Tested-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/common/vic.c')
-rw-r--r-- | arch/arm/common/vic.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c index 7a66311f3066..7e288f96cedf 100644 --- a/arch/arm/common/vic.c +++ b/arch/arm/common/vic.c | |||
@@ -427,19 +427,18 @@ int __init vic_of_init(struct device_node *node, struct device_node *parent) | |||
427 | 427 | ||
428 | /* | 428 | /* |
429 | * Handle each interrupt in a single VIC. Returns non-zero if we've | 429 | * Handle each interrupt in a single VIC. Returns non-zero if we've |
430 | * handled at least one interrupt. This does a single read of the | 430 | * handled at least one interrupt. This reads the status register |
431 | * status register and handles all interrupts in order from LSB first. | 431 | * before handling each interrupt, which is necessary given that |
432 | * handle_IRQ may briefly re-enable interrupts for soft IRQ handling. | ||
432 | */ | 433 | */ |
433 | static int handle_one_vic(struct vic_device *vic, struct pt_regs *regs) | 434 | static int handle_one_vic(struct vic_device *vic, struct pt_regs *regs) |
434 | { | 435 | { |
435 | u32 stat, irq; | 436 | u32 stat, irq; |
436 | int handled = 0; | 437 | int handled = 0; |
437 | 438 | ||
438 | stat = readl_relaxed(vic->base + VIC_IRQ_STATUS); | 439 | while ((stat = readl_relaxed(vic->base + VIC_IRQ_STATUS))) { |
439 | while (stat) { | ||
440 | irq = ffs(stat) - 1; | 440 | irq = ffs(stat) - 1; |
441 | handle_IRQ(irq_find_mapping(vic->domain, irq), regs); | 441 | handle_IRQ(irq_find_mapping(vic->domain, irq), regs); |
442 | stat &= ~(1 << irq); | ||
443 | handled = 1; | 442 | handled = 1; |
444 | } | 443 | } |
445 | 444 | ||