scsi: core: Allow enabling and disabling command duration limits
Add the sysfs scsi_device attribute cdl_enable to allow a user to enable or disable a device command duration limits feature. CDL is disabled by default. This feature must be explicitly enabled by a user by setting the cdl_enable attribute to 1. The new function scsi_cdl_enable() does not do anything beside setting the cdl_enable field of struct scsi_device in the case of a (real) SCSI device (e.g. a SAS HDD). For ATA devices, the command duration limits feature needs to be enabled/disabled using the ATA feature sub-page of the control mode page. To do so, the scsi_cdl_enable() function checks if this mode page is supported using scsi_mode_sense(). If it is, scsi_mode_select() is used to enable and disable CDL. Signed-off-by:Damien Le Moal <dlemoal@kernel.org> Reviewed-by:
Hannes Reinecke <hare@suse.de> Co-developed-by:
Niklas Cassel <niklas.cassel@wdc.com> Signed-off-by:
Niklas Cassel <niklas.cassel@wdc.com> Link: https://lore.kernel.org/r/20230511011356.227789-10-nks@flawful.org Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
Showing
- Documentation/ABI/testing/sysfs-block-device 13 additions, 0 deletionsDocumentation/ABI/testing/sysfs-block-device
- drivers/scsi/scsi.c 62 additions, 0 deletionsdrivers/scsi/scsi.c
- drivers/scsi/scsi_sysfs.c 28 additions, 0 deletionsdrivers/scsi/scsi_sysfs.c
- include/scsi/scsi_device.h 2 additions, 0 deletionsinclude/scsi/scsi_device.h
Please register or sign in to comment