lkml.org 
[lkml]   [2022]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] genirq: Provide generic_handle_domain_irq_safe().
On 2022-05-16 12:18:14 [+0200], Lukas Wunner wrote:
> On Mon, May 09, 2022 at 04:04:08PM +0200, Sebastian Andrzej Siewior wrote:
> > The problem with generic_handle_domain_irq() is that with `threadirqs'
> > it will trigger "WARN_ON_ONCE(!in_hardirq())".
>
> Now silenced by:
> https://git.kernel.org/linus/792ea6a074ae
>
>
> > +int generic_handle_domain_irq_safe(struct irq_domain *domain, unsigned int hwirq)
> > +{
> > + unsigned long flags;
> > + int ret;
> > +
> > + local_irq_save(flags);
> > + ret = handle_irq_desc(irq_resolve_mapping(domain, hwirq));
> > + local_irq_restore(flags);
> > + return ret;
> > +}
> > +EXPORT_SYMBOL_GPL(generic_handle_domain_irq_safe);
>
> AFAICS you don't need to disable hardirqs at least for the "threadirqs"
> case because irq_forced_thread_fn() already does that.

PREEMPT_RT does not disable interrupts. Also completions in softirq
won't disable interrupts.

>
> > drivers/bcma/driver_gpio.c | 2 +-
> > drivers/gpio/gpio-mlxbf2.c | 6 ++----
> > drivers/pinctrl/pinctrl-amd.c | 2 +-
> > drivers/platform/x86/intel/int0002_vgpio.c | 3 +--
> > drivers/ssb/driver_gpio.c | 6 ++++--
>
> From a quick look, the proper solution for all of those drivers is
> probably to just add IRQF_NO_THREAD and be done with it.

I think I mentioned that part in the commit description: IRQF_NO_THREAD
must be specified by all handlers of a shared interrupt. It is an option
for the handler that owns an interrupt exclusive.

> Thanks,
>
> Lukas

Sebastian

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