]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
scsi: core: Introduce the BLIST_SKIP_IO_HINTS flag
authorBart Van Assche <bvanassche@acm.org>
Thu, 13 Jun 2024 21:18:26 +0000 (14:18 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 14 Jun 2024 01:03:13 +0000 (21:03 -0400)
Prepare for skipping the IO Advice Hints Grouping mode page for USB storage
devices.

Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Joao Machado <jocrismachado@gmail.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Christian Heusel <christian@heusel.eu>
Cc: stable@vger.kernel.org
Fixes: 4f53138fffc2 ("scsi: sd: Translate data lifetime information")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20240613211828.2077477-2-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/sd.c
include/scsi/scsi_devinfo.h

index fbc11046bbf601a497f7633b8a136c25aded7370..fe82baa924f81b8ab04e7027119e8a8b2fbff106 100644 (file)
@@ -63,6 +63,7 @@
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_dbg.h>
 #include <scsi/scsi_device.h>
+#include <scsi/scsi_devinfo.h>
 #include <scsi/scsi_driver.h>
 #include <scsi/scsi_eh.h>
 #include <scsi/scsi_host.h>
@@ -3118,6 +3119,9 @@ static void sd_read_io_hints(struct scsi_disk *sdkp, unsigned char *buffer)
        struct scsi_mode_data data;
        int res;
 
+       if (sdp->sdev_bflags & BLIST_SKIP_IO_HINTS)
+               return;
+
        res = scsi_mode_sense(sdp, /*dbd=*/0x8, /*modepage=*/0x0a,
                              /*subpage=*/0x05, buffer, SD_BUF_SIZE, SD_TIMEOUT,
                              sdkp->max_retries, &data, &sshdr);
index 6b548dc2c49654c95aa9e213692e2931395701e6..1d79a3b536ceedb26f0d13c796ed367aeda8e842 100644 (file)
 #define BLIST_RETRY_ITF                ((__force blist_flags_t)(1ULL << 32))
 /* Always retry ABORTED_COMMAND with ASC 0xc1 */
 #define BLIST_RETRY_ASC_C1     ((__force blist_flags_t)(1ULL << 33))
+/* Do not query the IO Advice Hints Grouping mode page */
+#define BLIST_SKIP_IO_HINTS    ((__force blist_flags_t)(1ULL << 34))
 
-#define __BLIST_LAST_USED BLIST_RETRY_ASC_C1
+#define __BLIST_LAST_USED BLIST_SKIP_IO_HINTS
 
 #define __BLIST_HIGH_UNUSED (~(__BLIST_LAST_USED | \
                               (__force blist_flags_t) \