@@ -1275,11 +1275,14 @@ static void mvs_tmf_timedout(struct timer_list *t)
#define MVS_TASK_TIMEOUT 20
static int mvs_exec_internal_tmf_task(struct domain_device *dev,
- void *parameter, u32 para_len, struct mvs_tmf_task *tmf)
+ u8 *lun, struct mvs_tmf_task *tmf)
{
int res, retry;
struct sas_task *task = NULL;
+ if (!(dev->tproto & SAS_PROTOCOL_SSP))
+ return TMF_RESP_FUNC_ESUPP;
+
for (retry = 0; retry < 3; retry++) {
task = sas_alloc_slow_task(GFP_KERNEL);
if (!task)
@@ -1288,7 +1291,7 @@ static int mvs_exec_internal_tmf_task(struct domain_device *dev,
task->dev = dev;
task->task_proto = dev->tproto;
- memcpy(&task->ssp_task, parameter, para_len);
+ memcpy(task->ssp_task.LUN, lun, 8);
task->task_done = mvs_task_done;
task->slow_task->timer.function = mvs_tmf_timedout;
@@ -1349,20 +1352,6 @@ static int mvs_exec_internal_tmf_task(struct domain_device *dev,
return res;
}
-static int mvs_debug_issue_ssp_tmf(struct domain_device *dev,
- u8 *lun, struct mvs_tmf_task *tmf)
-{
- struct sas_ssp_task ssp_task;
- if (!(dev->tproto & SAS_PROTOCOL_SSP))
- return TMF_RESP_FUNC_ESUPP;
-
- memcpy(ssp_task.LUN, lun, 8);
-
- return mvs_exec_internal_tmf_task(dev, &ssp_task,
- sizeof(ssp_task), tmf);
-}
-
-
/* Standard mandates link reset for ATA (type 0)
and hard reset for SSP (type 1) , only for RECOVERY */
static int mvs_debug_I_T_nexus_reset(struct domain_device *dev)
@@ -1388,7 +1377,7 @@ int mvs_lu_reset(struct domain_device *dev, u8 *lun)
tmf_task.tmf = TMF_LU_RESET;
mvi_dev->dev_status = MVS_DEV_EH;
- rc = mvs_debug_issue_ssp_tmf(dev, lun, &tmf_task);
+ rc = mvs_exec_internal_tmf_task(dev, lun, &tmf_task);
if (rc == TMF_RESP_FUNC_COMPLETE) {
spin_lock_irqsave(&mvi->lock, flags);
mvs_release_task(mvi, dev);
@@ -1445,7 +1434,7 @@ int mvs_query_task(struct sas_task *task)
tmf_task.tmf = TMF_QUERY_TASK;
tmf_task.tag_of_task_to_be_managed = cpu_to_le16(tag);
- rc = mvs_debug_issue_ssp_tmf(dev, lun.scsi_lun, &tmf_task);
+ rc = mvs_exec_internal_tmf_task(dev, lun.scsi_lun, &tmf_task);
switch (rc) {
/* The task is still in Lun, release it then */
case TMF_RESP_FUNC_SUCC:
@@ -1500,7 +1489,7 @@ int mvs_abort_task(struct sas_task *task)
tmf_task.tmf = TMF_ABORT_TASK;
tmf_task.tag_of_task_to_be_managed = cpu_to_le16(tag);
- rc = mvs_debug_issue_ssp_tmf(dev, lun.scsi_lun, &tmf_task);
+ rc = mvs_exec_internal_tmf_task(dev, lun.scsi_lun, &tmf_task);
/* if successful, clear the task and callback forwards.*/
if (rc == TMF_RESP_FUNC_COMPLETE) {
@@ -1543,7 +1532,7 @@ int mvs_abort_task_set(struct domain_device *dev, u8 *lun)
struct mvs_tmf_task tmf_task;
tmf_task.tmf = TMF_ABORT_TASK_SET;
- rc = mvs_debug_issue_ssp_tmf(dev, lun, &tmf_task);
+ rc = mvs_exec_internal_tmf_task(dev, lun, &tmf_task);
return rc;
}
@@ -1554,7 +1543,7 @@ int mvs_clear_aca(struct domain_device *dev, u8 *lun)
struct mvs_tmf_task tmf_task;
tmf_task.tmf = TMF_CLEAR_ACA;
- rc = mvs_debug_issue_ssp_tmf(dev, lun, &tmf_task);
+ rc = mvs_exec_internal_tmf_task(dev, lun, &tmf_task);
return rc;
}
@@ -1565,7 +1554,7 @@ int mvs_clear_task_set(struct domain_device *dev, u8 *lun)
struct mvs_tmf_task tmf_task;
tmf_task.tmf = TMF_CLEAR_TASK_SET;
- rc = mvs_debug_issue_ssp_tmf(dev, lun, &tmf_task);
+ rc = mvs_exec_internal_tmf_task(dev, lun, &tmf_task);
return rc;
}
Just a wrapper around mvs_exec_internal_tmf_task(), so call it directly and kill the wrapper. Signed-off-by: Hannes Reinecke <hare@suse.de> --- drivers/scsi/mvsas/mv_sas.c | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-)