Commit 69b80a0e authored by John Garry's avatar John Garry Committed by Martin K. Petersen

scsi: libsas: Add sas_abort_task_set()

Add a generic implementation of abort task set TMF handler, and use in
LLDDs.

Link: https://lore.kernel.org/r/1645112566-115804-14-git-send-email-john.garry@huawei.comTested-by: default avatarYihang Li <liyihang6@hisilicon.com>
Tested-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 693e66a0
......@@ -1788,7 +1788,6 @@ static int hisi_sas_abort_task_set(struct domain_device *device, u8 *lun)
{
struct hisi_hba *hisi_hba = dev_to_hisi_hba(device);
struct device *dev = hisi_hba->dev;
struct sas_tmf_task tmf_task;
int rc;
rc = hisi_sas_internal_task_abort(hisi_hba, device,
......@@ -1799,9 +1798,7 @@ static int hisi_sas_abort_task_set(struct domain_device *device, u8 *lun)
}
hisi_sas_dereg_device(hisi_hba, device);
tmf_task.tmf = TMF_ABORT_TASK_SET;
rc = hisi_sas_debug_issue_ssp_tmf(device, lun, &tmf_task);
rc = sas_abort_task_set(device, lun);
if (rc == TMF_RESP_FUNC_COMPLETE)
hisi_sas_release_task(hisi_hba, device);
......
......@@ -1030,10 +1030,8 @@ int sas_execute_tmf(struct domain_device *device, void *parameter,
return res;
}
int sas_execute_ssp_tmf(struct domain_device *device, u8 *lun,
struct sas_tmf_task *tmf);
int sas_execute_ssp_tmf(struct domain_device *device, u8 *lun,
struct sas_tmf_task *tmf)
static int sas_execute_ssp_tmf(struct domain_device *device, u8 *lun,
struct sas_tmf_task *tmf)
{
struct sas_ssp_task ssp_task;
......@@ -1045,6 +1043,16 @@ int sas_execute_ssp_tmf(struct domain_device *device, u8 *lun,
return sas_execute_tmf(device, &ssp_task, sizeof(ssp_task), -1, tmf);
}
int sas_abort_task_set(struct domain_device *dev, u8 *lun)
{
struct sas_tmf_task tmf_task = {
.tmf = TMF_ABORT_TASK_SET,
};
return sas_execute_ssp_tmf(dev, lun, &tmf_task);
}
EXPORT_SYMBOL_GPL(sas_abort_task_set);
/*
* Tell an upper layer that it needs to initiate an abort for a given task.
* This should only ever be called by an LLDD.
......
......@@ -63,7 +63,7 @@ static struct sas_domain_function_template mvs_transport_ops = {
.lldd_control_phy = mvs_phy_control,
.lldd_abort_task = mvs_abort_task,
.lldd_abort_task_set = mvs_abort_task_set,
.lldd_abort_task_set = sas_abort_task_set,
.lldd_clear_task_set = mvs_clear_task_set,
.lldd_I_T_nexus_reset = mvs_I_T_nexus_reset,
.lldd_lu_reset = mvs_lu_reset,
......
......@@ -1536,17 +1536,6 @@ int mvs_abort_task(struct sas_task *task)
return rc;
}
int mvs_abort_task_set(struct domain_device *dev, u8 *lun)
{
int rc;
struct sas_tmf_task tmf_task;
tmf_task.tmf = TMF_ABORT_TASK_SET;
rc = mvs_debug_issue_ssp_tmf(dev, lun, &tmf_task);
return rc;
}
int mvs_clear_task_set(struct domain_device *dev, u8 *lun)
{
int rc = TMF_RESP_FUNC_FAILED;
......
......@@ -440,7 +440,6 @@ void mvs_scan_start(struct Scsi_Host *shost);
int mvs_scan_finished(struct Scsi_Host *shost, unsigned long time);
int mvs_queue_command(struct sas_task *task, gfp_t gfp_flags);
int mvs_abort_task(struct sas_task *task);
int mvs_abort_task_set(struct domain_device *dev, u8 *lun);
int mvs_clear_task_set(struct domain_device *dev, u8 * lun);
void mvs_port_formed(struct asd_sas_phy *sas_phy);
void mvs_port_deformed(struct asd_sas_phy *sas_phy);
......
......@@ -122,7 +122,7 @@ static struct sas_domain_function_template pm8001_transport_ops = {
.lldd_control_phy = pm8001_phy_control,
.lldd_abort_task = pm8001_abort_task,
.lldd_abort_task_set = pm8001_abort_task_set,
.lldd_abort_task_set = sas_abort_task_set,
.lldd_clear_task_set = pm8001_clear_task_set,
.lldd_I_T_nexus_reset = pm8001_I_T_nexus_reset,
.lldd_lu_reset = pm8001_lu_reset,
......
......@@ -1342,14 +1342,6 @@ int pm8001_abort_task(struct sas_task *task)
return rc;
}
int pm8001_abort_task_set(struct domain_device *dev, u8 *lun)
{
struct sas_tmf_task tmf_task;
tmf_task.tmf = TMF_ABORT_TASK_SET;
return pm8001_issue_ssp_tmf(dev, lun, &tmf_task);
}
int pm8001_clear_task_set(struct domain_device *dev, u8 *lun)
{
struct sas_tmf_task tmf_task;
......
......@@ -644,7 +644,6 @@ void pm8001_scan_start(struct Scsi_Host *shost);
int pm8001_scan_finished(struct Scsi_Host *shost, unsigned long time);
int pm8001_queue_command(struct sas_task *task, gfp_t gfp_flags);
int pm8001_abort_task(struct sas_task *task);
int pm8001_abort_task_set(struct domain_device *dev, u8 *lun);
int pm8001_clear_task_set(struct domain_device *dev, u8 *lun);
int pm8001_dev_found(struct domain_device *dev);
void pm8001_dev_gone(struct domain_device *dev);
......
......@@ -722,6 +722,8 @@ struct sas_phy *sas_get_local_phy(struct domain_device *dev);
int sas_request_addr(struct Scsi_Host *shost, u8 *addr);
int sas_abort_task_set(struct domain_device *dev, u8 *lun);
int sas_notify_port_event(struct asd_sas_phy *phy, enum port_event event,
gfp_t gfp_flags);
int sas_notify_phy_event(struct asd_sas_phy *phy, enum phy_event event,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment