New ID in ums-realtek module breaks cardreader

Bug #1838886 reported by Uwe Schindler
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
Fix Released
Medium
Unassigned
Disco
Fix Released
Medium
Unassigned
Eoan
Confirmed
Undecided
Unassigned

Bug Description

=== SRU Justification ===
[Impact]
Some ums-realtek card readers may dropped from USB bus after using
ums-realtek driver instead of usb-storage generic driver.

[Fix]
Disable auto-delink on new ums-realtek devices, only whitelist three
oldest IDs.

[Test]
Affected user and myself confirmed disabling auto-delink works.

[Regression Potential]
Minimal. Limited to one specific driver and this also restore the old
behavior.

=== Original Bug Report ===
When installing the latest HWE stack (Linux 5.0) to Ubuntu 18.04, the Realtek cardreader in my ZOTAC ZBOX-CI323NANO stops working correctly.

Previously it accepted SD cards all the time. Now it looks like you have to insert the card on booting or shortly after booting to access it. If you wait longer, it no longer detects the card. The reason for this can be found in the kernel log (dmes). On boot it seems to detect a card in the reader, although there is none. After a while it says "Read capacity failed" and "scsi 2:0:0:0: rejecting I/O to dead device" and then resets the device. It tries this 3 times and then gives up completely. After that any real device plugged is no longer detected.

The device is: idVendor=0bda, idProduct=0153, bcdDevice=57.13

Support for this was added in mainline kernel: https://github.com/torvalds/linux/commit/1a6dd3fea131276a4fc44ae77b0f471b0b473577

And this seems to be backported to 5.0 kernel in Ubuntu 18.04 HWE stack.

Full log on boot (no card inserted):

[ 3.689559] usb 1-5.1: new high-speed USB device number 4 using xhci_hcd
[ 3.898312] usb 1-5.1: New USB device found, idVendor=0bda, idProduct=0153, bcdDevice=57.13
[ 3.898316] usb 1-5.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3.898319] usb 1-5.1: Product: USB2.0-CRW
[ 3.898322] usb 1-5.1: Manufacturer: Generic
[ 3.898324] usb 1-5.1: SerialNumber: 20120926571200000
[ 3.911571] usbcore: registered new interface driver usb-storage
[ 3.914796] usbcore: registered new interface driver uas
[ 3.917676] ums-realtek 1-5.1:1.0: USB Mass Storage device detected
[ 3.924478] scsi host2: usb-storage 1-5.1:1.0
[ 3.924649] usbcore: registered new interface driver ums-realtek
[...]
[ 13.477360] ums-realtek 1-5.1:1.0: USB Mass Storage device detected
[ 13.509592] scsi host2: usb-storage 1-5.1:1.0
[ 14.544213] scsi 2:0:0:0: Direct-Access Generic- SD/MMC/MS PRO 1.00 PQ: 0 ANSI: 4
[ 14.545237] sd 2:0:0:0: Attached scsi generic sg1 type 0
[ 14.549430] sd 2:0:0:0: [sdb] Attached SCSI removable disk
[ 170.961728] scsi 2:0:0:0: rejecting I/O to dead device
[ 170.962069] scsi 2:0:0:0: [sdb] Read Capacity(10) failed: Result: hostbyte=DID_OK driverbyte=DRIVER_ERROR
[ 170.962073] scsi 2:0:0:0: [sdb] Sense not available.
[ 171.985846] usb 1-5.1: new high-speed USB device number 8 using xhci_hcd
[ 172.194299] usb 1-5.1: New USB device found, idVendor=0bda, idProduct=0153, bcdDevice=57.13
[ 172.194317] usb 1-5.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 172.194327] usb 1-5.1: Product: USB2.0-CRW
[ 172.194338] usb 1-5.1: Manufacturer: Generic
[ 172.194346] usb 1-5.1: SerialNumber: 20120926571200000
[ 172.200625] ums-realtek 1-5.1:1.0: USB Mass Storage device detected
[ 172.212503] scsi host2: usb-storage 1-5.1:1.0
[ 173.233036] scsi 2:0:0:0: Direct-Access Generic- SD/MMC/MS PRO 1.00 PQ: 0 ANSI: 4
[ 173.233796] sd 2:0:0:0: Attached scsi generic sg1 type 0
[ 173.239620] sd 2:0:0:0: [sdb] Attached SCSI removable disk
[ 329.654468] usb 1-5.1: USB disconnect, device number 8
[ 329.665905] scsi 2:0:0:0: rejecting I/O to dead device
[ 329.665970] scsi 2:0:0:0: [sdb] Read Capacity(10) failed: Result: hostbyte=DID_OK driverbyte=DRIVER_ERROR
[ 329.665976] scsi 2:0:0:0: [sdb] Sense not available.
[ 330.701685] usb 1-5.1: new high-speed USB device number 9 using xhci_hcd
[ 330.910415] usb 1-5.1: New USB device found, idVendor=0bda, idProduct=0153, bcdDevice=57.13
[ 330.910433] usb 1-5.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 330.910444] usb 1-5.1: Product: USB2.0-CRW
[ 330.910455] usb 1-5.1: Manufacturer: Generic
[ 330.910463] usb 1-5.1: SerialNumber: 20120926571200000
[ 330.917013] ums-realtek 1-5.1:1.0: USB Mass Storage device detected
[ 330.932295] scsi host2: usb-storage 1-5.1:1.0
[ 331.952829] scsi 2:0:0:0: Direct-Access Generic- SD/MMC/MS PRO 1.00 PQ: 0 ANSI: 4
[ 331.953686] sd 2:0:0:0: Attached scsi generic sg1 type 0
[ 331.960126] sd 2:0:0:0: [sdb] Attached SCSI removable disk
[ 488.343981] usb 1-5.1: USB disconnect, device number 9
[ 488.354292] scsi 2:0:0:0: rejecting I/O to dead device
[ 488.356453] scsi 2:0:0:0: [sdb] Read Capacity(10) failed: Result: hostbyte=DID_OK driverbyte=DRIVER_ERROR
[ 488.356458] scsi 2:0:0:0: [sdb] Sense not available.

