diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-01-25 20:08:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-01-25 20:08:28 -0500 |
commit | 2ba14a017a4ba8d2266316f481d4ad7400073d18 (patch) | |
tree | 6e86dcbbb7898eb747f1198e33961eb68bfcdb4d /drivers/scsi | |
parent | 99f1c97dbdb30e958edfd1ced0ae43df62504e07 (diff) | |
parent | a984f58dd97f22f5113700322fed311a0ee29947 (diff) |
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev: (67 commits)
fix drivers/ata/sata_fsl.c double-decl
[libata] Prefer SCSI_SENSE_BUFFERSIZE to sizeof()
pata_legacy: Merge winbond support
ata_generic: Cenatek support
pata_winbond: error return
pata_serverworks: Fix cable types and cosmetics
pata_mpc52xx: remove un-needed assignment
libata: fix off-by-one in error categorization
ahci: factor out AHCI enabling and enable AHCI before reading CAP
ata_piix: implement SIDPR SCR access
ata_piix: convert to prepare - activate initialization
libata: factor out ata_pci_activate_sff_host() from ata_pci_one()
[libata] Prefer SCSI_SENSE_BUFFERSIZE to sizeof()
pata_legacy: resychronize with upstream changes and resubmit
[libata] pata_legacy: typo fix
[libata] pata_winbond: update for new ->data_xfer hook
pata_pcmcia: convert to new data_xfer prototype
libata annotations and fixes
libata: use dev_driver_string() instead of "libata" in libata-sff.c
ata_piix: kill unused constants and flags
...
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/ipr.c | 9 | ||||
-rw-r--r-- | drivers/scsi/libsas/sas_ata.c | 14 |
2 files changed, 11 insertions, 12 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 0841df01bc19..aa0df0a4b22a 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -5142,6 +5142,7 @@ static void ipr_build_ata_ioadl(struct ipr_cmnd *ipr_cmd, | |||
5142 | struct ipr_ioadl_desc *last_ioadl = NULL; | 5142 | struct ipr_ioadl_desc *last_ioadl = NULL; |
5143 | int len = qc->nbytes + qc->pad_len; | 5143 | int len = qc->nbytes + qc->pad_len; |
5144 | struct scatterlist *sg; | 5144 | struct scatterlist *sg; |
5145 | unsigned int si; | ||
5145 | 5146 | ||
5146 | if (len == 0) | 5147 | if (len == 0) |
5147 | return; | 5148 | return; |
@@ -5159,7 +5160,7 @@ static void ipr_build_ata_ioadl(struct ipr_cmnd *ipr_cmd, | |||
5159 | cpu_to_be32(sizeof(struct ipr_ioadl_desc) * ipr_cmd->dma_use_sg); | 5160 | cpu_to_be32(sizeof(struct ipr_ioadl_desc) * ipr_cmd->dma_use_sg); |
5160 | } | 5161 | } |
5161 | 5162 | ||
5162 | ata_for_each_sg(sg, qc) { | 5163 | for_each_sg(qc->sg, sg, qc->n_elem, si) { |
5163 | ioadl->flags_and_data_len = cpu_to_be32(ioadl_flags | sg_dma_len(sg)); | 5164 | ioadl->flags_and_data_len = cpu_to_be32(ioadl_flags | sg_dma_len(sg)); |
5164 | ioadl->address = cpu_to_be32(sg_dma_address(sg)); | 5165 | ioadl->address = cpu_to_be32(sg_dma_address(sg)); |
5165 | 5166 | ||
@@ -5222,12 +5223,12 @@ static unsigned int ipr_qc_issue(struct ata_queued_cmd *qc) | |||
5222 | regs->flags |= IPR_ATA_FLAG_XFER_TYPE_DMA; | 5223 | regs->flags |= IPR_ATA_FLAG_XFER_TYPE_DMA; |
5223 | break; | 5224 | break; |
5224 | 5225 | ||
5225 | case ATA_PROT_ATAPI: | 5226 | case ATAPI_PROT_PIO: |
5226 | case ATA_PROT_ATAPI_NODATA: | 5227 | case ATAPI_PROT_NODATA: |
5227 | regs->flags |= IPR_ATA_FLAG_PACKET_CMD; | 5228 | regs->flags |= IPR_ATA_FLAG_PACKET_CMD; |
5228 | break; | 5229 | break; |
5229 | 5230 | ||
5230 | case ATA_PROT_ATAPI_DMA: | 5231 | case ATAPI_PROT_DMA: |
5231 | regs->flags |= IPR_ATA_FLAG_PACKET_CMD; | 5232 | regs->flags |= IPR_ATA_FLAG_PACKET_CMD; |
5232 | regs->flags |= IPR_ATA_FLAG_XFER_TYPE_DMA; | 5233 | regs->flags |= IPR_ATA_FLAG_XFER_TYPE_DMA; |
5233 | break; | 5234 | break; |
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index 0829b55c64d2..827cfb132f21 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; |