irqchip: Skip contexts other supervisor in plic_init()
Subsystems (3)
PATCH 1/1 irqchip: Skip contexts other supervisor in plic_init()
From: Alan Mikhak <[email protected]>
Modify plic_init() to skip .dts interrupt contexts other than supervisor external interrupt.
--- drivers/irqchip/irq-sifive-plic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/irqchip/irq-sifive-plic.c +2 -2
@@ -251,8 +251,8 @@ static int __init plic_init(struct device_node *node,continue ; } -/* skip context holes */ -if (parent.args[0 ] ==-1 ) +/* skip contexts other than supervisor external interrupt */ +if (parent.args[0 ] !=IRQ_S_EXT )continue ; hartid =plic_find_hart_id (parent.np);
Signature · 1 line
2.7.4
+ hch
Quoted 4 lines · Alan Mikhak
From: Alan Mikhak <[email protected]>
Modify
plic_init()to skip .dts interrupt contexts other than supervisor external interrupt.
Might be good to explain the motivation here.
Quoted 11 lines
Signed-off-by Alan Mikhak <[email protected]>--- drivers/irqchip/irq-sifive-plic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/irqchip/irq-sifive-plic.c +0
-0
drivers/irqchip/irq-sifive-plic.c static int __init plic_init(struct device_node *node, · line 256
Quoted 8 lines
drivers/irqchip/irq-sifive-plic.c +2
-2@@ -251,8 +251,8 @@ static int __init plic_init(struct device_node *node,continue ; } -/* skip context holes */ -if (parent.args[0 ] ==-1 ) +/* skip contexts other than supervisor external interrupt */ +if (parent.args[0 ] !=IRQ_S_EXT )continue ;
Will this need to change for RISC-V M-mode Linux support?
https://lore.kernel.org/linux-riscv/[email protected]/
- Paul
Quoted 11 lines · Paul Walmsley
+ hch
Quoted 4 lines · Alan Mikhak
From: Alan Mikhak <[email protected]>
Modify
plic_init()to skip .dts interrupt contexts other than supervisor external interrupt.Might be good to explain the motivation here.
The .dts entry for plic may specify multiple interrupt contexts. For example, it may assign two entries IRQ_M_EXT and IRQ_S_EXT, in that order, to the same interrupt controller. This patch modifies plic_init() to skip the IRQ_M_EXT context since IRQ_S_EXT is currently the only supported context.
If IRQ_M_EXT is not skipped, plic_init() will report "handler already present for context" when it comes across the IRQ_S_EXT context in the next iteration of its loop.
Without this patch, .dts would have to be edited to replace the value of IRQ_M_EXT with -1 for it to be skipped.
I will add the above explanation in a v2 patch description, if it sounds reasonable.
Quoted 29 lines
Quoted 12 lines
Signed-off-by Alan Mikhak <[email protected]>--- drivers/irqchip/irq-sifive-plic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/irqchip/irq-sifive-plic.c +0
-0drivers/irqchip/irq-sifive-plic.c static int __init plic_init(struct device_node *node, · line 256
Quoted 8 lines
drivers/irqchip/irq-sifive-plic.c +2
-2@@ -251,8 +251,8 @@ static int __init plic_init(struct device_node *node,continue ; } -/* skip context holes */ -if (parent.args[0 ] ==-1 ) +/* skip contexts other than supervisor external interrupt */ +if (parent.args[0 ] !=IRQ_S_EXT )continue ;Will this need to change for RISC-V M-mode Linux support?
https://lore.kernel.org/linux-riscv/[email protected]/
- Paul
Paul Walmsley
Acked-byQuoted 18 lines · Alan Mikhak
Quoted 6 lines · Paul Walmsley
Quoted 2 lines · Alan Mikhak
Modify
plic_init()to skip .dts interrupt contexts other than supervisor external interrupt.Might be good to explain the motivation here.
The .dts entry for plic may specify multiple interrupt contexts. For example, it may assign two entries
IRQ_M_EXTandIRQ_S_EXT, in that order, to the same interrupt controller. This patch modifiesplic_init()to skip theIRQ_M_EXTcontext sinceIRQ_S_EXTis currently the only supported context.If
IRQ_M_EXTis not skipped,plic_init()will report "handler already present for context" when it comes across theIRQ_S_EXTcontext in the next iteration of its loop.
Quoted 5 lines
Without this patch, .dts would have to be edited to replace the value of
IRQ_M_EXTwith -1 for it to be skipped.I will add the above explanation in a v2 patch description, if it sounds reasonable.
Thanks, that explanation sounds good; and sounds like Christoph will flow with this change as well. So with the description expanded as you plan to, feel free to add an
- Paul
Quoted 33 lines · Paul Walmsley
+ hch
Quoted 4 lines · Alan Mikhak
From: Alan Mikhak <[email protected]>
Modify
plic_init()to skip .dts interrupt contexts other than supervisor external interrupt.Might be good to explain the motivation here.
Quoted 11 lines
Signed-off-by Alan Mikhak <[email protected]>--- drivers/irqchip/irq-sifive-plic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/irqchip/irq-sifive-plic.c +0
-0drivers/irqchip/irq-sifive-plic.c static int __init plic_init(struct device_node *node, · line 256
Quoted 8 lines
drivers/irqchip/irq-sifive-plic.c +2
-2@@ -251,8 +251,8 @@ static int __init plic_init(struct device_node *node,continue ; } -/* skip context holes */ -if (parent.args[0 ] ==-1 ) +/* skip contexts other than supervisor external interrupt */ +if (parent.args[0 ] !=IRQ_S_EXT )continue ;Will this need to change for RISC-V M-mode Linux support?
Yes.
Quoted 3 lines
- Paul
Quoted 9 lines · Palmer Dabbelt
Quoted 7 lines
drivers/irqchip/irq-sifive-plic.c static int __init plic_init(struct device_node *node, · line 256
Quoted 3 lines
drivers/irqchip/irq-sifive-plic.c +2
-0+/* skip contexts other than supervisor external interrupt */ +if (parent.args[0 ] !=IRQ_S_EXT )continue ;Will this need to change for RISC-V M-mode Linux support?
Yes.
For M-mode we'll want to check IRQ_M_EXT above. So we should just merge this patch ASAP and then for my rebased M-mode series I'll fix the check to do that for the M-Mode case, which is much cleaner than my hack.
Quoted 7 lines · On Wed, 23 Oct 2019 18:30:19 -0700 Christoph Hellwig <[email protected]> wrote:
Quoted 6 lines · Palmer Dabbelt
Quoted 6 lines
drivers/irqchip/irq-sifive-plic.c static int __init plic_init(struct device_node *node, · line 256
Quoted 3 lines
drivers/irqchip/irq-sifive-plic.c +2
-0+/* skip contexts other than supervisor external interrupt */ +if (parent.args[0 ] !=IRQ_S_EXT )continue ;Will this need to change for RISC-V M-mode Linux support?
Quoted 8 lines
Quoted 3 lines
Yes.
For M-mode we'll want to check
IRQ_M_EXTabove. So we should just merge this patch ASAP and then for my rebased M-mode series I'll fix the check to do that for the M-Mode case, which is much cleaner than my hack.
Does this need to be taken as a fix, potentially Cc to stable? Or is that 5.5 material?
M.
Signature · 1 line
Jazz is not dead. It just smells funny...
Christoph Hellwig
Reviewed-byQuoted 6 lines · Marc Zyngier
Quoted 6 lines
Quoted 5 lines
Quoted 3 lines
Will this need to change for RISC-V M-mode Linux support?
Yes.
Quoted 7 lines
Quoted 4 lines
For M-mode we'll want to check
IRQ_M_EXTabove. So we should just merge this patch ASAP and then for my rebased M-mode series I'll fix the check to do that for the M-Mode case, which is much cleaner than my hack.Does this need to be taken as a fix, potentially Cc to stable? Or is that 5.5 material?
So I though that the S-mode context were kinda aways to be sorted before M-mode, but I can't find anything guranteeing it. So I think this actually is a fix, and getting this queued up in the next -rc would really help me with the nommu stuff - otherwise we'd need to take it through the riscv tree for 5.5 to avoid conflicts.
Btw, here is my:
for the patch.
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Quoted 23 lines · Christoph Hellwig
Quoted 7 lines · Marc Zyngier
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Will this need to change for RISC-V M-mode Linux support?
https://lore.kernel.org/linux-riscv/[email protected]/
Quoted 3 lines
Quoted 2 lines
Yes.
Quoted 8 lines
Quoted 3 lines
For M-mode we'll want to check
IRQ_M_EXTabove. So we should just merge this patch ASAP and then for my rebased M-mode series I'll fix the check to do that for the M-Mode case, which is muchcleaner
Quoted 1 line
than my hack.
Does this need to be taken as a fix, potentially Cc to stable? Or is that 5.5 material?
So I though that the S-mode context were kinda aways to be sorted before M-mode, but I can't find anything guranteeing it. So I think this actually is a fix, and getting this queued up in the next -rc would really help me with the nommu stuff - otherwise we'd need to take it through the riscv tree for 5.5 to avoid conflicts.
Quoted 5 lines
Btw, here is my:
Reviewed-by Christoph Hellwig <[email protected]>for the patch.
Thanks for that.
Alan, if you can respin this patch with an updated commit message, I'll queue it with a couple of other nits I have lying around, and send it to Thomas by the end of the week.
M.
Signature · 1 line
Jazz is not dead. It just smells funny...