After time 488, any SD card inserted is no longer detected, because driver gave up.

Please revert adding the device with idVendor=0bda, idProduct=0153 to ums-realtek and let it be handled by default driver and please also report this bug upstream.

After this change it's unfortunately no longet possible to force the kernel to use the default driver, or is there a module option?
---
ProblemType: Bug
AlsaVersion: Advanced Linux Sound Architecture Driver Version k5.0.0-23-generic.
AplayDevices: Error: [Errno 2] No such file or directory: 'aplay': 'aplay'
ApportVersion: 2.20.9-0ubuntu7.7
Architecture: amd64
ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord': 'arecord'
AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/by-path', '/dev/snd/controlC0', '/dev/snd/hwC0D2', '/dev/snd/hwC0D0', '/dev/snd/pcmC0D8p', '/dev/snd/pcmC0D7p', '/dev/snd/pcmC0D3p', '/dev/snd/pcmC0D1p', '/dev/snd/pcmC0D0c', '/dev/snd/pcmC0D0p', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1:
Card0.Amixer.info: Error: [Errno 2] No such file or directory: 'amixer': 'amixer'
Card0.Amixer.values: Error: [Errno 2] No such file or directory: 'amixer': 'amixer'
DistroRelease: Ubuntu 18.04
InstallationDate: Installed on 2017-09-12 (690 days ago)
InstallationMedia: Ubuntu-Server 16.04.3 LTS "Xenial Xerus" - Release amd64 (20170801)
Lsusb:
 Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
 Bus 001 Device 006: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T
 Bus 001 Device 005: ID 8087:0a2a Intel Corp.
 Bus 001 Device 003: ID 1a40:0101 Terminus Technology Inc. Hub
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
MachineType: ZOTAC ZBOX-CI323NANO
Package: linux (not installed)
ProcEnviron:
 TERM=cygwin
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcFB: 0 inteldrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-5.0.0-23-generic root=UUID=e5aafb31-5d5d-4f35-bd44-b3965316331a ro net.ifnames=0
ProcVersionSignature: Ubuntu 5.0.0-23.24~18.04.1-generic 5.0.15
RelatedPackageVersions:
 linux-restricted-modules-5.0.0-23-generic N/A
 linux-backports-modules-5.0.0-23-generic N/A
 linux-firmware 1.173.9
RfKill: Error: [Errno 2] No such file or directory: 'rfkill': 'rfkill'
Tags: bionic
Uname: Linux 5.0.0-23-generic x86_64
UpgradeStatus: Upgraded to bionic on 2018-08-15 (353 days ago)
UserGroups:

_MarkForUpload: True
dmi.bios.date: 03/07/2017
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: B301P021
dmi.board.asset.tag: N/A
dmi.board.name: ZBOX-CI323NANO
dmi.board.vendor: ZOTAC
dmi.board.version: XX
dmi.chassis.asset.tag: Default string
dmi.chassis.type: 2
dmi.chassis.vendor: Default string
dmi.chassis.version: Default string
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrB301P021:bd03/07/2017:svnZOTAC:pnZBOX-CI323NANO:pvrXX:rvnZOTAC:rnZBOX-CI323NANO:rvrXX:cvnDefaultstring:ct2:cvrDefaultstring:
dmi.product.family: N/A
dmi.product.name: ZBOX-CI323NANO
dmi.product.sku: N/A
dmi.product.version: XX
dmi.sys.vendor: ZOTAC

Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1838886

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote : AlsaDevices.txt

apport information

tags: added: apport-collected bionic
description: updated
Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote : CRDA.txt

apport information

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote : Card0.Codecs.codec.0.txt

apport information

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote : Card0.Codecs.codec.2.txt

apport information

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote : CurrentDmesg.txt

apport information

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote : IwConfig.txt

apport information

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote : Lspci.txt

apport information

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote : PciMultimedia.txt

apport information

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote : ProcInterrupts.txt

apport information

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote : ProcModules.txt

apport information

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote : UdevDb.txt

apport information

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote : WifiSyslog.txt

apport information

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Ok, as the commit author, I'll raise the issue to Realtek.

Changed in linux (Ubuntu):
assignee: nobody → Kai-Heng Feng (kaihengfeng)
Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote :

Thanks. If you need any more information, I am happy to help.

Is there any way to tell usb-storage to not use the realtek driver and instead the default one?

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote :

Some more info: I was not able to run the device with new kernel, not even with blacklisted ums-realtek. It looks like the native usb-storage driver ignores the device id.

