]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
pata_it8213: fix UDMA handling
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Thu, 3 Dec 2009 19:32:10 +0000 (20:32 +0100)
committerJeff Garzik <jgarzik@redhat.com>
Thu, 3 Dec 2009 20:59:25 +0000 (15:59 -0500)
Driver should program the cycle timing not the mode number
(doing the latter results in wrong timings being used).

There shouldn't be any problems with it as IDE it8213 host driver
has been doing it this way for years.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/pata_it8213.c

index f156da8076f72d1dc32e7d018e77e7c63e8466f0..36d1f61491df8395558a8c1b4be2f33e50eb31bf 100644 (file)
@@ -173,10 +173,10 @@ static void it8213_set_dmamode (struct ata_port *ap, struct ata_device *adev)
 
                udma_enable |= (1 << devid);
 
-               /* Load the UDMA mode number */
+               /* Load the UDMA cycle time */
                pci_read_config_word(dev, 0x4A, &udma_timing);
                udma_timing &= ~(3 << (4 * devid));
-               udma_timing |= (udma & 3) << (4 * devid);
+               udma_timing |= u_speed << (4 * devid);
                pci_write_config_word(dev, 0x4A, udma_timing);
 
                /* Load the clock selection */