summaryrefslogtreecommitdiff
path: root/drivers/scsi/libsas/sas_scsi_host.c
diff options
context:
space:
mode:
authorJohn Garry <john.garry@huawei.com>2022-02-22 20:50:59 +0800
committerMartin K. Petersen <martin.petersen@oracle.com>2022-02-22 21:11:02 -0500
commit3f2e252ef727318f81588704461735617ad55b88 (patch)
tree3d7ddb6d091a935e6455252ef5273589fd378b85 /drivers/scsi/libsas/sas_scsi_host.c
parent4fea759edfa795b170a72bfd3be7b7601012ce4b (diff)
scsi: libsas: Add sas_execute_ata_cmd()
Add a function to execute an ATA command using the TMF code, and use in the hisi_sas driver. That driver needs to be able to issue the command on a specific phy, so add an interface for that. With that, hisi_sas_exec_internal_tmf_task() may be deleted. Link: https://lore.kernel.org/r/1645534259-27068-19-git-send-email-john.garry@huawei.com Tested-by: Yihang Li <liyihang6@hisilicon.com> Tested-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/libsas/sas_scsi_host.c')
-rw-r--r--drivers/scsi/libsas/sas_scsi_host.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c
index 87dd18a85f6f..5b5747e33dbd 100644
--- a/drivers/scsi/libsas/sas_scsi_host.c
+++ b/drivers/scsi/libsas/sas_scsi_host.c
@@ -937,8 +937,16 @@ int sas_execute_tmf(struct domain_device *device, void *parameter,
task->dev = device;
task->task_proto = device->tproto;
- if (!dev_is_sata(device))
+ if (dev_is_sata(device)) {
+ task->ata_task.device_control_reg_update = 1;
+ if (force_phy_id >= 0) {
+ task->ata_task.force_phy = true;
+ task->ata_task.force_phy_id = force_phy_id;
+ }
+ memcpy(&task->ata_task.fis, parameter, para_len);
+ } else {
memcpy(&task->ssp_task, parameter, para_len);
+ }
task->task_done = sas_task_internal_done;
task->tmf = tmf;