Skip to content
Commit ed4246d3 authored by Martin Kepplinger's avatar Martin Kepplinger Committed by Martin K. Petersen
Browse files

scsi: sd: REQUEST SENSE for BLIST_IGN_MEDIA_CHANGE devices in runtime_resume()

For SD card reader devices that have the BLIST_IGN_MEDIA_CHANGE flag
set, a MEDIUM MAY HAVE CHANGED unit attention is established after
resuming from runtime suspend. Send a REQUEST SENSE to consume the UA.

The "downside" is that for these devices we now rely on users to not
change the medium (SD card) *during* a runtime suspend/resume cycle,
i.e. when not unmounting.

To enable runtime PM for an SD cardreader (device number 0:0:0:0), do:

echo 0 > /sys/module/block/parameters/events_dfl_poll_msecs
echo 1000 > /sys/bus/scsi/devices/0:0:0:0/power/autosuspend_delay_ms
echo auto > /sys/bus/scsi/devices/0:0:0:0/power/control

[mkp: use scsi_device flag instead of poking at BLIST]

Link: https://lore.kernel.org/r/20210704075403.147114-3-martin.kepplinger@puri.sm


Reviewed-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin Kepplinger <martin.kepplinger@puri.sm>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent f591a2e0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment