* [PATCH] irqchip/versatile-fpga: Apply clear-mask earlier
@ 2020-03-21 13:38 Sungbo Eo
2020-03-21 14:05 ` Marc Zyngier
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Sungbo Eo @ 2020-03-21 13:38 UTC (permalink / raw)
To: linux-oxnas, Linus Walleij, Thomas Gleixner, Jason Cooper,
Marc Zyngier, linux-arm-kernel, linux-kernel
Cc: Sungbo Eo, Neil Armstrong, Daniel Golle
Clear its own IRQs before the parent IRQ get enabled, so that the
remaining IRQs do not accidentally interrupt the parent IRQ controller.
This patch also fixes a reboot bug on OX820 SoC, where the remaining
rps-timer IRQ raises a GIC interrupt that is left pending. After that,
the rps-timer IRQ is cleared during driver initialization, and there's
no IRQ left in rps-irq when local_irq_enable() is called, which evokes
an error message "unexpected IRQ trap".
Fixes: bdd272cbb97a ("irqchip: versatile FPGA: support cascaded interrupts from DT")
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Daniel Golle <daniel@makrotopia.org>
---
drivers/irqchip/irq-versatile-fpga.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/irqchip/irq-versatile-fpga.c b/drivers/irqchip/irq-versatile-fpga.c
index 70e2cfff8175..f1386733d3bc 100644
--- a/drivers/irqchip/irq-versatile-fpga.c
+++ b/drivers/irqchip/irq-versatile-fpga.c
@@ -212,6 +212,9 @@ int __init fpga_irq_of_init(struct device_node *node,
if (of_property_read_u32(node, "valid-mask", &valid_mask))
valid_mask = 0;
+ writel(clear_mask, base + IRQ_ENABLE_CLEAR);
+ writel(clear_mask, base + FIQ_ENABLE_CLEAR);
+
/* Some chips are cascaded from a parent IRQ */
parent_irq = irq_of_parse_and_map(node, 0);
if (!parent_irq) {
@@ -221,9 +224,6 @@ int __init fpga_irq_of_init(struct device_node *node,
fpga_irq_init(base, node->name, 0, parent_irq, valid_mask, node);
- writel(clear_mask, base + IRQ_ENABLE_CLEAR);
- writel(clear_mask, base + FIQ_ENABLE_CLEAR);
-
/*
* On Versatile AB/PB, some secondary interrupts have a direct
* pass-thru to the primary controller for IRQs 20 and 22-31 which need
--
2.25.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] irqchip/versatile-fpga: Apply clear-mask earlier
2020-03-21 13:38 [PATCH] irqchip/versatile-fpga: Apply clear-mask earlier Sungbo Eo
@ 2020-03-21 14:05 ` Marc Zyngier
2020-03-22 11:45 ` Linus Walleij
2020-03-29 20:26 ` [tip: irq/core] " tip-bot2 for Sungbo Eo
2 siblings, 0 replies; 5+ messages in thread
From: Marc Zyngier @ 2020-03-21 14:05 UTC (permalink / raw)
To: Sungbo Eo
Cc: linux-oxnas, Linus Walleij, Thomas Gleixner, Jason Cooper,
linux-arm-kernel, linux-kernel, Neil Armstrong, Daniel Golle
On 2020-03-21 13:38, Sungbo Eo wrote:
> Clear its own IRQs before the parent IRQ get enabled, so that the
> remaining IRQs do not accidentally interrupt the parent IRQ controller.
>
> This patch also fixes a reboot bug on OX820 SoC, where the remaining
> rps-timer IRQ raises a GIC interrupt that is left pending. After that,
> the rps-timer IRQ is cleared during driver initialization, and there's
> no IRQ left in rps-irq when local_irq_enable() is called, which evokes
> an error message "unexpected IRQ trap".
>
> Fixes: bdd272cbb97a ("irqchip: versatile FPGA: support cascaded
> interrupts from DT")
> Signed-off-by: Sungbo Eo <mans0n@gorani.run>
> Cc: Neil Armstrong <narmstrong@baylibre.com>
> Cc: Daniel Golle <daniel@makrotopia.org>
> ---
> drivers/irqchip/irq-versatile-fpga.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/irqchip/irq-versatile-fpga.c
> b/drivers/irqchip/irq-versatile-fpga.c
> index 70e2cfff8175..f1386733d3bc 100644
> --- a/drivers/irqchip/irq-versatile-fpga.c
> +++ b/drivers/irqchip/irq-versatile-fpga.c
> @@ -212,6 +212,9 @@ int __init fpga_irq_of_init(struct device_node
> *node,
> if (of_property_read_u32(node, "valid-mask", &valid_mask))
> valid_mask = 0;
>
> + writel(clear_mask, base + IRQ_ENABLE_CLEAR);
> + writel(clear_mask, base + FIQ_ENABLE_CLEAR);
> +
> /* Some chips are cascaded from a parent IRQ */
> parent_irq = irq_of_parse_and_map(node, 0);
> if (!parent_irq) {
> @@ -221,9 +224,6 @@ int __init fpga_irq_of_init(struct device_node
> *node,
>
> fpga_irq_init(base, node->name, 0, parent_irq, valid_mask, node);
>
> - writel(clear_mask, base + IRQ_ENABLE_CLEAR);
> - writel(clear_mask, base + FIQ_ENABLE_CLEAR);
> -
> /*
> * On Versatile AB/PB, some secondary interrupts have a direct
> * pass-thru to the primary controller for IRQs 20 and 22-31 which
> need
You're on a roll! ;-) Queued for 5.7.
Thanks,
M.
--
Jazz is not dead. It just smells funny...
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] irqchip/versatile-fpga: Apply clear-mask earlier
2020-03-21 13:38 [PATCH] irqchip/versatile-fpga: Apply clear-mask earlier Sungbo Eo
2020-03-21 14:05 ` Marc Zyngier
@ 2020-03-22 11:45 ` Linus Walleij
2020-03-22 11:51 ` Marc Zyngier
2020-03-29 20:26 ` [tip: irq/core] " tip-bot2 for Sungbo Eo
2 siblings, 1 reply; 5+ messages in thread
From: Linus Walleij @ 2020-03-22 11:45 UTC (permalink / raw)
To: Sungbo Eo
Cc: linux-oxnas, Thomas Gleixner, Jason Cooper, Marc Zyngier,
Linux ARM, linux-kernel@vger.kernel.org, Neil Armstrong,
Daniel Golle
On Sat, Mar 21, 2020 at 2:40 PM Sungbo Eo <mans0n@gorani.run> wrote:
> Clear its own IRQs before the parent IRQ get enabled, so that the
> remaining IRQs do not accidentally interrupt the parent IRQ controller.
>
> This patch also fixes a reboot bug on OX820 SoC, where the remaining
> rps-timer IRQ raises a GIC interrupt that is left pending. After that,
> the rps-timer IRQ is cleared during driver initialization, and there's
> no IRQ left in rps-irq when local_irq_enable() is called, which evokes
> an error message "unexpected IRQ trap".
>
> Fixes: bdd272cbb97a ("irqchip: versatile FPGA: support cascaded interrupts from DT")
> Signed-off-by: Sungbo Eo <mans0n@gorani.run>
> Cc: Neil Armstrong <narmstrong@baylibre.com>
> Cc: Daniel Golle <daniel@makrotopia.org>
Good catch!
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Marc: Cc stable?
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] irqchip/versatile-fpga: Apply clear-mask earlier
2020-03-22 11:45 ` Linus Walleij
@ 2020-03-22 11:51 ` Marc Zyngier
0 siblings, 0 replies; 5+ messages in thread
From: Marc Zyngier @ 2020-03-22 11:51 UTC (permalink / raw)
To: Linus Walleij
Cc: Sungbo Eo, linux-oxnas, Thomas Gleixner, Jason Cooper, Linux ARM,
linux-kernel, Neil Armstrong, Daniel Golle
On 2020-03-22 11:45, Linus Walleij wrote:
> On Sat, Mar 21, 2020 at 2:40 PM Sungbo Eo <mans0n@gorani.run> wrote:
>
>> Clear its own IRQs before the parent IRQ get enabled, so that the
>> remaining IRQs do not accidentally interrupt the parent IRQ
>> controller.
>>
>> This patch also fixes a reboot bug on OX820 SoC, where the remaining
>> rps-timer IRQ raises a GIC interrupt that is left pending. After that,
>> the rps-timer IRQ is cleared during driver initialization, and there's
>> no IRQ left in rps-irq when local_irq_enable() is called, which evokes
>> an error message "unexpected IRQ trap".
>>
>> Fixes: bdd272cbb97a ("irqchip: versatile FPGA: support cascaded
>> interrupts from DT")
>> Signed-off-by: Sungbo Eo <mans0n@gorani.run>
>> Cc: Neil Armstrong <narmstrong@baylibre.com>
>> Cc: Daniel Golle <daniel@makrotopia.org>
>
> Good catch!
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>
> Marc: Cc stable?
Sure, I'll add that.
Thanks,
M.
--
Jazz is not dead. It just smells funny...
^ permalink raw reply [flat|nested] 5+ messages in thread
* [tip: irq/core] irqchip/versatile-fpga: Apply clear-mask earlier
2020-03-21 13:38 [PATCH] irqchip/versatile-fpga: Apply clear-mask earlier Sungbo Eo
2020-03-21 14:05 ` Marc Zyngier
2020-03-22 11:45 ` Linus Walleij
@ 2020-03-29 20:26 ` tip-bot2 for Sungbo Eo
2 siblings, 0 replies; 5+ messages in thread
From: tip-bot2 for Sungbo Eo @ 2020-03-29 20:26 UTC (permalink / raw)
To: linux-tip-commits
Cc: Sungbo Eo, Marc Zyngier, Linus Walleij, stable, x86, LKML
The following commit has been merged into the irq/core branch of tip:
Commit-ID: 6a214a28132f19ace3d835a6d8f6422ec80ad200
Gitweb: https://git.kernel.org/tip/6a214a28132f19ace3d835a6d8f6422ec80ad200
Author: Sungbo Eo <mans0n@gorani.run>
AuthorDate: Sat, 21 Mar 2020 22:38:42 +09:00
Committer: Marc Zyngier <maz@kernel.org>
CommitterDate: Sun, 22 Mar 2020 11:52:16
irqchip/versatile-fpga: Apply clear-mask earlier
Clear its own IRQs before the parent IRQ get enabled, so that the
remaining IRQs do not accidentally interrupt the parent IRQ controller.
This patch also fixes a reboot bug on OX820 SoC, where the remaining
rps-timer IRQ raises a GIC interrupt that is left pending. After that,
the rps-timer IRQ is cleared during driver initialization, and there's
no IRQ left in rps-irq when local_irq_enable() is called, which evokes
an error message "unexpected IRQ trap".
Fixes: bdd272cbb97a ("irqchip: versatile FPGA: support cascaded interrupts from DT")
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200321133842.2408823-1-mans0n@gorani.run
---
drivers/irqchip/irq-versatile-fpga.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/irqchip/irq-versatile-fpga.c b/drivers/irqchip/irq-versatile-fpga.c
index 70e2cff..f138673 100644
--- a/drivers/irqchip/irq-versatile-fpga.c
+++ b/drivers/irqchip/irq-versatile-fpga.c
@@ -212,6 +212,9 @@ int __init fpga_irq_of_init(struct device_node *node,
if (of_property_read_u32(node, "valid-mask", &valid_mask))
valid_mask = 0;
+ writel(clear_mask, base + IRQ_ENABLE_CLEAR);
+ writel(clear_mask, base + FIQ_ENABLE_CLEAR);
+
/* Some chips are cascaded from a parent IRQ */
parent_irq = irq_of_parse_and_map(node, 0);
if (!parent_irq) {
@@ -221,9 +224,6 @@ int __init fpga_irq_of_init(struct device_node *node,
fpga_irq_init(base, node->name, 0, parent_irq, valid_mask, node);
- writel(clear_mask, base + IRQ_ENABLE_CLEAR);
- writel(clear_mask, base + FIQ_ENABLE_CLEAR);
-
/*
* On Versatile AB/PB, some secondary interrupts have a direct
* pass-thru to the primary controller for IRQs 20 and 22-31 which need
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-03-29 20:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-21 13:38 [PATCH] irqchip/versatile-fpga: Apply clear-mask earlier Sungbo Eo
2020-03-21 14:05 ` Marc Zyngier
2020-03-22 11:45 ` Linus Walleij
2020-03-22 11:51 ` Marc Zyngier
2020-03-29 20:26 ` [tip: irq/core] " tip-bot2 for Sungbo Eo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox