Skip to content

Commit 633aeef

Browse files
bvanasschemartinkpetersen
authored andcommitted
scsi: core: Introduce the BLIST_SKIP_IO_HINTS flag
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: 4f53138 ("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>
1 parent 135c6eb commit 633aeef

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

drivers/scsi/sd.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
#include <scsi/scsi_cmnd.h>
6464
#include <scsi/scsi_dbg.h>
6565
#include <scsi/scsi_device.h>
66+
#include <scsi/scsi_devinfo.h>
6667
#include <scsi/scsi_driver.h>
6768
#include <scsi/scsi_eh.h>
6869
#include <scsi/scsi_host.h>
@@ -3118,6 +3119,9 @@ static void sd_read_io_hints(struct scsi_disk *sdkp, unsigned char *buffer)
31183119
struct scsi_mode_data data;
31193120
int res;
31203121

3122+
if (sdp->sdev_bflags & BLIST_SKIP_IO_HINTS)
3123+
return;
3124+
31213125
res = scsi_mode_sense(sdp, /*dbd=*/0x8, /*modepage=*/0x0a,
31223126
/*subpage=*/0x05, buffer, SD_BUF_SIZE, SD_TIMEOUT,
31233127
sdkp->max_retries, &data, &sshdr);

include/scsi/scsi_devinfo.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@
6969
#define BLIST_RETRY_ITF ((__force blist_flags_t)(1ULL << 32))
7070
/* Always retry ABORTED_COMMAND with ASC 0xc1 */
7171
#define BLIST_RETRY_ASC_C1 ((__force blist_flags_t)(1ULL << 33))
72+
/* Do not query the IO Advice Hints Grouping mode page */
73+
#define BLIST_SKIP_IO_HINTS ((__force blist_flags_t)(1ULL << 34))
7274

73-
#define __BLIST_LAST_USED BLIST_RETRY_ASC_C1
75+
#define __BLIST_LAST_USED BLIST_SKIP_IO_HINTS
7476

7577
#define __BLIST_HIGH_UNUSED (~(__BLIST_LAST_USED | \
7678
(__force blist_flags_t) \

0 commit comments

Comments
 (0)