summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hisi_sas
diff options
context:
space:
mode:
authorJohn Garry <john.garry@huawei.com>2022-02-17 23:42:36 +0800
committerMartin K. Petersen <martin.petersen@oracle.com>2022-02-19 15:59:35 -0500
commit96e54376a8b27066d32ca36800318c43e6b6d2c5 (patch)
tree5278430f91a852d1e88452ca3e5171accae4e587 /drivers/scsi/hisi_sas
parentbbfe82cdbaf84e6622ceb6f3447c8c4bb7dde7ab (diff)
downloadlinux-96e54376a8b27066d32ca36800318c43e6b6d2c5.tar.bz2
scsi: libsas: Add sas_task.tmf
Add a pointer to a sas_tmf_task to the sas_task struct, as this will be used when the common LLDD TMF code is factored out. Also set it for the LLDDs to store per-sas_task TMF info. Link: https://lore.kernel.org/r/1645112566-115804-9-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/hisi_sas')
-rw-r--r--drivers/scsi/hisi_sas/hisi_sas_main.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index 88e641143b82..bd40323f7053 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -463,8 +463,7 @@ void hisi_sas_task_deliver(struct hisi_hba *hisi_hba,
spin_unlock(&dq->lock);
}
-static int hisi_sas_task_exec(struct sas_task *task, gfp_t gfp_flags,
- struct sas_tmf_task *tmf)
+static int hisi_sas_queue_command(struct sas_task *task, gfp_t gfp_flags)
{
int n_elem = 0, n_elem_dif = 0, n_elem_req = 0;
struct domain_device *device = task->dev;
@@ -575,8 +574,8 @@ static int hisi_sas_task_exec(struct sas_task *task, gfp_t gfp_flags,
slot->task = task;
slot->port = port;
- slot->tmf = tmf;
- slot->is_internal = tmf;
+ slot->tmf = task->tmf;
+ slot->is_internal = task->tmf;
/* protect task_prep and start_delivery sequence */
hisi_sas_task_deliver(hisi_hba, slot, dq, sas_dev, NULL);
@@ -1106,11 +1105,6 @@ static void hisi_sas_dev_gone(struct domain_device *device)
up(&hisi_hba->sem);
}
-static int hisi_sas_queue_command(struct sas_task *task, gfp_t gfp_flags)
-{
- return hisi_sas_task_exec(task, gfp_flags, NULL);
-}
-
static int hisi_sas_phy_set_linkrate(struct hisi_hba *hisi_hba, int phy_no,
struct sas_phy_linkrates *r)
{
@@ -1264,7 +1258,9 @@ static int hisi_sas_exec_internal_tmf_task(struct domain_device *device,
task->slow_task->timer.expires = jiffies + TASK_TIMEOUT;
add_timer(&task->slow_task->timer);
- res = hisi_sas_task_exec(task, GFP_KERNEL, tmf);
+ task->tmf = tmf;
+
+ res = hisi_sas_queue_command(task, GFP_KERNEL);
if (res) {
del_timer_sync(&task->slow_task->timer);
dev_err(dev, "abort tmf: executing internal task failed: %d\n",