public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb-storage: apply IGNORE_UAS for Realtek on RTL9210
@ 2025-03-26  2:20 Jie Deng
  2025-03-26  7:23 ` Michał Pecio
  2025-04-11 13:47 ` Greg KH
  0 siblings, 2 replies; 3+ messages in thread
From: Jie Deng @ 2025-03-26  2:20 UTC (permalink / raw)
  To: stern, gregkh; +Cc: linux-usb, usb-storage, linux-kernel, xiehongyu1, Jie Deng

The UAS mode of Realtek USB_HDD is reported
to fail to work on several platforms with
the following error message, then after
re-connecting the device will be offlined
and not working at all.

[  143.361210] sd 9:0:0:0: [sdg]
tag#6 uas_eh_abort_handler 0 uas-tag 2 inflight: CMD IN
[  143.372377] sd 9:0:0:0: [sdg]
tag#6 CDB: Read(10) 28 00 00 00 00 10 00 00 10 00
[  143.382908] sd 9:0:0:0: [sdg]
tag#5 uas_eh_abort_handler 0 uas-tag 1 inflight: CMD IN
[  143.394080] sd 9:0:0:0: [sdg]
tag#5 CDB: Read(10) 28 00 00 00 00 00 00 00 10 00
[  143.404610] sd 9:0:0:0: [sdg]
tag#4 uas_eh_abort_handler 0 uas-tag 4 inflight: CMD IN
[  143.415782] sd 9:0:0:0: [sdg]
tag#4 CDB: Read(10) 28 00 00 00 00 30 00 00 10 00
[  148.437916][ 22] xhci_hcd 0000:ba:02.0:
xHCI host not responding to stop endpoint command.
[  148.462295][ 22] xhci_hcd 0000:ba:02.0:
xHCI host controller not responding, assume dead

The Realtek Manufacturer's device cannot
initialize properly using the UAS driver,
so we need to switch it to usb-storage

Signed-off-by: Jie Deng <dengjie03@kylinos.cn>
---
 drivers/usb/storage/uas-detect.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/storage/uas-detect.h b/drivers/usb/storage/uas-detect.h
index 4d3b49e5b87a..23579a2a1181 100644
--- a/drivers/usb/storage/uas-detect.h
+++ b/drivers/usb/storage/uas-detect.h
@@ -125,8 +125,11 @@ static int uas_use_uas_driver(struct usb_interface *intf,
 	 */
 	if (le16_to_cpu(udev->descriptor.idVendor) == 0x0bda &&
 			le16_to_cpu(udev->descriptor.idProduct) == 0x9210 &&
-			(udev->manufacturer && !strcmp(udev->manufacturer, "HIKSEMI")) &&
-			(udev->product && !strcmp(udev->product, "MD202")))
+			(((udev->manufacturer && !strcmp(udev->manufacturer, "HIKSEMI")) &&
+			(udev->product && !strcmp(udev->product, "MD202"))) ||
+			((udev->manufacturer && !strcmp(udev->manufacturer, "Realtek")) &&
+			(udev->product && !strcmp(udev->product, "RTL9210")))
+			))
 		flags |= US_FL_IGNORE_UAS;
 
 	usb_stor_adjust_quirks(udev, &flags);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb-storage: apply IGNORE_UAS for Realtek on RTL9210
  2025-03-26  2:20 [PATCH] usb-storage: apply IGNORE_UAS for Realtek on RTL9210 Jie Deng
