public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Rankin <rankincj@yahoo.com>
To: steve@stevekerrison.com, linux-media@vger.kernel.org
Subject: Possible cause of replug lockup in em28xx-dvb
Date: Tue, 16 Aug 2011 01:58:39 +0100	[thread overview]
Message-ID: <4E49C0BF.5040905@yahoo.com> (raw)
In-Reply-To: <1313397551.2818.5.camel@ares>

Hi,

I've been "plugging away" at the locking issue in the em28xx / em28xx-dvb 
modules, and I think I've found the reason. Basically, we're trying to acquire 
the dev->lock mutex again in dvb_init() when we've already acquired it in 
em28xx_init_dev().

The exact sequence is:
	em28xx_init_dev()
	- em28xx_init_extension()
	-- ops->init(dev) function for each extension

where ops->init = dvb_init() for the em28xx-dvb extension. However, if you 
remove the em28xx-dvb module first then the em28xx_extension_devlist is empty
and you avoid calling dvb_init().

As to the fix, I'm thinking of moving the mutex_lock() / mutex_unlock() calls
from dvb_init() to em28xx_register_extension() instead. This way, we ensure that 
dvb_init() is still always called with the dvb->lock mutex held.

I'll submit a patch for review in the morning. (Or should I say, "later this 
morning"...)

Cheers,
Chris

      reply	other threads:[~2011-08-16  0:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-15  0:05 PCTV 290e - assorted problems Chris Rankin
2011-08-15  8:39 ` Steve Kerrison
2011-08-16  0:58   ` Chris Rankin [this message]

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=4E49C0BF.5040905@yahoo.com \
    --to=rankincj@yahoo.com \
    --cc=linux-media@vger.kernel.org \
    --cc=steve@stevekerrison.com \
    /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