summaryrefslogtreecommitdiff
path: root/drivers/scsi/sata_qstor.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-10-05 11:13:30 (GMT)
committerJeff Garzik <jgarzik@pobox.com>2005-10-05 11:13:30 (GMT)
commitcedc9a478d8c6265879dc3839ef3d4849a709184 (patch)
tree0c8e0fbffdb6081381c01b8cfd93c95b168acb44 /drivers/scsi/sata_qstor.c
parented39f731ab2e77e58122232f6e27333331d7793d (diff)
downloadlinux-fsl-qoriq-cedc9a478d8c6265879dc3839ef3d4849a709184.tar.xz
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.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/scsi/sata_qstor.c b/drivers/scsi/sata_qstor.c
index ffcdeb6..69a9b1c 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)
static void qs_fill_sg(struct ata_queued_cmd *qc)
{
- struct scatterlist *sg = qc->sg;
+ struct scatterlist *sg;
struct ata_port *ap = qc->ap;
struct qs_port_priv *pp = ap->private_data;
unsigned int nelem;
u8 *prd = pp->pkt + QS_CPB_BYTES;
- assert(sg != NULL);
+ assert(qc->__sg != NULL);
assert(qc->n_elem > 0);
- for (nelem = 0; nelem < qc->n_elem; nelem++,sg++) {
+ nelem = 0;
+ ata_for_each_sg(sg, qc) {
u64 addr;
u32 len;
@@ -291,6 +292,7 @@ static void qs_fill_sg(struct ata_queued_cmd *qc)
VPRINTK("PRD[%u] = (0x%llX, 0x%X)\n", nelem,
(unsigned long long)addr, len);
+ nelem++;
}
}