diff options
author | Martin Kepplinger <martin.kepplinger@puri.sm> | 2021-07-04 09:54:01 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-07-21 23:43:48 -0400 |
commit | f591a2e0548da88130c7b1c79f1f735273adc683 (patch) | |
tree | 2c63603723f88b1918ff6fe6ef8a89832464612c /drivers/scsi/scsi_scan.c | |
parent | e15f669cd996b85bb07b0e787fa78806477bf211 (diff) | |
download | lwn-f591a2e0548da88130c7b1c79f1f735273adc683.tar.gz lwn-f591a2e0548da88130c7b1c79f1f735273adc683.zip |
scsi: core: Add new flag BLIST_IGN_MEDIA_CHANGE
Add a new flag for devices that erroneously establish MEDIUM MAY HAVE
CHANGED unit attentions. Drivers can set this flag to make the SCSI
layer ignore media change events during resume.
[mkp: add "ignore" and add corresponding flag to struct scsi_device]
Link: https://lore.kernel.org/r/20210704075403.147114-2-martin.kepplinger@puri.sm
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/scsi_scan.c')
-rw-r--r-- | drivers/scsi/scsi_scan.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index b059bf2b61d4..3faedf4970ec 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -973,6 +973,9 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result, if (*bflags & BLIST_UNMAP_LIMIT_WS) sdev->unmap_limit_for_ws = 1; + if (*bflags & BLIST_IGN_MEDIA_CHANGE) + sdev->ignore_media_change = 1; + sdev->eh_timeout = SCSI_DEFAULT_EH_TIMEOUT; if (*bflags & BLIST_TRY_VPD_PAGES) |