[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190701182311.GV3419@hirez.programming.kicks-ass.net>
Date: Mon, 1 Jul 2019 20:23:11 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>, x86@...nel.org,
Marc Zyngier <marc.zyngier@....com>
Subject: Re: [patch V2 2/6] genirq: Fix misleading synchronize_irq()
documentation
On Mon, Jul 01, 2019 at 08:01:24PM +0200, Thomas Gleixner wrote:
> On Mon, 1 Jul 2019, Peter Zijlstra wrote:
>
> > On Fri, Jun 28, 2019 at 01:11:50PM +0200, Thomas Gleixner wrote:
> > > The function might sleep, so it cannot be called from interrupt
> > > context. Not even with care.
> > >
> > > Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> > > ---
> > > kernel/irq/manage.c | 3 ++-
> > > 1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > --- a/kernel/irq/manage.c
> > > +++ b/kernel/irq/manage.c
> > > @@ -96,7 +96,8 @@ EXPORT_SYMBOL(synchronize_hardirq);
> > > * to complete before returning. If you use this function while
> > > * holding a resource the IRQ handler may need you will deadlock.
> > > *
> > > - * This function may be called - with care - from IRQ context.
> > > + * Can only be called from preemptible code as it might sleep when
> > > + * an interrupt thread is associated to @irq.
> > > */
> > > void synchronize_irq(unsigned int irq)
> > > {
> >
> > + might_sleep();
> >
> > ?
>
> ....
>
> wait_event()
> might_sleep() ...
>
That's conditional on desc, but sure, that should work in most sane
cases.
Powered by blists - more mailing lists