On 4.17 kernel I verified that the device loads perfectly with the default usb-storage driver uas.

I have no idea why this was changed at all.

Revision history for this message
Hui Wang (hui.wang) wrote :

Reply #18:

It looks like after the id is added to unusual_realtek.h(USB: usb-storage: Add new ID to ums-realtek ), the uas will not handle this device anymore since it calls usb_usual_ignore_device() and this device is ignored by the uas.

That is the reason for the result of #18.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

For starter, please test latest mainline kernel:
https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.3-rc2/

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote :

Ok, does this build contain any changes regarding to this? Since the commit on upstream mentioned above there were no changes in ums-realtek so I don't think this will help. IMHO, reverting the patch is the only right thing to do. The device id used for this device is much older than the other ones, so I don't think it can ever work with this driver. Let's just use the default driver. Works and is tested. I don't care about MMC.

I am currently on travel this week, so I can only try when back at office. Installing such a kernel from remote on the router at home seems a bad idea.

Uwe

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Can you fully power off your system, unplug the power plug and see if the issue disappears after a cold boot?

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote :

As said before I have no physical access anymore.

But yes, it was all tested. I am developer like you, so I know what I am doing.

Uwe

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

I asked that because I've observed that on my machine if I reboot the system from older kernel.
New kernels have a fix for USB2 LPM shutdown, exactly for issues like this one.

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote : Re: [Bug 1838886] Re: New ID in ums-realtek module breaks cardreader
Download full text (8.4 KiB)

Ok, I will try newer kernel on the weekend. Until then I can't check it. Sorry.

Uwe

