lkml.org 
[lkml]   [2022]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] genirq: Deduplicate WARN_ON_ONCE() in generic_handle_domain_irq()
On 2022-05-10 09:56:05 [+0200], Lukas Wunner wrote:
> An example for irqchips where the warning is false positive are
> USB-attached GPIO controllers such as drivers/gpio/gpio-dln2.c:

They are not false positives because…

> USB gadgets are incapable of directly signaling an interrupt because
> they cannot initiate a bus transaction by themselves. All communication
> on the bus is initiated by the host controller, which polls a gadget's
> Interrupt Endpoint in regular intervals. If an interrupt is pending,
> that information is passed up the stack in softirq context, from which
> a hardirq is synthesized via generic_handle_domain_irq().

they tell you that the context is wrong. From looking at gpio-dln2
this is called from USB URB's callback which is softirq. In the end
dln2_gpio_event() is invoked while dln2_dev::event_cb_lock is acquired.
That lock is acquired by disabling interrupts which is what gets the
locking right for generic_handle_domain_irq(). If that lock lifted to
spin_lock_bh() (because it is always in urb's calback context and all
HCDs complete in one context unlike now) then this breaks. And
PREEMPT_RT is broken already. Therefore, last week, I've been promoting
generic_handle_domain_irq_safe()
https://lkml.kernel.org/r/YnkfWFzvusFFktSt@linutronix.de

and sadly I missed dln2. Please let me know if you have more users
similar to dln2. I will add those to my list once upstream buys that
interface.

Sebastian

\
 
 \ /
  Last update: 2022-05-16 08:30    [W:0.933 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site