From a69578350c13d3711615fbf0ab880ee4e8c811dc Mon Sep 17 00:00:00 2001 From: William Wu Date: Fri, 7 Sep 2018 09:52:10 +0800 Subject: [PATCH] usb: storage: add Genesys Logic 05e3:0749 to unusual_devs.h When test more than three Genesys Logic usb3 storages (VID : PID = 0x05e3 : 0x0749) on rockchip platforms with usb3 host port (e.g. rk3328/rk3399) at the same time, test commands like this: for dev in `ls /dev/sd?1 | sed -e 's,1$,,'`; do echo dd if=$dev of=/dev/null dd if=$dev of=/dev/null & sleep 1 done The test fail with the following error log: xhci-hcd xhci-hcd.9.auto: xHCI host not responding to stop endpoint command. xhci-hcd xhci-hcd.9.auto: Assuming host is dying, halting host. xhci-hcd xhci-hcd.9.auto: Host not halted after 16000 microseconds. xhci-hcd xhci-hcd.9.auto: Non-responsive xHCI host is not halting. xhci-hcd xhci-hcd.9.auto: Completing active URBs anyway. xhci-hcd xhci-hcd.9.auto: HC died; cleaning up This patch sets the max_sectors to 128 (64K) to workaround this issue, and it doesn't affect the transmission rate. Change-Id: Idd9cc81659d27c12b142f6c4375558c2262e800d Signed-off-by: William Wu --- drivers/usb/storage/scsiglue.c | 4 ++++ drivers/usb/storage/unusual_devs.h | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index 59d82b45e758..d571ce851432 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c @@ -108,6 +108,10 @@ static int slave_configure(struct scsi_device *sdev) if (us->fflags & (US_FL_MAX_SECTORS_64 | US_FL_MAX_SECTORS_MIN)) { unsigned int max_sectors = 64; + if (le16_to_cpu(us->pusb_dev->descriptor.idVendor) == 0x05e3 && + le16_to_cpu(us->pusb_dev->descriptor.idProduct) == 0x0749) + max_sectors = 128; + if (us->fflags & US_FL_MAX_SECTORS_MIN) max_sectors = PAGE_SIZE >> 9; if (queue_max_hw_sectors(sdev->request_queue) > max_sectors) diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index 1cd9b6305b06..3a2a15c5f139 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h @@ -910,6 +910,12 @@ UNUSUAL_DEV( 0x05e3, 0x0723, 0x9451, 0x9451, USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_SANE_SENSE ), +UNUSUAL_DEV( 0x05e3, 0x0749, 0x0000, 0xffff, + "Genesys Logic", + "USB Storage", + USB_SC_DEVICE, USB_PR_DEVICE, NULL, + US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 | US_FL_IGNORE_RESIDUE ), + /* * Reported by Hanno Boeck * Taken from the Lycoris Kernel