Am August 5, 2019 12:55:30 PM UTC schrieb Kai-Heng Feng <email address hidden>:
>I asked that because I've observed that on my machine if I reboot the
>system from older kernel.
>New kernels have a fix for USB2 LPM shutdown, exactly for issues like
>this one.
>
>--
>You received this bug notification because you are subscribed to the
>bug
>report.
>https://bugs.launchpad.net/bugs/1838886
>
>Title:
> New ID in ums-realtek module breaks cardreader
>
>Status in linux package in Ubuntu:
> Confirmed
>
>Bug description:
> When installing the latest HWE stack (Linux 5.0) to Ubuntu 18.04, the
> Realtek cardreader in my ZOTAC ZBOX-CI323NANO stops working correctly.
>
> Previously it accepted SD cards all the time. Now it looks like you
> have to insert the card on booting or shortly after booting to access
> it. If you wait longer, it no longer detects the card. The reason for
> this can be found in the kernel log (dmes). On boot it seems to detect
> a card in the reader, although there is none. After a while it says
> "Read capacity failed" and "scsi 2:0:0:0: rejecting I/O to dead
> device" and then resets the device. It tries this 3 times and then
> gives up completely. After that any real device plugged is no longer
> detected.
>
> The device is: idVendor=0bda, idProduct=0153, bcdDevice=57.13
>
> Support for this was added in mainline kernel:
>https://github.com/torvalds/linux/commit/1a6dd3fea131276a4fc44ae77b0f471b0b473577
>
> And this seems to be backported to 5.0 kernel in Ubuntu 18.04 HWE
> stack.
>
> Full log on boot (no card inserted):
>
>[ 3.689559] usb 1-5.1: new high-speed USB device number 4 using
>xhci_hcd
>[ 3.898312] usb 1-5.1: New USB device found, idVendor=0bda,
>idProduct=0153, bcdDevice=57.13
>[ 3.898316] usb 1-5.1: New USB device strings: Mfr=1, Product=2,
>SerialNumber=3
> [ 3.898319] usb 1-5.1: Product: USB2.0-CRW
> [ 3.898322] usb 1-5.1: Manufacturer: Generic
> [ 3.898324] usb 1-5.1: SerialNumber: 20120926571200000
> [ 3.911571] usbcore: registered new interface driver usb-storage
> [ 3.914796] usbcore: registered new interface driver uas
> [ 3.917676] ums-realtek 1-5.1:1.0: USB Mass Storage device detected
> [ 3.924478] scsi host2: usb-storage 1-5.1:1.0
> [ 3.924649] usbcore: registered new interface driver ums-realtek
> [...]
> [ 13.477360] ums-realtek 1-5.1:1.0: USB Mass Storage device detected
> [ 13.509592] scsi host2: usb-storage 1-5.1:1.0
>[ 14.544213] scsi 2:0:0:0: Direct-Access Generic- SD/MMC/MS PRO
> 1.00 PQ: 0 ANSI: 4
> [ 14.545237] sd 2:0:0:0: Attached scsi generic sg1 type 0
> [ 14.549430] sd 2:0:0:0: [sdb] Attached SCSI removable disk
> [ 170.961728] scsi 2:0:0:0: rejecting I/O to dead device
>[ 170.962069] scsi 2:0:0:0: [sdb] Read Capacity(10) failed: Result:
>hostbyte=DID_OK driverbyte=DRIVER_ERROR
> [ 170.962073] scsi 2:0:0:0: [sdb] Sense not available.
>[ 171.985846] usb 1-5.1: new high-speed USB device number 8 using
>xhci_hcd
>[ 172.194299] usb 1-5.1: New USB device found, idVendor=0bda,
>idProduct=0153, bcdDevice=57.13
>[ 172.1943...

Read more...

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote :

Hi,
I was able to try the 5.3.0 kernel from the PPA as stated above. It was a bit complicated, as I had to disable secure boot first, so it was good that I did not try it from remote (my wife would have killed me!).

In short: The problem persists. The ums-realtek driver does not work with this device ID. Same kernel messages, 3 retries to find the phantom device (sdb in my case) and always it gave up after timeout. After 3 tries the device is blocked completely.

This happened also after completely switching of system and disconnecting from power coord.

In short: The device ID added in the latest commit to ums-realtek does not work, so please revert it and also tell this upstream.

@Kai-Heng: When you committed that to upstream kernel, did you test this on a real device? To me it's completely un-understandable why to forcefully switch a device which works perfectly well with the default USB storage driver to a custom vendor-specific driver without any reason!

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Does "ums_realtek.auto_delink_en=0" kernel parameter help?

I don't see the issue after adding the option.

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote :

Hi,
I can confirm, if I add this parameter to /etc/modprobe.d/realtek.conf:

options ums-realtek auto_delink_en=0

...and rebuild the initramfs, after a full shutdown with power coord removed, it works correctly - but only initially!!! FYI, just rebooting is not enough and brings crazy error messages about device errors (I think the device state was not sane; you mentioned this before).

After reboot, I see the /dev/sdb device with no partitions:

root@sirius:~# dd if=/dev/sdb of=/dev/null
dd: failed to open '/dev/sdb': No medium found

After that, I did some tests and all worked fine: After inserting a SD card, it recognizes the partiontions and I was able to mount:

[ 67.620372] sd 2:0:0:0: [sdb] 31116288 512-byte logical blocks: (15.9 GB/14.8 GiB)
[ 67.630565] sdb: sdb1

root@sirius:~# mount /dev/sdb1 /mnt
root@sirius:~# ls -l /mnt/
total 8
drwxr-xr-x 2 root root 8192 Aug 4 19:22 'System Volume Information'
root@sirius:~# umount /mnt

After removing the card, the partition /dev/sdb1 disappeared. Reinserting the card directly after removal worked fine: I was able to see the card and do the same tests again.

But now the problem: I waited 15 minutes and tried again: After inserting the card, no kernel messages about detected partitions. If I do the "dd" on /dev/sdb it hangs completely. You cannot even kill the dd process from another terminal. Kernel messages:

[ 1209.490442] INFO: task kworker/u8:4:305 blocked for more than 120 seconds.
[ 1209.490454] Not tainted 5.0.0-23-generic #24~18.04.1-Ubuntu
[ 1209.490459] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 1209.490467] kworker/u8:4 D 0 305 2 0x80000000
[ 1209.490502] Workqueue: scsi_tmf_2 scmd_eh_abort_handler
[ 1209.490511] Call Trace:
[ 1209.490543] __schedule+0x2bd/0x850
[ 1209.490561] schedule+0x2c/0x70
[ 1209.490572] schedule_timeout+0x1db/0x360
[ 1209.490584] ? __switch_to_asm+0x40/0x70
[ 1209.490593] ? __switch_to_asm+0x34/0x70
[ 1209.490602] ? __switch_to_asm+0x40/0x70
[ 1209.490611] ? __switch_to_asm+0x34/0x70
[ 1209.490620] ? __switch_to_asm+0x40/0x70
[ 1209.490629] ? __switch_to_asm+0x34/0x70
[ 1209.490638] ? __switch_to_asm+0x40/0x70
[ 1209.490647] ? __switch_to_asm+0x34/0x70
[ 1209.490658] wait_for_completion+0xba/0x140
[ 1209.490671] ? wake_up_q+0x80/0x80
[ 1209.490700] command_abort+0x60/0xa0 [usb_storage]
[ 1209.490712] scmd_eh_abort_handler+0x5e/0x230
[ 1209.490726] process_one_work+0x1fd/0x400
[ 1209.490738] worker_thread+0x34/0x410
[ 1209.490753] kthread+0x121/0x140
[ 1209.490762] ? process_one_work+0x400/0x400
[ 1209.490773] ? kthread_park+0x90/0x90
[ 1209.490784] ret_from_fork+0x35/0x40

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote :

Of course, I forgot to add: I did the test with current stable 5.0 kernel. If I should repeat all tests with latest (unsigned) kernel, please tell me.

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote :

Should I maybe disable selective suspend and try again?

root@sirius:~# cat /sys/module/ums_realtek/parameters/ss_en
1

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

I am currently sorting this out with Realtek. I'll let you know when there's any progress.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Can you boot with module option:
options ums-realtek dyndbg=+p

And attach dmesg? Thanks.

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote :
Download full text (3.5 KiB)

Hi,
after enabling that option, there were not many additional lines in dmesg. Asking the debugfs was not possible due to kernel-lockdown.

