diff options
Diffstat (limited to 'drivers/scsi/aic94xx')
-rw-r--r-- | drivers/scsi/aic94xx/aic94xx_dev.c | 2 | ||||
-rw-r--r-- | drivers/scsi/aic94xx/aic94xx_init.c | 3 | ||||
-rw-r--r-- | drivers/scsi/aic94xx/aic94xx_task.c | 20 |
3 files changed, 17 insertions, 8 deletions
diff --git a/drivers/scsi/aic94xx/aic94xx_dev.c b/drivers/scsi/aic94xx/aic94xx_dev.c index c520e5b41fb5..3dce618bf414 100644 --- a/drivers/scsi/aic94xx/aic94xx_dev.c +++ b/drivers/scsi/aic94xx/aic94xx_dev.c | |||
@@ -126,7 +126,7 @@ static inline int asd_init_sata(struct domain_device *dev) | |||
126 | if (w76 & 0x100) /* NCQ? */ | 126 | if (w76 & 0x100) /* NCQ? */ |
127 | qdepth = (w75 & 0x1F) + 1; | 127 | qdepth = (w75 & 0x1F) + 1; |
128 | asd_ddbsite_write_dword(asd_ha, ddb, SATA_TAG_ALLOC_MASK, | 128 | asd_ddbsite_write_dword(asd_ha, ddb, SATA_TAG_ALLOC_MASK, |
129 | (1<<qdepth)-1); | 129 | (1ULL<<qdepth)-1); |
130 | asd_ddbsite_write_byte(asd_ha, ddb, NUM_SATA_TAGS, qdepth); | 130 | asd_ddbsite_write_byte(asd_ha, ddb, NUM_SATA_TAGS, qdepth); |
131 | } | 131 | } |
132 | if (dev->dev_type == SATA_DEV || dev->dev_type == SATA_PM || | 132 | if (dev->dev_type == SATA_DEV || dev->dev_type == SATA_PM || |
diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c index b8c6810090d5..ab00aecc5466 100644 --- a/drivers/scsi/aic94xx/aic94xx_init.c +++ b/drivers/scsi/aic94xx/aic94xx_init.c | |||
@@ -81,6 +81,9 @@ static struct scsi_host_template aic94xx_sht = { | |||
81 | .use_clustering = ENABLE_CLUSTERING, | 81 | .use_clustering = ENABLE_CLUSTERING, |
82 | .eh_device_reset_handler = sas_eh_device_reset_handler, | 82 | .eh_device_reset_handler = sas_eh_device_reset_handler, |
83 | .eh_bus_reset_handler = sas_eh_bus_reset_handler, | 83 | .eh_bus_reset_handler = sas_eh_bus_reset_handler, |
84 | .slave_alloc = sas_slave_alloc, | ||
85 | .target_destroy = sas_target_destroy, | ||
86 | .ioctl = sas_ioctl, | ||
84 | }; | 87 | }; |
85 | 88 | ||
86 | static int __devinit asd_map_memio(struct asd_ha_struct *asd_ha) | 89 | static int __devinit asd_map_memio(struct asd_ha_struct *asd_ha) |
diff --git a/drivers/scsi/aic94xx/aic94xx_task.c b/drivers/scsi/aic94xx/aic94xx_task.c index e2ad5bed9403..d5d8caba3560 100644 --- a/drivers/scsi/aic94xx/aic94xx_task.c +++ b/drivers/scsi/aic94xx/aic94xx_task.c | |||
@@ -74,8 +74,13 @@ static inline int asd_map_scatterlist(struct sas_task *task, | |||
74 | return 0; | 74 | return 0; |
75 | } | 75 | } |
76 | 76 | ||
77 | num_sg = pci_map_sg(asd_ha->pcidev, task->scatter, task->num_scatter, | 77 | /* STP tasks come from libata which has already mapped |
78 | task->data_dir); | 78 | * the SG list */ |
79 | if (sas_protocol_ata(task->task_proto)) | ||
80 | num_sg = task->num_scatter; | ||
81 | else | ||
82 | num_sg = pci_map_sg(asd_ha->pcidev, task->scatter, | ||
83 | task->num_scatter, task->data_dir); | ||
79 | if (num_sg == 0) | 84 | if (num_sg == 0) |
80 | return -ENOMEM; | 85 | return -ENOMEM; |
81 | 86 | ||
@@ -120,8 +125,9 @@ static inline int asd_map_scatterlist(struct sas_task *task, | |||
120 | 125 | ||
121 | return 0; | 126 | return 0; |
122 | err_unmap: | 127 | err_unmap: |
123 | pci_unmap_sg(asd_ha->pcidev, task->scatter, task->num_scatter, | 128 | if (sas_protocol_ata(task->task_proto)) |
124 | task->data_dir); | 129 | pci_unmap_sg(asd_ha->pcidev, task->scatter, task->num_scatter, |
130 | task->data_dir); | ||
125 | return res; | 131 | return res; |
126 | } | 132 | } |
127 | 133 | ||
@@ -142,8 +148,9 @@ static inline void asd_unmap_scatterlist(struct asd_ascb *ascb) | |||
142 | } | 148 | } |
143 | 149 | ||
144 | asd_free_coherent(asd_ha, ascb->sg_arr); | 150 | asd_free_coherent(asd_ha, ascb->sg_arr); |
145 | pci_unmap_sg(asd_ha->pcidev, task->scatter, task->num_scatter, | 151 | if (task->task_proto != SAS_PROTOCOL_STP) |
146 | task->data_dir); | 152 | pci_unmap_sg(asd_ha->pcidev, task->scatter, task->num_scatter, |
153 | task->data_dir); | ||
147 | } | 154 | } |
148 | 155 | ||
149 | /* ---------- Task complete tasklet ---------- */ | 156 | /* ---------- Task complete tasklet ---------- */ |
@@ -391,7 +398,6 @@ static int asd_build_ata_ascb(struct asd_ascb *ascb, struct sas_task *task, | |||
391 | 398 | ||
392 | scb->ata_task.total_xfer_len = cpu_to_le32(task->total_xfer_len); | 399 | scb->ata_task.total_xfer_len = cpu_to_le32(task->total_xfer_len); |
393 | scb->ata_task.fis = task->ata_task.fis; | 400 | scb->ata_task.fis = task->ata_task.fis; |
394 | scb->ata_task.fis.fis_type = 0x27; | ||
395 | if (likely(!task->ata_task.device_control_reg_update)) | 401 | if (likely(!task->ata_task.device_control_reg_update)) |
396 | scb->ata_task.fis.flags |= 0x80; /* C=1: update ATA cmd reg */ | 402 | scb->ata_task.fis.flags |= 0x80; /* C=1: update ATA cmd reg */ |
397 | scb->ata_task.fis.flags &= 0xF0; /* PM_PORT field shall be 0 */ | 403 | scb->ata_task.fis.flags &= 0xF0; /* PM_PORT field shall be 0 */ |