aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libsas
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/libsas')
-rw-r--r--drivers/scsi/libsas/sas_ata.c14
-rw-r--r--drivers/scsi/libsas/sas_scsi_host.c2
2 files changed, 7 insertions, 9 deletions
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
index adc47d481f97..0996f866f14c 100644
--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
@@ -158,8 +158,8 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc)
158 struct Scsi_Host *host = sas_ha->core.shost; 158 struct Scsi_Host *host = sas_ha->core.shost;
159 struct sas_internal *i = to_sas_internal(host->transportt); 159 struct sas_internal *i = to_sas_internal(host->transportt);
160 struct scatterlist *sg; 160 struct scatterlist *sg;
161 unsigned int num = 0;
162 unsigned int xfer = 0; 161 unsigned int xfer = 0;
162 unsigned int si;
163 163
164 task = sas_alloc_task(GFP_ATOMIC); 164 task = sas_alloc_task(GFP_ATOMIC);
165 if (!task) 165 if (!task)
@@ -176,22 +176,20 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc)
176 176
177 ata_tf_to_fis(&qc->tf, 1, 0, (u8*)&task->ata_task.fis); 177 ata_tf_to_fis(&qc->tf, 1, 0, (u8*)&task->ata_task.fis);
178 task->uldd_task = qc; 178 task->uldd_task = qc;
179 if (is_atapi_taskfile(&qc->tf)) { 179 if (ata_is_atapi(qc->tf.protocol)) {
180 memcpy(task->ata_task.atapi_packet, qc->cdb, qc->dev->cdb_len); 180 memcpy(task->ata_task.atapi_packet, qc->cdb, qc->dev->cdb_len);
181 task->total_xfer_len = qc->nbytes + qc->pad_len; 181 task->total_xfer_len = qc->nbytes + qc->pad_len;
182 task->num_scatter = qc->pad_len ? qc->n_elem + 1 : qc->n_elem; 182 task->num_scatter = qc->pad_len ? qc->n_elem + 1 : qc->n_elem;
183 } else { 183 } else {
184 ata_for_each_sg(sg, qc) { 184 for_each_sg(qc->sg, sg, qc->n_elem, si)
185 num++;
186 xfer += sg->length; 185 xfer += sg->length;
187 }
188 186
189 task->total_xfer_len = xfer; 187 task->total_xfer_len = xfer;
190 task->num_scatter = num; 188 task->num_scatter = si;
191 } 189 }
192 190
193 task->data_dir = qc->dma_dir; 191 task->data_dir = qc->dma_dir;
194 task->scatter = qc->__sg; 192 task->scatter = qc->sg;
195 task->ata_task.retry_count = 1; 193 task->ata_task.retry_count = 1;
196 task->task_state_flags = SAS_TASK_STATE_PENDING; 194 task->task_state_flags = SAS_TASK_STATE_PENDING;
197 qc->lldd_task = task; 195 qc->lldd_task = task;
@@ -200,7 +198,7 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc)
200 case ATA_PROT_NCQ: 198 case ATA_PROT_NCQ:
201 task->ata_task.use_ncq = 1; 199 task->ata_task.use_ncq = 1;
202 /* fall through */ 200 /* fall through */
203 case ATA_PROT_ATAPI_DMA: 201 case ATAPI_PROT_DMA:
204 case ATA_PROT_DMA: 202 case ATA_PROT_DMA:
205 task->ata_task.dma_xfer = 1; 203 task->ata_task.dma_xfer = 1;
206 break; 204 break;
diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c
index 9c0422546331..f869fba86807 100644
--- a/drivers/scsi/libsas/sas_scsi_host.c
+++ b/drivers/scsi/libsas/sas_scsi_host.c
@@ -467,7 +467,7 @@ int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd)
467 res = sas_phy_reset(phy, 1); 467 res = sas_phy_reset(phy, 1);
468 if (res) 468 if (res)
469 SAS_DPRINTK("Bus reset of %s failed 0x%x\n", 469 SAS_DPRINTK("Bus reset of %s failed 0x%x\n",
470 phy->dev.kobj.k_name, 470 kobject_name(&phy->dev.kobj),
471 res); 471 res);
472 if (res == TMF_RESP_FUNC_SUCC || res == TMF_RESP_FUNC_COMPLETE) 472 if (res == TMF_RESP_FUNC_SUCC || res == TMF_RESP_FUNC_COMPLETE)
473 return SUCCESS; 473 return SUCCESS;