From: Hans de Goede <hdegoede@redhat.com>
To: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: linux-usb@vger.kernel.org, linux-scsi@vger.kernel.org,
USB Storage List <usb-storage@lists.one-eyed-alien.net>
Subject: Re: UAS hangs khubd on USB disconnect
Date: Thu, 12 Dec 2013 14:13:21 +0100 [thread overview]
Message-ID: <52A9B671.8090004@redhat.com> (raw)
In-Reply-To: <20131212000715.GA3181@xanatos>
Hi,
On 12/12/2013 01:07 AM, Sarah Sharp wrote:
> Hi Hans,
>
> I've been testing the UAS code you sent a pull request for against
> 3.13-rc1, and I've run into a rather nasty issue with USB disconnect.
>
> I ran some tests with a USB 3.0 storage device under xHCI. The disk has
> three 10GB partitions: ext3 (sdb1), ext4 (sdb2), and fat32 (sdb4).
> There was a btrfs partition on sdb3, but I deleted it.
>
> If I start to play a movie on the ext4 partition, and then yank the USB
> cable, the uas driver is unbound from the device. It looks like
> something goes wrong in the SCSI layer shortly after that, causing an
> oops in sysfs_remove_group().
>
> If I plug in the device again, the uas driver loads and sdb is
> recognized, but the partitions aren't mounted. If I disconnect the
> device, the USB core hub thread (khubd) tries to unbind the interface,
> and the uas driver's disconnect function hangs. At that point, USB
> device hotplug on any ports (including EHCI ports) are not recognized,
> because khub is hung. Submitting and completing URBs still work, since
> that doesn't involve khubd.
>
> The end result is that disconnecting the UAS device causes USB hotplug
> to be lost on unrelated ports, while other USB devices that were
> attached at the time of the disconnect still work.
>
> I can reproduce this behavior when the UAS device is attached to the
> EHCI port only, so it's not an xHCI specific bug.
>
> If I use the "no UAS" quirk to make the usb-storage driver bind to the
> device, I can trigger the oops from the SCSI layer, but the partitions
> are always mounted and khubd doesn't hang.
Hmm, interesting I myself have experienced a similar bug during testing,
see: http://www.spinics.net/lists/linux-scsi/msg70002.html
On which I've not received any useful reply myself yet.
It seems that the scsi subsys and/or sd driver has some issues with
not tearing things down in the proper order when a disk is in use
while the scsi-host it is attached to gets removed.
As you can see in the reproduction instructions in my mail, the BUG
does not happen until I cd out of the mountpoint, at which point
the kernel tries to clean things up, and the clean up at that
point happens in a different order then it happens when unplugging
the disk while the mountpoint is not busy.
Regards,
Hans
next parent reply other threads:[~2013-12-12 13:13 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20131212000715.GA3181@xanatos>
2013-12-12 13:13 ` Hans de Goede [this message]
2013-12-12 22:04 ` [usb-storage] UAS hangs khubd on USB disconnect Alan Stern
[not found] ` <Pine.LNX.4.44L0.1312121632470.849-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-12-13 18:09 ` Sarah Sharp
2013-12-13 18:19 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1312131316470.1185-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-12-13 18:33 ` Tejun Heo
2013-12-13 19:18 ` James Bottomley
[not found] ` <1386962327.2055.54.camel-sFMDBYUN5F8GjUHQrlYNx2Wm91YjaHnnhRte9Li2A+AAvxtiuMwx3w@public.gmane.org>
2013-12-13 20:03 ` James Bottomley
[not found] ` <1386964999.2055.59.camel-sFMDBYUN5F8GjUHQrlYNx2Wm91YjaHnnhRte9Li2A+AAvxtiuMwx3w@public.gmane.org>
2013-12-13 20:22 ` Hans de Goede
2013-12-13 21:06 ` Alan Stern
2013-12-13 21:18 ` James Bottomley
[not found] ` <1386969529.2055.79.camel-sFMDBYUN5F8GjUHQrlYNx2Wm91YjaHnnhRte9Li2A+AAvxtiuMwx3w@public.gmane.org>
2013-12-14 0:48 ` Alan Stern
2013-12-14 1:27 ` James Bottomley
2013-12-14 3:00 ` Alan Stern
2013-12-14 3:03 ` [RFC] fix our current target reap infrastructure James Bottomley
2013-12-14 3:32 ` Alan Stern
2013-12-14 23:55 ` James Bottomley
2013-12-15 21:32 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1312151550380.32133-100000-pYrvlCTfrz9XsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-12-15 22:14 ` James Bottomley
[not found] ` <1387145674.2284.60.camel-sFMDBYUN5F8GjUHQrlYNx2Wm91YjaHnnhRte9Li2A+AAvxtiuMwx3w@public.gmane.org>
2013-12-16 2:44 ` Alan Stern
2013-12-16 3:32 ` James Bottomley
2013-12-16 2:49 ` Alan Stern
2013-12-16 3:33 ` James Bottomley
2013-12-13 21:13 ` [usb-storage] UAS hangs khubd on USB disconnect Sarah Sharp
2013-12-13 21:24 ` Hans de Goede
2013-12-13 20:05 ` Alan Stern
2013-12-13 19:07 ` Sarah Sharp
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=52A9B671.8090004@redhat.com \
--to=hdegoede@redhat.com \
--cc=linux-scsi@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sarah.a.sharp@linux.intel.com \
--cc=usb-storage@lists.one-eyed-alien.net \
/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.