diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-05-09 18:01:10 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-05-09 18:01:10 -0400 |
commit | 7f8f48af0861c38c28d4abd550102643e0ea9e6a (patch) | |
tree | 6ec47ace87afbd96cc1144d423854b09d9f21d75 /drivers/ide/ide-lib.c | |
parent | 7662d046df09e80680b77b68de896beab45e675e (diff) |
ide: cable detection fixes (take 2)
Tejun's recent eighty_ninty_three() fix has inspired me to do more thorough
review of the cable detection code...
* print user-friendly warning about limiting the maximum transfer speed
to UDMA33 (and the reason behind it) when 80-wire cable is not detected,
also while at it cleanup eighty_ninty_three() a bit
* use eighty_ninty_three() in ide_ata66_check(), this actually fixes 3 bugs:
- bit 14 (word 93 validity check) == 1 && bit 13 (80-wire cable test) == 1
were used as 80-wire cable present test for CONFIG_IDEDMA_IVB=n case
(please see FIXME comment in eighty_ninty_three() for more details)
- CONFIG_IDEDMA_IVB=y/n cases were interchanged
- check for SATA devices was missing
* remove private cable warnings from pdc_202xx{old,new} drivers now that core
code provides this functionality (plus, in pdc202xx_new case the test could
give false warnings for ATAPI devices because pdc202xx_new driver doesn't
even support ATAPI DMA)
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-lib.c')
-rw-r--r-- | drivers/ide/ide-lib.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c index 4557fc5a3ea3..3be3c69383f2 100644 --- a/drivers/ide/ide-lib.c +++ b/drivers/ide/ide-lib.c | |||
@@ -88,8 +88,15 @@ u8 ide_rate_filter(ide_drive_t *drive, u8 speed) | |||
88 | if (hwif->udma_filter) | 88 | if (hwif->udma_filter) |
89 | mask = hwif->udma_filter(drive); | 89 | mask = hwif->udma_filter(drive); |
90 | 90 | ||
91 | if ((mask & 0x78) && (eighty_ninty_three(drive) == 0)) | 91 | /* |
92 | mask &= 0x07; | 92 | * TODO: speed > XFER_UDMA_2 extra check is needed to avoid false |
93 | * cable warning from eighty_ninty_three(), moving ide_rate_filter() | ||
94 | * calls from ->speedproc to core code will make this hack go away | ||
95 | */ | ||
96 | if (speed > XFER_UDMA_2) { | ||
97 | if ((mask & 0x78) && (eighty_ninty_three(drive) == 0)) | ||
98 | mask &= 0x07; | ||
99 | } | ||
93 | 100 | ||
94 | if (mask) | 101 | if (mask) |
95 | mode = fls(mask) - 1 + XFER_UDMA_0; | 102 | mode = fls(mask) - 1 + XFER_UDMA_0; |