]> err.no Git - linux-2.6/commitdiff
[PATCH] sata: fix sata_sx4 dma_prep to not use sg->length
authorTejun Heo <htejun@gmail.com>
Sun, 7 Aug 2005 05:53:40 +0000 (14:53 +0900)
committerJeff Garzik <jgarzik@pobox.com>
Wed, 10 Aug 2005 17:34:58 +0000 (13:34 -0400)
 sata_sx4 directly references sg->length to calculate total_len in
pdc20621_dma_prep().  This is incorrect as dma_map_sg() could have
merged multiple sg's into one and, in such case, sg->length doesn't
reflect true size of the entry.  This patch makes it use
sg_dma_len(sg).

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
drivers/scsi/sata_sx4.c

index 140cea05de3f23cdfa8d204af0d49b9f52f32913..efd7d7a61135f01b41337fdf80111ae207a745e3 100644 (file)
@@ -468,7 +468,7 @@ static void pdc20621_dma_prep(struct ata_queued_cmd *qc)
        for (i = 0; i < last; i++) {
                buf[idx++] = cpu_to_le32(sg_dma_address(&sg[i]));
                buf[idx++] = cpu_to_le32(sg_dma_len(&sg[i]));
-               total_len += sg[i].length;
+               total_len += sg_dma_len(&sg[i]);
        }
        buf[idx - 1] |= cpu_to_le32(ATA_PRD_EOT);
        sgt_len = idx * 4;