ata: libata-scsi: Cleanup ata_scsi_start_stop_xlat()
authorDamien Le Moal <dlemoal@kernel.org>
Tue, 29 Aug 2023 01:18:34 +0000 (10:18 +0900)
committerDamien Le Moal <dlemoal@kernel.org>
Tue, 3 Oct 2023 00:39:49 +0000 (09:39 +0900)
commit8c1f08170694f50216f0e336ccfc589d3430a339
tree5d98441cc3d415ed861d495300093ef8e917a686
parentc4367ac83805a2322268c9736cd8ef9124063424
ata: libata-scsi: Cleanup ata_scsi_start_stop_xlat()

Now that libata does its own internal device power mode management
through libata EH, the scsi disk driver will not issue START STOP UNIT
commands anymore. We can receive this command only from user passthrough
operations. So there is no need to consider the system state and ATA
port flags for suspend to translate the command.

Since setting up the taskfile for the verify and standby
immediate commands is the same as done in ata_dev_power_set_active()
and ata_dev_power_set_standby(), factor out this code into the helper
function ata_dev_power_init_tf() to simplify ata_scsi_start_stop_xlat()
as well as ata_dev_power_set_active() and ata_dev_power_set_standby().

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Tested-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ata/libata-core.c
drivers/ata/libata-scsi.c
drivers/ata/libata.h