@ 2025-03-26  7:23 ` Michał Pecio
  2025-04-11 13:47 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Michał Pecio @ 2025-03-26  7:23 UTC (permalink / raw)
  To: dengjie03; +Cc: gregkh, linux-kernel, linux-usb, stern, usb-storage, xiehongyu1

> The UAS mode of Realtek USB_HDD is reported
> to fail to work on several platforms with
> the following error message,

Possibly related?
https://github.com/raspberrypi/linux/commit/9d3afd87557637a37135aa6e370dea846b839c2d

An RTL9210 hardware bug with a simple driver workaround, solved
by RPi but never submitted upstream. I guess you could try it.

> [  148.437916][ 22] xhci_hcd 0000:ba:02.0: xHCI host not responding to stop endpoint command.
> [  148.462295][ 22] xhci_hcd 0000:ba:02.0: xHCI host controller not responding, assume dead

That's your host controller crashing, maybe a device bug confused it.
It may be the reason why storage drivers never recover from the error.

Out of curiosity, which HC is doing this?

> then after
> re-connecting the device will be offlined
> and not working at all.

Nothing can possibly work after the above, until xhci_hcd is reloaded.

Regards,
Michal

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb-storage: apply IGNORE_UAS for Realtek on RTL9210
  2025-03-26  2:20 [PATCH] usb-storage: apply IGNORE_UAS for Realtek on RTL9210 Jie Deng
  2025-03-26  7:23 ` Michał Pecio
@ 2025-04-11 13:47 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2025-04-11 13:47 UTC (permalink / raw)
  To: Jie Deng; +Cc: stern, linux-usb, usb-storage, linux-kernel, xiehongyu1

On Wed, Mar 26, 2025 at 10:20:19AM +0800, Jie Deng wrote:
> The UAS mode of Realtek USB_HDD is reported
> to fail to work on several platforms with
> the following error message, then after
> re-connecting the device will be offlined
> and not working at all.
> 
> [  143.361210] sd 9:0:0:0: [sdg]
> tag#6 uas_eh_abort_handler 0 uas-tag 2 inflight: CMD IN
> [  143.372377] sd 9:0:0:0: [sdg]
> tag#6 CDB: Read(10) 28 00 00 00 00 10 00 00 10 00
> [  143.382908] sd 9:0:0:0: [sdg]
> tag#5 uas_eh_abort_handler 0 uas-tag 1 inflight: CMD IN
> [  143.394080] sd 9:0:0:0: [sdg]
> tag#5 CDB: Read(10) 28 00 00 00 00 00 00 00 10 00
> [  143.404610] sd 9:0:0:0: [sdg]
> tag#4 uas_eh_abort_handler 0 uas-tag 4 inflight: CMD IN
> [  143.415782] sd 9:0:0:0: [sdg]
> tag#4 CDB: Read(10) 28 00 00 00 00 30 00 00 10 00
> [  148.437916][ 22] xhci_hcd 0000:ba:02.0:
> xHCI host not responding to stop endpoint command.
> [  148.462295][ 22] xhci_hcd 0000:ba:02.0:
> xHCI host controller not responding, assume dead

Please don't wrap error message lines.

> The Realtek Manufacturer's device cannot
> initialize properly using the UAS driver,
> so we need to switch it to usb-storage

Are you sure this now works?  Also wrap your changelog at 72 columns
please.

> 
> Signed-off-by: Jie Deng <dengjie03@kylinos.cn>
> ---
>  drivers/usb/storage/uas-detect.h | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/storage/uas-detect.h b/drivers/usb/storage/uas-detect.h
> index 4d3b49e5b87a..23579a2a1181 100644
> --- a/drivers/usb/storage/uas-detect.h
> +++ b/drivers/usb/storage/uas-detect.h
> @@ -125,8 +125,11 @@ static int uas_use_uas_driver(struct usb_interface *intf,
>  	 */
>  	if (le16_to_cpu(udev->descriptor.idVendor) == 0x0bda &&
>  			le16_to_cpu(udev->descriptor.idProduct) == 0x9210 &&
> -			(udev->manufacturer && !strcmp(udev->manufacturer, "HIKSEMI")) &&
> -			(udev->product && !strcmp(udev->product, "MD202")))
> +			(((udev->manufacturer && !strcmp(udev->manufacturer, "HIKSEMI")) &&
> +			(udev->product && !strcmp(udev->product, "MD202"))) ||
> +			((udev->manufacturer && !strcmp(udev->manufacturer, "Realtek")) &&
> +			(udev->product && !strcmp(udev->product, "RTL9210")))

So all products with that string are bad?  Why not use the product id
instead?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-04-11 13:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-26  2:20 [PATCH] usb-storage: apply IGNORE_UAS for Realtek on RTL9210 Jie Deng
2025-03-26  7:23 ` Michał Pecio
2025-04-11 13:47 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox