mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "Takashi Iwai" <tiwai@suse.de>,
	"Knut Petersen" <Knut_Petersen@t-online.de>,
	"Jaroslav Kysela" <perex@perex.cz>,
	"Chris Wilson" <chris@chris-wilson.co.uk>,
	jesse.barnes@intel.com, gregkh@suse.de,
	linux-kernel@vger.kernel.org,
	"David Müller" <d.mueller@elsoft.ch>
Subject: Re: [BUG][2.6.38] IRQ Lock Inversion / i915 fails
Date: Thu, 17 Mar 2011 16:05:26 -0400	[thread overview]
Message-ID: <20110317200526.GE14675@home.goodmis.org> (raw)
In-Reply-To: <AANLkTi=ZSS=gDtGOcKBdE0BfJLpu0Ye1UhuNcbkz70Vs@mail.gmail.com>

On Thu, Mar 17, 2011 at 10:33:04AM -0700, Linus Torvalds wrote:
> On Thu, Mar 17, 2011 at 10:15 AM, Takashi Iwai <tiwai@suse.de> wrote:
> >
> > The trigger callback should be called always in irq-disabled context,
> > so this should be OK.
> 
> Oh, ok. I missed the snd_pcm_action_lock_irq() thing disabling
> interrupts in that call sequence..
> 
> > But loopback_pos_update() is called in the
> > timer callback, and this can be the issue.
> 
> Hmm. If the timer callback is the only other case doing that, then
> that should be ok.
> 
> In fact, now that I look at that lockdep thing, I'm confused. Where
> does the hard irq come in at all for that lock? It seems to come from
> self_group.lock, but I don't see why/how they nest.

Here's the issue. It's quite subtle.


	CPU0			CPU1
	----			----
				spin_lock(cable->lock);
spin_lock(group->lock);
spin_lock(cable->lock);
	<blocked>
				<interrupt>
				spin_lock(group->lock);
				<deadlock>

If any lock is taken while holding a lock that can be used in interrupt
context, then that lock must also be protected from interrupts as well,
even if that lock has nothing to do with interrupts.

Lockdep reported that the cable->lock was held while holding the
substream->self_group->lock, and it looks like that substream->self_group->lock
can also be taken in interrupt context.

-- Steve

> 
> That said, the sound locking is odd, I'm sure you see it. But a
> commentary about how this came about in the changelog would be good.


  reply	other threads:[~2011-03-17 20:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-17  9:40 Knut Petersen
2011-03-17  9:47 ` Knut Petersen
2011-03-17 16:55 ` Linus Torvalds
2011-03-17 17:15   ` Takashi Iwai
2011-03-17 17:33     ` Linus Torvalds
2011-03-17 20:05       ` Steven Rostedt [this message]
2011-03-17 23:12     ` Knut Petersen
2011-03-18  6:55       ` Takashi Iwai
2011-03-17 23:33   ` Knut Petersen
2011-03-18 16:08   ` Knut Petersen

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=20110317200526.GE14675@home.goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=Knut_Petersen@t-online.de \
    --cc=chris@chris-wilson.co.uk \
    --cc=d.mueller@elsoft.ch \
    --cc=gregkh@suse.de \
    --cc=jesse.barnes@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome