summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aic94xx
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@steeleye.com>2007-07-16 13:41:04 -0500
committerJames Bottomley <jejb@mulgrave.localdomain>2007-07-18 11:16:14 -0500
commit0f05df8b3b41bc258bdf520b72e8cf7c524048b7 (patch)
treee6fd95f097da4785a1e0fb195044a745de8e89aa /drivers/scsi/aic94xx
parent3a2755af37b317d47fdc3dd15178adaf5d47263e (diff)
downloadlinux-0f05df8b3b41bc258bdf520b72e8cf7c524048b7.tar.gz
linux-0f05df8b3b41bc258bdf520b72e8cf7c524048b7.tar.bz2
linux-0f05df8b3b41bc258bdf520b72e8cf7c524048b7.zip
[SCSI] libsas, aic94xx: fix dma mapping cockups with ATA
This one was noticed by Gilbert Wu of Adaptec: The libata core actually does the DMA mapping for you, so there has to be an exception in the device drivers that *don't* do dma mapping for ATA commands. However, since we've already done this, libsas must now dma map any ATA commands that it wishes to issue ... and yes, this is a horrible mess. Additionally, the test in aic94xx for ATA protocols isn't quite right. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/aic94xx')
-rw-r--r--drivers/scsi/aic94xx/aic94xx_task.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/aic94xx/aic94xx_task.c b/drivers/scsi/aic94xx/aic94xx_task.c
index 6c12c0f19f39..d5d8caba3560 100644
--- a/drivers/scsi/aic94xx/aic94xx_task.c
+++ b/drivers/scsi/aic94xx/aic94xx_task.c
@@ -76,7 +76,7 @@ static inline int asd_map_scatterlist(struct sas_task *task,
/* STP tasks come from libata which has already mapped
* the SG list */
- if (task->task_proto == SAS_PROTOCOL_STP)
+ if (sas_protocol_ata(task->task_proto))
num_sg = task->num_scatter;
else
num_sg = pci_map_sg(asd_ha->pcidev, task->scatter,
@@ -125,7 +125,7 @@ static inline int asd_map_scatterlist(struct sas_task *task,
return 0;
err_unmap:
- if (task->task_proto != SAS_PROTOCOL_STP)
+ if (sas_protocol_ata(task->task_proto))
pci_unmap_sg(asd_ha->pcidev, task->scatter, task->num_scatter,
task->data_dir);
return res;