diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-10-05 07:13:30 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-05 07:13:30 -0400 |
commit | cedc9a478d8c6265879dc3839ef3d4849a709184 (patch) | |
tree | 0c8e0fbffdb6081381c01b8cfd93c95b168acb44 /drivers/scsi/sata_qstor.c | |
parent | ed39f731ab2e77e58122232f6e27333331d7793d (diff) |
libata: fix ATAPI DMA alignment issues
ATAPI needs to be padded to next 4 byte boundary, if misaligned.
Original work by me, many fixes from Tejun Heo.
Diffstat (limited to 'drivers/scsi/sata_qstor.c')
-rw-r--r-- | drivers/scsi/sata_qstor.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/scsi/sata_qstor.c b/drivers/scsi/sata_qstor.c index ffcdeb68641c..69a9b1cf6f9c 100644 --- a/drivers/scsi/sata_qstor.c +++ b/drivers/scsi/sata_qstor.c | |||
@@ -268,16 +268,17 @@ static void qs_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val) | |||
268 | 268 | ||
269 | static void qs_fill_sg(struct ata_queued_cmd *qc) | 269 | static void qs_fill_sg(struct ata_queued_cmd *qc) |
270 | { | 270 | { |
271 | struct scatterlist *sg = qc->sg; | 271 | struct scatterlist *sg; |
272 | struct ata_port *ap = qc->ap; | 272 | struct ata_port *ap = qc->ap; |
273 | struct qs_port_priv *pp = ap->private_data; | 273 | struct qs_port_priv *pp = ap->private_data; |
274 | unsigned int nelem; | 274 | unsigned int nelem; |
275 | u8 *prd = pp->pkt + QS_CPB_BYTES; | 275 | u8 *prd = pp->pkt + QS_CPB_BYTES; |
276 | 276 | ||
277 | assert(sg != NULL); | 277 | assert(qc->__sg != NULL); |
278 | assert(qc->n_elem > 0); | 278 | assert(qc->n_elem > 0); |
279 | 279 | ||
280 | for (nelem = 0; nelem < qc->n_elem; nelem++,sg++) { | 280 | nelem = 0; |
281 | ata_for_each_sg(sg, qc) { | ||
281 | u64 addr; | 282 | u64 addr; |
282 | u32 len; | 283 | u32 len; |
283 | 284 | ||
@@ -291,6 +292,7 @@ static void qs_fill_sg(struct ata_queued_cmd *qc) | |||
291 | 292 | ||
292 | VPRINTK("PRD[%u] = (0x%llX, 0x%X)\n", nelem, | 293 | VPRINTK("PRD[%u] = (0x%llX, 0x%X)\n", nelem, |
293 | (unsigned long long)addr, len); | 294 | (unsigned long long)addr, len); |
295 | nelem++; | ||
294 | } | 296 | } |
295 | } | 297 | } |
296 | 298 | ||