pata_cmd64x: fix handling of address setup timings
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Mon, 18 Jan 2010 17:15:04 +0000 (18:15 +0100)
committerJeff Garzik <jgarzik@redhat.com>
Mon, 1 Mar 2010 19:58:44 +0000 (14:58 -0500)
Account for the requirements of the DMA mode currently used
by the pair device.

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

index db08c9d1a333b74fc75ac9d513050f3abb1d223b..0235a1d3c2fb4308e9f38edcc961f4c982c986a3 100644 (file)
@@ -131,8 +131,14 @@ static void cmd64x_set_timing(struct ata_port *ap, struct ata_device *adev, u8 m
 
                if (pair) {
                        struct ata_timing tp;
+
                        ata_timing_compute(pair, pair->pio_mode, &tp, T, 0);
                        ata_timing_merge(&t, &tp, &t, ATA_TIMING_SETUP);
+                       if (pair->dma_mode) {
+                               ata_timing_compute(pair, pair->dma_mode,
+                                               &tp, T, 0);
+                               ata_timing_merge(&tp, &t, &t, ATA_TIMING_SETUP);
+                       }
                }
        }