linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* irq-sifive-plic + gpio-sifive break IRQF_ONESHOT
@ 2019-06-20 10:24 Charles Papon
  0 siblings, 0 replies; only message in thread
From: Charles Papon @ 2019-06-20 10:24 UTC (permalink / raw)
  To: linux-riscv

Hi,

Was using a chip driver (W5500) which use a threaded irq with the
IRQF_TRIGGER_LOW | IRQF_ONESHOT flags and i got some issues.

The interrupt should have been masked to wait the W5500 irq handler to
be executed, but that wasn't the case.

As far my understanding go, the plic driver should use
handle_level_irq instead of handle_simple_irq, as interrupts connected
on it could be level triggerd.

Also, the plic irq_mask/irq_unmask should be implemented for two reasons :
- If they are null, it make crash chained_irq_enter calls from let's
say connected gpio drivers durring IRQ handeling
- the irq_unmask is very much required to handle threaded IRQF_ONESHOT IRQ

So maybe the plic claim release (writel(hwirq, claim);) should be
moved into its irq_unmask, and the irq_mask should be implemented as a
dummy function.


The same kind of issue appeared witht eh gpio-sifive driver, the
driver is using  handle_level_irq instead of handle_simple_irq and do
not implement the unmask, which break the IRQF_ONESHOT handeling.

Do you agree ? I'm not experienced in linux dev.
Thanks

Charles

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-06-20 10:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-20 10:24 irq-sifive-plic + gpio-sifive break IRQF_ONESHOT Charles Papon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).