@@ -214,6 +214,10 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc)
else
task->data_dir = qc->dma_dir;
task->scatter = qc->sg;
+ if (qc->scsicmd)
+ task->tag = qc->scsicmd->request->tag;
+ else
+ task->tag = qc->tag;
task->ata_task.retry_count = 1;
task->task_state_flags = SAS_TASK_STATE_PENDING;
qc->lldd_task = task;
@@ -53,6 +53,7 @@ struct sas_task *sas_alloc_slow_task(struct sas_ha_struct *ha,
if (!slow)
goto out_err_slow;
+ task->tag = -1;
if (shost->nr_reserved_cmds) {
struct scsi_device *sdev;
@@ -67,6 +68,7 @@ struct sas_task *sas_alloc_slow_task(struct sas_ha_struct *ha,
REQ_NOWAIT);
if (!slow->scmd)
goto out_err_scmd;
+ task->tag = slow->scmd->request->tag;
ASSIGN_SAS_TASK(slow->scmd, task);
}
@@ -149,7 +149,7 @@ static struct sas_task *sas_create_task(struct scsi_cmnd *cmd,
memcpy(task->ssp_task.LUN, &lun.scsi_lun, 8);
task->ssp_task.task_attr = TASK_ATTR_SIMPLE;
task->ssp_task.cmd = cmd;
-
+ task->tag = cmd->request->tag;
task->scatter = scsi_sglist(cmd);
task->num_scatter = scsi_sg_count(cmd);
task->total_xfer_len = scsi_bufflen(cmd);
@@ -590,6 +590,8 @@ struct sas_task {
u32 total_xfer_len;
u8 data_dir:2; /* Use PCI_DMA_... */
+ u32 tag;
+
struct task_status_struct task_status;
void (*task_done)(struct sas_task *);
All block layer commands now have a tag, so we should be storing it in the sas_task structure for easier lookup. Signed-off-by: Hannes Reinecke <hare@suse.de> --- drivers/scsi/libsas/sas_ata.c | 4 ++++ drivers/scsi/libsas/sas_init.c | 2 ++ drivers/scsi/libsas/sas_scsi_host.c | 2 +- include/scsi/libsas.h | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-)