[ 3.632200] usb 1-5.1: New USB device found, idVendor=0bda, idProduct=0153, bcdDevice=57.13 [ 3.632203] usb 1-5.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 3.632205] usb 1-5.1: Product: USB2.0-CRW [ 3.632207] usb 1-5.1: Manufacturer: Generic [ 3.632209] usb 1-5.1: SerialNumber: 20120926571200000 [ 3.644643] usbcore: registered new interface driver usb-storage [ 3.647784] usbcore: registered new interface driver uas [ 3.650941] ums-realtek 1-5.1:1.0: Probe Realtek Card Reader!
[ 3.650943] ums-realtek 1-5.1:1.0: USB Mass Storage device detected
[ 3.656160] scsi host2: usb-storage 1-5.1:1.0
[ 3.656374] usbcore: registered new interface driver ums-realtek
[...]
[ 4.667215] sd 2:0:0:0: Attached scsi generic sg1 type 0
[ 4.671782] sd 2:0:0:0: [sdb] Attached SCSI removable disk

When inserting cards:

[ 95.427175] sd 2:0:0:0: [sdb] 31116288 512-byte logical blocks: (15.9 GB/14.8 GiB)
[ 95.437260] sdb: sdb1
[ 419.518691] sd 2:0:0:0: [sdb] 31116288 512-byte logical blocks: (15.9 GB/14.8 GiB)
[ 419.529411] sdb: sdb1
[ 887.138965] sd 2:0:0:0: [sdb] 31116288 512-byte logical blocks: (15.9 GB/14.8 GiB)
[ 887.150594] sdb: sdb1
[ 2140.600999] sd 2:0:0:0: [sdb] 31116288 512-byte logical blocks: (15.9 GB/14.8 GiB)
[ 2140.611660] sdb: sdb1
[...]
[54170.761092] sd 2:0:0:0: [sdb] 31116288 512-byte logical blocks: (15.9 GB/14.8 GiB)
[54170.771448] sdb: sdb1

Interestingly, this time the device gave not up after half of a day. So maybe the timeouts yesterday was more a problem with the card, although it did respond after reboot again.

So how should we proceed? It looks like the "auto_delink_en=0" helps for this device. I can keep this ...

Read more...

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Hi,

Can you please attach full dmesg? Thanks.

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote :

Here is the full output attached.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Can you please test this kernel:
https://people.canonical.com/~khfeng/lp1838886/

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote :

Hi Kai-Heng,
I was on vacation last week, will test this soon!

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote :

Hi Kai-Heng,
I installed your kernel, removed module parameters, recreated initramfs and rebooted with full shutdown/powerplugged.

It looks like it's coming up without any warnings showing. It also detects no phantom cards. I was also able to insert a SD card and was able to mount it.

So looks like it's working. What did you change exactly?

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

https://<email address hidden>/

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote :

Thanks, looks fine, well understood. It would be good to keep me in CC once Realtek provides a new patch. I can help to test. Of course this issue is solved after the workaround with limiting auto-delink to the three "original IDs" only.

description: updated
Changed in linux (Ubuntu Eoan):
assignee: Kai-Heng Feng (kaihengfeng) → nobody
Stefan Bader (smb)
Changed in linux (Ubuntu Bionic):
importance: Undecided → Medium
Changed in linux (Ubuntu Disco):
importance: Undecided → Medium
Revision history for this message
Kleber Sacilotto de Souza (kleber-souza) wrote :

These kernel commits:

* USB: storage: ums-realtek: Update module parameter description for auto_delink_en
* USB: storage: ums-realtek: Whitelist auto-delink support

have already been applied to Bionic as part of bug #1843338 (Bionic update: upstream stable patchset 2019-09-09) and to Disco as part of bug #1843622 (Disco update: upstream stable patchset 2019-09-11).

Changed in linux (Ubuntu Bionic):
status: New → Fix Committed
Changed in linux (Ubuntu Disco):
status: New → Fix Committed
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-bionic' to 'verification-done-bionic'. If the problem still exists, change the tag 'verification-needed-bionic' to 'verification-failed-bionic'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-bionic
Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote :

Hi,
I installed the latest -proposed kernel image in bionic (HWE variant), but the bug is not fixed there. It looks like it's not merged into the 5.0 kernel there. That's easy to see, because modinfo, still shows the old parameter description:

root@sirius:~# modinfo ums-realtek
filename: /lib/modules/5.0.0-31-generic/kernel/drivers/usb/storage/ums-realtek.ko
license: GPL
author: wwang <email address hidden>
description: Driver for Realtek USB Card Reader
srcversion: 644B44C347E6C4FFEFDA3C7
alias: usb:v0BDAp0184d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v0BDAp0177d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v0BDAp0159d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v0BDAp0158d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v0BDAp0153d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v0BDAp0138d*dc*dsc*dp*ic*isc*ip*in*
depends: usb-storage
retpoline: Y
intree: Y
name: ums_realtek
vermagic: 5.0.0-31-generic SMP mod_unload
signat: PKCS#7
signer:
sig_key:
sig_hashalgo: md4
parm: auto_delink_en:enable auto delink (int)
parm: enable_mmc:enable mmc support (int)
parm: ss_en:enable selective suspend (int)
parm: ss_delay:seconds to delay before entering selective suspend (int)

This is wrong:
auto_delink_en:enable auto delink (int)

