linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Jiri Kosina <jkosina@suse.cz>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input <linux-input@vger.kernel.org>,
	Jiri Slaby <jslaby@suse.cz>
Subject: Re: lockdep report at resume
Date: Wed, 11 Feb 2009 15:33:22 +0100	[thread overview]
Message-ID: <1234362802.4016.4.camel@johannes.local> (raw)
In-Reply-To: <alpine.LRH.1.10.0902111246040.22097@twin.jikos.cz>

[-- Attachment #1: Type: text/plain, Size: 2098 bytes --]

On Wed, 2009-02-11 at 13:03 +0100, Jiri Kosina wrote:

> > [20920.459736] events/0/9 is trying to acquire lock:
> > [20920.459951]  (&dev->mutex){--..}, at: [<ffffffff804be0ac>] input_disconnect_device+0x2c/0xf0
> > [20920.460369] 
> > [20920.460370] but task is already holding lock:
> > [20920.460637]  (&usbhid->reset_work){--..}, at: [<ffffffff8025a933>] run_workqueue+0xb3/0x250
> > [20920.461049] 
> > [20920.461050] which lock already depends on the new lock.
> > [20920.461051] 
> > [20920.461425] 
> > [20920.461425] the existing dependency chain (in reverse order) is:
> > [20920.461767] 
> > [20920.461767] -> #4 (&usbhid->reset_work){--..}:
> > [20920.464572] 
> > [20920.464572] -> #3 (events){--..}:
> > [20920.468134] 
> > [20920.468134] -> #2 (cpu_add_remove_lock){--..}:
> > [20920.468134] 
> > [20920.468134] -> #1 (polldev_mutex){--..}:
> > [20920.468134] 
> > [20920.468134] -> #0 (&dev->mutex){--..}:

> OK, so we are calling usb_reset_device() from hid_reset() workqueue. You 
> have a composite device, mouse interface being handled by bcm5974 driver, 
> and keyboard interface being handled by usbhid driver.

Right.

> bcm5974 driver doesn't have _pre_reset() and _post_reset() callbacks, so 
> full unbind/bind cycle is performed by USB core. bcm5974_disconnect() 
> calls input_unregister_device(), which creates reset_work -> 
> input_dev->mutex dependency.

Yup

> Unfortunately I don't seem to see from the lockdep dumps where does the 
> input_dev->mutex -> reset_work dependency come from, am I just completely 
> blind?

Well, there's the entire chain of dependencies, so it's via polldev, and
polldev depends on cpu_add_remove_lock, etc. So it's across a whole lot
of different subsystems... the dependency is quite complex here! There's
probably no direct dependency of input_dev->mutex -> reset_work, but
reset_work is on the global workqueue ("events") which has the
dependency via some _other_ work that some _other_ subsystem is also
giving to schedule_work()!

> I will look into this.

Thanks.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2009-02-11 14:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-07 16:01 lockdep report at resume Johannes Berg
2009-02-11 12:03 ` Jiri Kosina
2009-02-11 14:33   ` Johannes Berg [this message]
2009-02-18 13:17   ` Johannes Berg
2009-03-20  8:12 ` Johannes Berg
2009-03-20 14:37   ` Jiri Kosina
2009-03-20 14:39     ` Johannes Berg
2009-03-23  9:29     ` Johannes Berg
2009-03-31  8:36       ` Jiri Kosina
2009-03-31  8:38         ` Johannes Berg
2009-03-31  8:40           ` Jiri Kosina
2009-03-31  8:42             ` Johannes Berg
2009-04-01  9:40             ` Johannes Berg
2009-04-01 10:00               ` Johannes Berg
2009-04-21 13:51               ` Jiri Kosina
2009-04-21 13:59                 ` Oliver Neukum
2009-04-21 14:11                   ` Jiri Kosina
2009-04-21 14:14                     ` Oliver Neukum
2009-04-21 14:26                     ` Johannes Berg
2009-05-05 12:47                       ` Jiri Kosina
2009-05-08 10:25                         ` Johannes Berg

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=1234362802.4016.4.camel@johannes.local \
    --to=johannes@sipsolutions.net \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=jslaby@suse.cz \
    --cc=linux-input@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).