Skip to content

Commit 61749c4

Browse files
author
Ming Lei
committed
scsi: usb: uas: Do not query the IO Advice Hints Grouping mode page for USB/UAS devices
JIRA: https://issues.redhat.com/browse/RHEL-79409 commit 57619f3 Author: Bart Van Assche <bvanassche@acm.org> Date: Thu Jun 13 14:18:27 2024 -0700 scsi: usb: uas: Do not query the IO Advice Hints Grouping mode page for USB/UAS devices Recently it was reported that the following USB storage devices are unusable with Linux kernel 6.9: * Kingston DataTraveler G2 * Garmin FR35 This is because attempting to read the IO Advice Hints Grouping mode page causes these devices to reset. Hence do not read the IO Advice Hints Grouping mode page from USB/UAS storage devices. Acked-by: Alan Stern <stern@rowland.harvard.edu> Cc: stable@vger.kernel.org Fixes: 4f53138 ("scsi: sd: Translate data lifetime information") Reported-by: Joao Machado <jocrismachado@gmail.com> Closes: https://lore.kernel.org/linux-scsi/20240130214911.1863909-1-bvanassche@acm.org/T/#mf4e3410d8f210454d7e4c3d1fb5c0f41e651b85f Tested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Bisected-by: Christian Heusel <christian@heusel.eu> Reported-by: Andy Shevchenko <andy.shevchenko@gmail.com> Closes: https://lore.kernel.org/linux-scsi/CACLx9VdpUanftfPo2jVAqXdcWe8Y43MsDeZmMPooTzVaVJAh2w@mail.gmail.com/ Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20240613211828.2077477-3-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Ming Lei <ming.lei@redhat.com>
1 parent db544ee commit 61749c4

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

drivers/usb/storage/scsiglue.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ static int slave_alloc (struct scsi_device *sdev)
7979
if (us->protocol == USB_PR_BULK && us->max_lun > 0)
8080
sdev->sdev_bflags |= BLIST_FORCELUN;
8181

82+
/*
83+
* Some USB storage devices reset if the IO advice hints grouping mode
84+
* page is queried. Hence skip that mode page.
85+
*/
86+
sdev->sdev_bflags |= BLIST_SKIP_IO_HINTS;
87+
8288
return 0;
8389
}
8490

drivers/usb/storage/uas.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <scsi/scsi.h>
2222
#include <scsi/scsi_eh.h>
2323
#include <scsi/scsi_dbg.h>
24+
#include <scsi/scsi_devinfo.h>
2425
#include <scsi/scsi_cmnd.h>
2526
#include <scsi/scsi_device.h>
2627
#include <scsi/scsi_host.h>
@@ -822,6 +823,12 @@ static int uas_slave_alloc(struct scsi_device *sdev)
822823
struct uas_dev_info *devinfo =
823824
(struct uas_dev_info *)sdev->host->hostdata;
824825

826+
/*
827+
* Some USB storage devices reset if the IO advice hints grouping mode
828+
* page is queried. Hence skip that mode page.
829+
*/
830+
sdev->sdev_bflags |= BLIST_SKIP_IO_HINTS;
831+
825832
sdev->hostdata = devinfo;
826833
return 0;
827834
}

0 commit comments

Comments
 (0)