Files
linux-stable-mirror/drivers/scsi
Salomon Dushimirimana 74b3fedc57 scsi: sd: Make sd shutdown issue START STOP UNIT appropriately
[ Upstream commit 8e48727c26 ]

Commit aa3998dbeb ("ata: libata-scsi: Disable scsi device
manage_system_start_stop") enabled libata EH to manage device power mode
trasitions for system suspend/resume and removed the flag from
ata_scsi_dev_config. However, since the sd_shutdown() function still
relies on the manage_system_start_stop flag, a spin-down command is not
issued to the disk with command "echo 1 > /sys/block/sdb/device/delete"

sd_shutdown() can be called for both system/runtime start stop
operations, so utilize the manage_run_time_start_stop flag set in the
ata_scsi_dev_config and issue a spin-down command during disk removal
when the system is running. This is in addition to when the system is
powering off and manage_shutdown flag is set. The
manage_system_start_stop flag will still be used for drivers that still
set the flag.

Fixes: aa3998dbeb ("ata: libata-scsi: Disable scsi device manage_system_start_stop")
Signed-off-by: Salomon Dushimirimana <salomondush@google.com>
Link: https://lore.kernel.org/r/20250724214520.112927-1-salomondush@google.com
Tested-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-08-15 12:14:03 +02:00
..
2025-06-27 11:11:32 +01:00
2024-03-10 18:15:48 -04:00
2024-08-12 22:05:50 -04:00
2024-08-12 22:05:50 -04:00
2025-05-02 07:59:09 +02:00
2024-06-20 15:19:17 -06:00
2024-10-02 17:23:23 -04:00