aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_cmd64x.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-12-20 13:22:33 -0500
committerJeff Garzik <jgarzik@redhat.com>2009-12-20 15:42:12 -0500
commit509426bd46ad0903dca409803e0ee3d30f99f1e8 (patch)
tree628568a77c1b5e0f14c7241ec3e4a9a81c5dcada /drivers/ata/pata_cmd64x.c
parent06393afde321b0fd7626b2d0966ebcaf6077de93 (diff)
pata_cmd64x: fix overclocking of UDMA0-2 modes
adev->dma_mode stores the transfer mode value not UDMA mode number so the condition in cmd64x_set_dmamode() is always true and the higher UDMA clock is always selected. This can potentially result in data corruption when UDMA33 device is used, when 40-wire cable is used or when the error recovery code decides to lower the device speed down. The issue was introduced in the commit 6a40da0 ("libata cmd64x: whack into a shape that looks like the documentation") which goes back to kernel 2.6.20. Cc: stable@kernel.org Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/pata_cmd64x.c')
-rw-r--r--drivers/ata/pata_cmd64x.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ata/pata_cmd64x.c b/drivers/ata/pata_cmd64x.c
index 58c09e223838..0efb1f58f255 100644
--- a/drivers/ata/pata_cmd64x.c
+++ b/drivers/ata/pata_cmd64x.c
@@ -219,7 +219,7 @@ static void cmd64x_set_dmamode(struct ata_port *ap, struct ata_device *adev)
219 regU |= udma_data[adev->dma_mode - XFER_UDMA_0] << shift; 219 regU |= udma_data[adev->dma_mode - XFER_UDMA_0] << shift;
220 /* Merge the control bits */ 220 /* Merge the control bits */
221 regU |= 1 << adev->devno; /* UDMA on */ 221 regU |= 1 << adev->devno; /* UDMA on */
222 if (adev->dma_mode > 2) /* 15nS timing */ 222 if (adev->dma_mode > XFER_UDMA_2) /* 15nS timing */
223 regU |= 4 << adev->devno; 223 regU |= 4 << adev->devno;
224 } else { 224 } else {
225 regU &= ~ (1 << adev->devno); /* UDMA off */ 225 regU &= ~ (1 << adev->devno); /* UDMA off */