diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2010-01-18 02:21:41 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-01-19 04:52:32 -0500 |
commit | 23d874054663efaf18340dc554df1b935820cbab (patch) | |
tree | a7f9b6eba742efafe28ee6ff522a7062c3a7e9a5 | |
parent | f6d23c2e2e398dc96c58494be2934f0c11285e3a (diff) |
cmd64x: fix handling of address setup timings
Account for the requirements of the DMA mode currently used.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/ide/cmd64x.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/ide/cmd64x.c b/drivers/ide/cmd64x.c index a65a69171250..5f80312e636b 100644 --- a/drivers/ide/cmd64x.c +++ b/drivers/ide/cmd64x.c | |||
@@ -88,9 +88,6 @@ static void cmd64x_program_timings(ide_drive_t *drive, u8 mode) | |||
88 | pci_write_config_byte(dev, drwtim_regs[drive->dn], | 88 | pci_write_config_byte(dev, drwtim_regs[drive->dn], |
89 | (t.active << 4) | t.recover); | 89 | (t.active << 4) | t.recover); |
90 | 90 | ||
91 | if (mode >= XFER_SW_DMA_0) | ||
92 | return; | ||
93 | |||
94 | /* | 91 | /* |
95 | * The primary channel has individual address setup timing registers | 92 | * The primary channel has individual address setup timing registers |
96 | * for each drive and the hardware selects the slowest timing itself. | 93 | * for each drive and the hardware selects the slowest timing itself. |
@@ -100,11 +97,17 @@ static void cmd64x_program_timings(ide_drive_t *drive, u8 mode) | |||
100 | if (hwif->channel) { | 97 | if (hwif->channel) { |
101 | ide_drive_t *pair = ide_get_pair_dev(drive); | 98 | ide_drive_t *pair = ide_get_pair_dev(drive); |
102 | 99 | ||
103 | ide_set_drivedata(drive, (void *)(unsigned long)t.setup); | 100 | if (pair) { |
101 | struct ide_timing tp; | ||
104 | 102 | ||
105 | if (pair) | 103 | ide_timing_compute(pair, pair->pio_mode, &tp, T, 0); |
106 | t.setup = max_t(u8, t.setup, | 104 | ide_timing_merge(&t, &tp, &t, IDE_TIMING_SETUP); |
107 | (unsigned long)ide_get_drivedata(pair)); | 105 | if (pair->dma_mode) { |
106 | ide_timing_compute(pair, pair->dma_mode, | ||
107 | &tp, T, 0); | ||
108 | ide_timing_merge(&tp, &t, &t, IDE_TIMING_SETUP); | ||
109 | } | ||
110 | } | ||
108 | } | 111 | } |
109 | 112 | ||
110 | if (t.setup > 5) /* shouldn't actually happen... */ | 113 | if (t.setup > 5) /* shouldn't actually happen... */ |