Linux-USB Archive on lore.kernel.org
 help / color / Atom feed
* possible deadlock in 3b6054da68f9b0d5ed6a7ed0f42a79e61904352c ("usb hub: send clear_tt_buffer_complete events when canceling TT clear work")
@ 2019-06-18 14:12 Oliver Neukum
  0 siblings, 0 replies; only message in thread
From: Oliver Neukum @ 2019-06-18 14:12 UTC (permalink / raw)
  To: Octavian Purdila, Alan Stern; +Cc: linux-usb

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



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-18 14:12 possible deadlock in 3b6054da68f9b0d5ed6a7ed0f42a79e61904352c ("usb hub: send clear_tt_buffer_complete events when canceling TT clear work") Oliver Neukum

Linux-USB Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-usb/0 linux-usb/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-usb linux-usb/ https://lore.kernel.org/linux-usb \
		linux-usb@vger.kernel.org linux-usb@archiver.kernel.org
	public-inbox-index linux-usb


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-usb


AGPL code for this site: git clone https://public-inbox.org/ public-inbox