All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	x86@kernel.org, Marc Zyngier <marc.zyngier@arm.com>
Subject: Re: [patch V2 2/6] genirq: Fix misleading synchronize_irq() documentation
Date: Mon, 1 Jul 2019 20:23:11 +0200	[thread overview]
Message-ID: <20190701182311.GV3419@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <alpine.DEB.2.21.1907011959410.1802@nanos.tec.linutronix.de>

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@linutronix.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.

  reply	other threads:[~2019-07-01 18:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-28 11:11 [patch V2 0/6] x86/irq: Cure various interrupt issues Thomas Gleixner
2019-06-28 11:11 ` [patch V2 1/6] genirq: Delay deactivation in free_irq() Thomas Gleixner
2019-07-03  8:16   ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2019-06-28 11:11 ` [patch V2 2/6] genirq: Fix misleading synchronize_irq() documentation Thomas Gleixner
2019-07-01 14:53   ` Peter Zijlstra
2019-07-01 18:01     ` Thomas Gleixner
2019-07-01 18:23       ` Peter Zijlstra [this message]
2019-07-03  8:16   ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2019-06-28 11:11 ` [patch V2 3/6] genirq: Add optional hardware synchronization for shutdown Thomas Gleixner
2019-07-01  8:48   ` Marc Zyngier
2019-07-01 14:56   ` Peter Zijlstra
2019-07-01 18:02     ` Thomas Gleixner
2019-07-03  8:17   ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2019-06-28 11:11 ` [patch V2 4/6] x86/ioapic: Implement irq_get_irqchip_state() callback Thomas Gleixner
2019-07-03  8:18   ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2019-06-28 11:11 ` [patch V2 5/6] x86/irq: Handle spurious interrupt after shutdown gracefully Thomas Gleixner
2019-07-03  8:18   ` [tip:x86/apic] " tip-bot for Thomas Gleixner
2019-06-28 11:11 ` [patch V2 6/6] x86/irq: Seperate unused system vectors from spurious entry again Thomas Gleixner
2019-07-03  8:19   ` [tip:x86/apic] " tip-bot for Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190701182311.GV3419@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.