linux-stable/include/scsi
Damien Le Moal c031d9a838 scsi: sd: Introduce manage_shutdown device flag
commit 24eca2dce0 upstream.

Commit aa3998dbeb ("ata: libata-scsi: Disable scsi device
manage_system_start_stop") change setting the manage_system_start_stop
flag to false for libata managed disks to enable libata internal
management of disk suspend/resume. However, a side effect of this change
is that on system shutdown, disks are no longer being stopped (set to
standby mode with the heads unloaded). While this is not a critical
issue, this unclean shutdown is not recommended and shows up with
increased smart counters (e.g. the unexpected power loss counter
"Unexpect_Power_Loss_Ct").

Instead of defining a shutdown driver method for all ATA adapter
drivers (not all of them define that operation), this patch resolves
this issue by further refining the sd driver start/stop control of disks
using the new flag manage_shutdown. If this new flag is set to true by
a low level driver, the function sd_shutdown() will issue a
START STOP UNIT command with the start argument set to 0 when a disk
needs to be powered off (suspended) on system power off, that is, when
system_state is equal to SYSTEM_POWER_OFF.

Similarly to the other manage_xxx flags, the new manage_shutdown flag is
exposed through sysfs as a read-write device attribute.

To avoid any confusion between manage_shutdown and
manage_system_start_stop, the comments describing these flags in
include/scsi/scsi.h are also improved.

Fixes: aa3998dbeb ("ata: libata-scsi: Disable scsi device manage_system_start_stop")
Cc: stable@vger.kernel.org
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218038
Link: https://lore.kernel.org/all/cd397c88-bf53-4768-9ab8-9d107df9e613@gmail.com/
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-11-02 09:36:55 +01:00
..
fc scsi: libfc: Replace one-element arrays with flexible-array members 2022-02-27 21:17:37 -05:00
fc_frame.h
fcoe_sysfs.h
iscsi_if.h
iscsi_proto.h
iser.h
libfc.h scsi: core: Declare SCSI host template pointer members const 2023-03-24 19:19:19 -04:00
libfcoe.h driver core: bus: mark the struct bus_type for sysfs callbacks as constant 2023-03-23 13:20:40 +01:00
libiscsi.h scsi: iscsi: Declare SCSI host template const 2023-03-24 19:19:57 -04:00
libiscsi_tcp.h
libsas.h scsi: libsas: Change the coding style of sas_discover_sata() 2022-12-30 16:59:10 +00:00
sas.h scsi: libsas: Introduce struct smp_rps_resp 2022-06-10 13:08:06 -04:00
sas_ata.h scsi: libsas: Factor out sas_ata_add_dev() 2022-12-30 16:59:11 +00:00
scsi.h scsi: core: ata: Do no try to probe for CDL on old drives 2023-10-06 13:16:21 +02:00
scsi_bsg_iscsi.h
scsi_cmnd.h scsi: core: Allow libata to complete successful commands via EH 2023-05-22 17:05:18 -04:00
scsi_common.h scsi: Add support for block PR read keys/reservation 2023-04-11 21:55:35 -04:00
scsi_dbg.h
scsi_device.h scsi: sd: Introduce manage_shutdown device flag 2023-11-02 09:36:55 +01:00
scsi_devinfo.h scsi: core: Add BLIST_NO_VPD_SIZE for some VDASD 2023-03-09 20:57:58 -05:00
scsi_dh.h
scsi_driver.h scsi: don't use disk->private_data to find the scsi_driver 2022-03-08 19:40:00 -07:00
scsi_eh.h scsi: core: Remove the cmd field from struct scsi_request 2022-03-01 22:21:49 -05:00
scsi_host.h scsi: Do not attempt to rescan suspended devices 2023-10-10 22:02:54 +02:00
scsi_ioctl.h scsi: replace the fmode_t argument to scsi_ioctl with a simple bool 2023-06-12 08:04:04 -06:00
scsi_proto.h scsi: Add support for block PR read keys/reservation 2023-04-11 21:55:35 -04:00
scsi_status.h scsi: core: Remove useless host error codes 2022-09-06 22:05:59 -04:00
scsi_tcq.h
scsi_transport.h
scsi_transport_fc.h scsi: scsi_transport_fc: Add an additional flag to fc_host_fpin_rcv() 2023-02-21 18:03:29 -05:00
scsi_transport_iscsi.h scsi: iscsi: Fix multiple iSCSI session unbind events sent to userspace 2022-12-14 02:49:19 +00:00
scsi_transport_sas.h scsi: scsi_transport_sas: Add 22.5 Gbps link rate definitions 2021-10-19 14:07:19 -04:00
scsi_transport_spi.h
scsi_transport_srp.h scsi: core: Change the return type of .eh_timed_out() 2022-10-22 03:25:59 +00:00
scsicam.h
sg.h scsi: core: Rename status_byte to sg_status_byte 2022-12-01 03:22:23 +00:00
srp.h
viosrp.h scsi: ibmvscsis: Silence -Warray-bounds warning 2022-02-11 16:42:22 -05:00