Bug 208257 - Kingston USB flash drive repeatedly disconnected after "Set SEL for device-initiated U2 failed."
Summary: Kingston USB flash drive repeatedly disconnected after "Set SEL for device-in...
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: USB (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Default virtual assignee for Drivers/USB
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-20 07:57 UTC by Julien Humbert
Modified: 2020-11-21 11:23 UTC (History)
1 user (show)

See Also:
Kernel Version: 5.7.4
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Fedora kernel 5.7.4 dmesg log (126.89 KB, text/plain)
2020-06-20 07:57 UTC, Julien Humbert
Details
Fedora kernel 5.7.7 dmesg log (119.06 KB, text/plain)
2020-07-07 11:48 UTC, Julien Humbert
Details
Sony Vaio kernel 5.7.10 dmesg log (88.94 KB, text/plain)
2020-07-25 08:52 UTC, Julien Humbert
Details
Patch to add NO_LPM quirk (658 bytes, patch)
2020-07-26 15:05 UTC, Alan Stern
Details | Diff

Description Julien Humbert 2020-06-20 07:57:52 UTC
Created attachment 289755 [details]
Fedora kernel 5.7.4 dmesg log

Hello, I have a Kingston 32GB USB flash drive failing to get mounted. Dmesg show that the flash drive gets repeatedly disconnected after "Set SEL for device-initiated U2 failed."

I'm able to reproduce the problem on the following laptops:
* Dell XPS 7390 (connected through official Dell USB-C to USB-A adapter)
* Sony Vaio SVP132A1CM (no adapter, directly connected)

The USB drives works on the following devices:
* Multiple office desktop computer, all running Windows
* Nvidia Shield TV 2015 edition (4.9.140 kernel)

Please let me know if I can do something to help out or if some additional information is needed.

Note:
I first reported the bug as #1801627 on Fedora's Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1801627
Comment 1 Julien Humbert 2020-07-07 11:48:50 UTC
Created attachment 290155 [details]
Fedora kernel 5.7.7 dmesg log

Still the same as of kernel 5.7.7.
Comment 2 Alan Stern 2020-07-07 17:12:07 UTC
> Still the same as of kernel 5.7.7.

Have you tried disabling Link Power Management?  Before you plug in the 
flash drive, do:

   sudo echo 0951:1666:k >/sys/module/usbcore/parameters/quirks

Alan Stern
Comment 3 Julien Humbert 2020-07-08 12:14:20 UTC
(In reply to Alan Stern from comment #2)
> Have you tried disabling Link Power Management?  Before you plug in the 
> flash drive, do:
> 
>    sudo echo 0951:1666:k >/sys/module/usbcore/parameters/quirks

Incredible, that worked!
The flash drive gets mounted and I'm able to access the files on it.

Not sure what the next step, but thanks!
Comment 4 Alan Stern 2020-07-08 14:32:49 UTC
On Wed, Jul 08, 2020 at 12:14:20PM +0000, bugzilla-daemon@bugzilla.kernel.org wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=208257
> 
> --- Comment #3 from Julien Humbert (julroy67@gmail.com) ---
> (In reply to Alan Stern from comment #2)
> > Have you tried disabling Link Power Management?  Before you plug in the 
> > flash drive, do:
> > 
> >    sudo echo 0951:1666:k >/sys/module/usbcore/parameters/quirks
> 
> Incredible, that worked!
> The flash drive gets mounted and I'm able to access the files on it.
> 
> Not sure what the next step, but thanks!

Ideally we'd like to know whether this problem affects only your flash 
drive or all drives of the same type, and whether it shows up only on 
your computer or on lots of different computers.  Can you test for these 
things?

Alan Stern
Comment 5 Julien Humbert 2020-07-25 08:52:30 UTC
Created attachment 290557 [details]
Sony Vaio kernel 5.7.10 dmesg log

Sorry for the delay.

The exact same thing happens on my Sony Vaio SVP132A1CM (dmesg logs attached).
Disabling Link Power Management before plugging in the flash drive with "sudo echo 0951:1666:k >/sys/module/usbcore/parameters/quirks" fixes the issue.

I have no other laptop at hand to test, but I hope you can get the informations needed to fix it.

Thank you!
Comment 6 Alan Stern 2020-07-26 15:05:43 UTC
Created attachment 290577 [details]
Patch to add NO_LPM quirk

Here is a patch to add the NO_LPM quirk for the Kingston DataTraveler.  Can you build a kernel to test it?  If you can't, the people on the Fedora bug report may be able to help.
Comment 7 Alan Stern 2020-08-25 18:48:12 UTC
It has been about a month.  Any progress on testing the patch?
Comment 8 Julien Humbert 2020-08-27 07:47:41 UTC
I'm really sorry, nothing moved at all.
I asked for some help on the Red Hat Bugzilla, because I'm not sure how to compile the kernel with the patch, and I'm not even sure I could boot it on my main computer which is using secure boot.

I really hope I can make sure that this gets included for Fedora 33, I should try to contact some of the maintainers directly to get some movement.
Comment 9 Hans de Goede 2020-10-29 09:33:25 UTC
I've (In reply to Julien Humbert from comment #8)
> I asked for some help on the Red Hat Bugzilla, because I'm not sure how to

I have prepared a Fedora kernel test-build with the patch added, this is currently building here:
https://koji.fedoraproject.org/koji/taskinfo?taskID=54473681

Note it takes a couple of hour for the build to complete.

See here for some generic instructions on installing a kernel test-build directly from koji (the Fedora buildsystem):
https://fedorapeople.org/~jwrdegoede/kernel-test-instructions.txt

> compile the kernel with the patch, and I'm not even sure I could boot it on
> my main computer which is using secure boot.

You will need to disable secure-boot I'm afraid as test kernel-builds are not signed.

If you cannot do this from within your BIOS you can instead run:

mokutil --disable-validation

This will ask you to pick a password (I would advise using 123456789) and then on reboot will ask you to enter the nth char of the password a couple of times, to prove you have physical access to the machine *and* that it was you who requested the change.

This temporarily disables validation at the shim level, once you are done you can re-enable validation by running:

mokutil --enable-validation
Comment 10 Julien Humbert 2020-11-01 00:50:59 UTC
(In reply to Hans de Goede from comment #9)
> I have prepared a Fedora kernel test-build with the patch added, this is
> currently building here:
> https://koji.fedoraproject.org/koji/taskinfo?taskID=54473681

Thank you for the build and the instructions!

I've tested out the kernel and everything works fine, the Kingston USB flash drive gets mounted, I can read and copy to it without any problem.

So it took some time, but the patch is working!
Comment 11 Hans de Goede 2020-11-02 09:13:33 UTC
(In reply to Julien Humbert from comment #10)
> I've tested out the kernel and everything works fine, the Kingston USB flash
> drive gets mounted, I can read and copy to it without any problem.
> 
> So it took some time, but the patch is working!

Great, so lets submit the patch upstream then. Alan do you want to submit the quirk upstream, or shall I submit it?
Comment 12 Alan Stern 2020-11-02 14:44:07 UTC
I'll take care of it.  I was just waiting for confirmation that the patch worked okay.
Comment 13 Hans de Goede 2020-11-02 15:52:35 UTC
(In reply to Alan Stern from comment #12)
> I'll take care of it.  I was just waiting for confirmation that the patch
> worked okay.

Ok, I saw the patch, LGTM. So I believe this bug can be closed then ?
Comment 14 Julien Humbert 2020-11-21 11:23:33 UTC
Tested and fixed on Fedora kernel 5.9.8-200.fc33.x86_64.

Thanks a lot for the help fixing the issue!

Note You need to log in before you can comment on or make changes to this bug.