2022-11-27 00:24:44

by Samuel Holland

[permalink] [raw]
Subject: [PATCH 0/3] genirq: oneshot-safe threaded EOIs

This is the optimization that I promised back in
https://lore.kernel.org/lkml/[email protected]/
and got back around to cleaning up. To quote that cover letter:

"A further optimization is to take advantage of the fact that multiple
IRQs can be claimed at once. This allows removing the mask operations
for oneshot IRQs -- i.e. the combination of IRQCHIP_ONESHOT_SAFE and
IRQCHIP_EOI_THREADED, which is not currently supported."

Or in other words, we reuse the oneshot infrastructure for EOIs instead
of masking.

There a a few functions/variables that probably should be renamed now
that I have muddied what "oneshot" means. I elected not to do that in
this version to avoid distracting from the functional changes.


Samuel Holland (3):
genirq: Simplify cond_unmask_eoi_irq()
genirq: Add support for oneshot-safe threaded EOIs
irqchip/sifive-plic: Enable oneshot-safe threaded EOIs

drivers/irqchip/irq-sifive-plic.c | 2 ++
kernel/irq/chip.c | 21 ++++++++++++---------
kernel/irq/manage.c | 15 ++++++++++-----
3 files changed, 24 insertions(+), 14 deletions(-)

--
2.37.4


2022-11-27 00:51:57

by Samuel Holland

[permalink] [raw]
Subject: [PATCH 3/3] irqchip/sifive-plic: Enable oneshot-safe threaded EOIs

This defers the EOI until the IRQ thread has finished, avoiding the need
to mask the IRQ while the thread is pending.

Signed-off-by: Samuel Holland <[email protected]>
---

drivers/irqchip/irq-sifive-plic.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c
index ff47bd0dec45..d8fc3354b38c 100644
--- a/drivers/irqchip/irq-sifive-plic.c
+++ b/drivers/irqchip/irq-sifive-plic.c
@@ -203,6 +203,8 @@ static struct irq_chip plic_chip = {
#endif
.irq_set_type = plic_irq_set_type,
.flags = IRQCHIP_SKIP_SET_WAKE |
+ IRQCHIP_ONESHOT_SAFE |
+ IRQCHIP_EOI_THREADED |
IRQCHIP_AFFINITY_PRE_STARTUP,
};

--
2.37.4