All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: Octavian Purdila <octavian.purdila@intel.com>,
	Alan Stern <stern@rowland.harvard.edu>
Cc: linux-usb@vger.kernel.org
Subject: possible deadlock in 3b6054da68f9b0d5ed6a7ed0f42a79e61904352c ("usb hub: send clear_tt_buffer_complete events when canceling TT clear work")
Date: Tue, 18 Jun 2019 16:12:48 +0200	[thread overview]
Message-ID: <1560867168.3184.8.camel@suse.com> (raw)

Hi,

looking at this code,  which fixed a deadlock,it looks to me
like it has introduced another deadlock.

[assume a storage device on a hub being suspended]

hub_suspend() -> hub_quiesce() -> flush_work(&hub->tt.clear_work) ->

/* note that tt.clear_work is not on its own queue, it uses
simple schedule_work(). Hence the work lands on system_wq,
shared with arbitrary works */

kmalloc(... , GFP_KERNEL) -> usb_storage or uas ->
usb_autopm_get_interface() -> DEADLOCK

I think you need to use a dedicated workqueue for the hub driver.

	Regards
		Oliver



                 reply	other threads:[~2019-06-18 14:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1560867168.3184.8.camel@suse.com \
    --to=oneukum@suse.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=octavian.purdila@intel.com \
    --cc=stern@rowland.harvard.edu \
    /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.