According to the kernel patch (https://lkml.org/lkml/2019/9/4/1276) it should be:
auto_delink_en:auto delink mode (0=firmware, 1=software [default]) (int)

To fix the problem I still need the workaround by setting auto_delink_en to "0".

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote :

This is the kernel that was installed from "-proposed":
Linux sirius 5.0.0-31-generic #33~18.04.1-Ubuntu SMP Tue Oct 1 10:20:39 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

tags: added: verification-failed-bionic
removed: verification-needed-bionic
Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

It's not in 5.0.0-31. It's included in 5.0.0-32.34.

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote :

OK, so how comes that the bot sent me this message that I should test "-proposed"?

Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-xenial' to 'verification-done-xenial'. If the problem still exists, change the tag 'verification-needed-xenial' to 'verification-failed-xenial'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-xenial
Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Because the fix is in Bionic kernel so the bot send the message.
The 5.0 based kernel you are using is from Disco, so it'll use verification-needed-disco instead.

Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-disco' to 'verification-done-disco'. If the problem still exists, change the tag 'verification-needed-disco' to 'verification-failed-disco'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-disco
Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote :

Hi,
using the "-proposed" thingie in Bionic with the HWE kernel did not work even after the last query.

So I did it the hard way (without any PPA used with APT/APT-GET). I downloaded the kernel manually and installed the following files:

root@sirius:~/kernel-pkg# ls -l
total 66160
-rw-r--r-- 1 root root 10758372 Oct 4 13:58 linux-headers-5.0.0-32_5.0.0-32.34_all.deb
-rw-r--r-- 1 root root 1245844 Oct 4 13:58 linux-headers-5.0.0-32-generic_5.0.0-32.34_amd64.deb
-rw-r--r-- 1 root root 8424200 Oct 4 16:18 linux-image-5.0.0-32-generic_5.0.0-32.34_amd64.deb
-rw-r--r-- 1 root root 13831532 Oct 4 13:58 linux-modules-5.0.0-32-generic_5.0.0-32.34_amd64.deb
-rw-r--r-- 1 root root 33478212 Oct 4 13:58 linux-modules-extra-5.0.0-32-generic_5.0.0-32.34_amd64.deb

After removing the special module params and rebuilding initramfs, the kernel booted perfectly and ums-realtek worked.

The module-info was correct:

root@sirius:~# modinfo ums-realtek
filename: /lib/modules/5.0.0-32-generic/kernel/drivers/usb/storage/ums-realtek.ko
license: GPL
author: wwang <email address hidden>
description: Driver for Realtek USB Card Reader
srcversion: EA294247A6C868AE3685D12
alias: usb:v0BDAp0184d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v0BDAp0177d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v0BDAp0159d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v0BDAp0158d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v0BDAp0153d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v0BDAp0138d*dc*dsc*dp*ic*isc*ip*in*
depends: usb-storage
retpoline: Y
intree: Y
name: ums_realtek
vermagic: 5.0.0-32-generic SMP mod_unload
signat: PKCS#7
signer:
sig_key:
sig_hashalgo: md4
parm: auto_delink_en:auto delink mode (0=firmware, 1=software [default]) (int)
parm: enable_mmc:enable mmc support (int)
parm: ss_en:enable selective suspend (int)
parm: ss_delay:seconds to delay before entering selective suspend (int)

So I can confirm the HWE kernel in 18.04 is fine, too.

Nevertheless, I have no idea if or why the bionic default kernel was affected at all. I opened the issue only on the HWE kernel, so maybe the kernel bot should be improved to actually understand before sending stupid messages to me about stuff I can't check.

I will add the disco verification. I will keep the bionic verification and set it back to the default, although I can't test it. I will remove the bionic-verification failed tag.

Uwe

tags: added: verification-done-disco
removed: verification-failed-bionic verification-needed-disco
Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote :

It would be good that somebody else adds the correct tags so this fix gets delivered to all distributions using the 5.x kernels. I am not sure if 4.x needs the fix at all, as according to the latest non-hwe kernel I used in bionic, the bad realtek IDs were not added to the unusual devices. But maybe that changed in the meantime.

Revision history for this message
Uwe Schindler (uwe-thetaphi) wrote :

For confirmation that my auto_delink_en setting was kept by the default after rebooting (so I made sure that initramfs was containing correct settings):

root@sirius:~# cat /sys/module/ums_realtek/parameters/auto_delink_en
1

So it looks like the module boots correctly and having the default auto_delink_en setting, but for the specific device it's not using the setting. So fix confirmed!

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (22.6 KiB)

This bug was fixed in the package linux - 5.0.0-32.34

---------------
linux (5.0.0-32.34) disco; urgency=medium

  * disco/linux: 5.0.0-32.34 -proposed tracker (LP: #1846097)

  * CVE-2019-14814 // CVE-2019-14815 // CVE-2019-14816
    - mwifiex: Fix three heap overflow at parsing element in cfg80211_ap_settings

  * CVE-2019-15505
    - media: technisat-usb2: break out of loop at end of buffer

  * CVE-2019-2181
    - binder: check for overflow when alloc for security context

  * Support Hi1620 zip hw accelerator (LP: #1845355)
    - [Config] Enable HiSilicon QM/ZIP as modules
    - crypto: hisilicon - add queue management driver for HiSilicon QM module
    - crypto: hisilicon - add hardware SGL support
    - crypto: hisilicon - add HiSilicon ZIP accelerator support
    - crypto: hisilicon - add SRIOV support for ZIP
    - Documentation: Add debugfs doc for hisi_zip
    - crypto: hisilicon - add debugfs for ZIP and QM
    - MAINTAINERS: add maintainer for HiSilicon QM and ZIP controller driver
    - crypto: hisilicon - fix kbuild warnings
    - crypto: hisilicon - add dependency for CRYPTO_DEV_HISI_ZIP
    - crypto: hisilicon - init curr_sgl_dma to fix compile warning
    - crypto: hisilicon - add missing single_release
    - crypto: hisilicon - fix error handle in hisi_zip_create_req_q
    - crypto: hisilicon - Fix warning on printing %p with dma_addr_t
    - crypto: hisilicon - Fix return value check in hisi_zip_acompress()
    - crypto: hisilicon - avoid unused function warning

  * xfrm interface: several kernel panic (LP: #1836261)
    - xfrm interface: fix memory leak on creation
    - xfrm interface: avoid corruption on changelink
    - xfrm interface: ifname may be wrong in logs
    - xfrm interface: fix list corruption for x-netns
    - xfrm interface: fix management of phydev

  * shiftfs: drop entries from cache on unlink (LP: #1841977)
    - SAUCE: shiftfs: fix buggy unlink logic

  * shiftfs: mark kmem_cache as reclaimable (LP: #1842059)
    - SAUCE: shiftfs: mark slab objects SLAB_RECLAIM_ACCOUNT

  * Suspend to RAM(S3) does not wake up for latest megaraid and mpt3sas
    adapters(SAS3.5 onwards) (LP: #1838751)
    - PCI: Restore Resizable BAR size bits correctly for 1MB BARs

  * No sound inputs from the external microphone and headset on a Dell machine
    (LP: #1842265)
    - ALSA: hda - Expand pin_match function to match upcoming new tbls
    - ALSA: hda - Define a fallback_pin_fixup_tbl for alc269 family

  * Add -fcf-protection=none when using retpoline flags (LP: #1843291)
    - SAUCE: kbuild: add -fcf-protection=none when using retpoline flags

  * Disco update: upstream stable patchset 2019-09-25 (LP: #1845390)
    - bridge/mdb: remove wrong use of NLM_F_MULTI
    - cdc_ether: fix rndis support for Mediatek based smartphones
    - ipv6: Fix the link time qualifier of 'ping_v6_proc_exit_net()'
    - isdn/capi: check message length in capi_write()
    - ixgbe: Fix secpath usage for IPsec TX offload.
    - net: Fix null de-reference of device refcount
    - net: gso: Fix skb_segment splat when splitting gso_size mangled skb having
      linear-headed frag_list
    - net: phylink: Fix flow control resolution
    - net: s...

Changed in linux (Ubuntu Disco):
status: Fix Committed → Fix Released
Revision history for this message
Khaled El Mously (kmously) wrote :

Based on the feedback in comment #52, I manually re-added the ' verification-done-bionic ' tag to make the bots happy.

Thanks for the feedback @Uwe Schindler !!

tags: added: verification-done-bionic
tags: added: verification-done-xenial
removed: verification-needed-xenial
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (23.3 KiB)

This bug was fixed in the package linux - 4.15.0-66.75

---------------
linux (4.15.0-66.75) bionic; urgency=medium

  * bionic/linux: 4.15.0-66.75 -proposed tracker (LP: #1846131)

  * Packaging resync (LP: #1786013)
    - [Packaging] update helper scripts

  * CVE-2018-21008
    - rsi: add fix for crash during assertions

  * ipv6: fix neighbour resolution with raw socket (LP: #1834465)
    - ipv6: constify rt6_nexthop()
    - ipv6: fix neighbour resolution with raw socket

  * run_netsocktests from net in ubuntu_kernel_selftests failed with X-4.15
    (LP: #1842023)
    - SAUCE: selftests: net: replace AF_MAX with INT_MAX in socket.c

  * No sound inputs from the external microphone and headset on a Dell machine
    (LP: #1842265)
    - ALSA: hda - Expand pin_match function to match upcoming new tbls
    - ALSA: hda - Define a fallback_pin_fixup_tbl for alc269 family

  * Add -fcf-protection=none when using retpoline flags (LP: #1843291)
    - SAUCE: kbuild: add -fcf-protection=none when using retpoline flags

  * Enhanced Hardware Support - Finalize Naming (LP: #1842774)
    - s390: add support for IBM z15 machines

  * Bionic update: upstream stable patchset 2019-09-24 (LP: #1845266)
    - bridge/mdb: remove wrong use of NLM_F_MULTI
    - cdc_ether: fix rndis support for Mediatek based smartphones
    - ipv6: Fix the link time qualifier of 'ping_v6_proc_exit_net()'
    - isdn/capi: check message length in capi_write()
    - net: Fix null de-reference of device refcount
    - net: gso: Fix skb_segment splat when splitting gso_size mangled skb having
      linear-headed frag_list
    - net: phylink: Fix flow control resolution
    - sch_hhf: ensure quantum and hhf_non_hh_weight are non-zero
    - sctp: Fix the link time qualifier of 'sctp_ctrlsock_exit()'
    - sctp: use transport pf_retrans in sctp_do_8_2_transport_strike
    - tcp: fix tcp_ecn_withdraw_cwr() to clear TCP_ECN_QUEUE_CWR
    - tipc: add NULL pointer check before calling kfree_rcu
    - tun: fix use-after-free when register netdev failed
    - btrfs: compression: add helper for type to string conversion
    - btrfs: correctly validate compression type
    - Revert "MIPS: SiByte: Enable swiotlb for SWARM, LittleSur and BigSur"
    - gpiolib: acpi: Add gpiolib_acpi_run_edge_events_on_boot option and blacklist
    - gpio: fix line flag validation in linehandle_create
    - gpio: fix line flag validation in lineevent_create
    - Btrfs: fix assertion failure during fsync and use of stale transaction
    - genirq: Prevent NULL pointer dereference in resend_irqs()
    - KVM: s390: Do not leak kernel stack data in the KVM_S390_INTERRUPT ioctl
    - KVM: x86: work around leak of uninitialized stack contents
    - KVM: nVMX: handle page fault in vmread
    - MIPS: VDSO: Prevent use of smp_processor_id()
    - MIPS: VDSO: Use same -m%-float cflag as the kernel proper
    - powerpc: Add barrier_nospec to raw_copy_in_user()
    - drm/meson: Add support for XBGR8888 & ABGR8888 formats
    - clk: rockchip: Don't yell about bad mmc phases when getting
    - mtd: rawnand: mtk: Fix wrongly assigned OOB buffer pointer issue
    - PCI: Always allow probing with driver_override
    - ubifs: Cor...

Changed in linux (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (15.0 KiB)

This bug was fixed in the package linux - 4.4.0-166.195

---------------
linux (4.4.0-166.195) xenial; urgency=medium

  * xenial/linux: 4.4.0-166.195 -proposed tracker (LP: #1846069)

  * Packaging resync (LP: #1786013)
    - [Packaging] update helper scripts

  * CVE-2017-18232
    - scsi: libsas: direct call probe and destruct

  * CVE-2018-21008
    - rsi: add fix for crash during assertions

  * Xenial update: 4.4.194 upstream stable release (LP: #1845405)
    - bridge/mdb: remove wrong use of NLM_F_MULTI
    - cdc_ether: fix rndis support for Mediatek based smartphones
    - ipv6: Fix the link time qualifier of 'ping_v6_proc_exit_net()'
    - isdn/capi: check message length in capi_write()
    - net: Fix null de-reference of device refcount
    - sch_hhf: ensure quantum and hhf_non_hh_weight are non-zero
    - sctp: Fix the link time qualifier of 'sctp_ctrlsock_exit()'
    - sctp: use transport pf_retrans in sctp_do_8_2_transport_strike
    - tcp: fix tcp_ecn_withdraw_cwr() to clear TCP_ECN_QUEUE_CWR
    - tipc: add NULL pointer check before calling kfree_rcu
    - tun: fix use-after-free when register netdev failed
    - Revert "MIPS: SiByte: Enable swiotlb for SWARM, LittleSur and BigSur"
    - Btrfs: fix assertion failure during fsync and use of stale transaction
    - genirq: Prevent NULL pointer dereference in resend_irqs()
    - KVM: s390: Do not leak kernel stack data in the KVM_S390_INTERRUPT ioctl
    - KVM: x86: work around leak of uninitialized stack contents
    - KVM: nVMX: handle page fault in vmread
    - MIPS: VDSO: Prevent use of smp_processor_id()
    - MIPS: VDSO: Use same -m%-float cflag as the kernel proper
    - clk: rockchip: Don't yell about bad mmc phases when getting
    - driver core: Fix use-after-free and double free on glue directory
    - crypto: talitos - check AES key size
    - crypto: talitos - check data blocksize in ablkcipher.
    - x86/build: Add -Wnoaddress-of-packed-member to REALMODE_CFLAGS, to silence
      GCC9 build warning
    - MIPS: netlogic: xlr: Remove erroneous check in nlm_fmn_send()
    - ARC: configs: Remove CONFIG_INITRAMFS_SOURCE from defconfigs
    - USB: usbcore: Fix slab-out-of-bounds bug during device reset
    - media: tm6000: double free if usb disconnect while streaming
    - x86/boot: Add missing bootparam that breaks boot on some platforms
    - xen-netfront: do not assume sk_buff_head list is empty in error handling
    - serial: sprd: correct the wrong sequence of arguments
    - tty/serial: atmel: reschedule TX after RX was started
    - mwifiex: Fix three heap overflow at parsing element in cfg80211_ap_settings
    - s390/bpf: fix lcgr instruction encoding
    - ARM: OMAP2+: Fix omap4 errata warning on other SoCs
    - s390/bpf: use 32-bit index for tail calls
    - NFSv4: Fix return values for nfs4_file_open()
    - NFS: Fix initialisation of I/O result struct in nfs_pgio_rpcsetup
    - Kconfig: Fix the reference to the IDT77105 Phy driver in the description of
      ATM_NICSTAR_USE_IDT77105
    - ARM: 8874/1: mm: only adjust sections of valid mm structures
    - r8152: Set memory to all 0xFFs on failed reg reads
    - x86/apic: Fix arch_dynirq_lower_bound() bug for D...

Changed in linux (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (linux-bluefield/5.0.0-1003.12)

All autopkgtests for the newly accepted linux-bluefield (5.0.0-1003.12) for bionic have finished running.
The following regressions have been reported in tests triggered by the package:

fsprotect/unknown (armhf)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/bionic/update_excuses.html#linux-bluefield

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.