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/pci/pdc202xx_old.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/pci/pdc202xx_old.c')
-rw-r--r-- | drivers/ide/pci/pdc202xx_old.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c index 207a6191fac7..7146fe3f6ba7 100644 --- a/drivers/ide/pci/pdc202xx_old.c +++ b/drivers/ide/pci/pdc202xx_old.c | |||
@@ -46,7 +46,6 @@ | |||
46 | #include <asm/io.h> | 46 | #include <asm/io.h> |
47 | #include <asm/irq.h> | 47 | #include <asm/irq.h> |
48 | 48 | ||
49 | #define PDC202_DEBUG_CABLE 0 | ||
50 | #define PDC202XX_DEBUG_DRIVE_INFO 0 | 49 | #define PDC202XX_DEBUG_DRIVE_INFO 0 |
51 | 50 | ||
52 | static const char *pdc_quirk_drives[] = { | 51 | static const char *pdc_quirk_drives[] = { |
@@ -238,20 +237,7 @@ static int config_chipset_for_dma (ide_drive_t *drive) | |||
238 | u32 drive_conf = 0; | 237 | u32 drive_conf = 0; |
239 | u8 drive_pci = 0x60 + (drive->dn << 2); | 238 | u8 drive_pci = 0x60 + (drive->dn << 2); |
240 | u8 test1 = 0, test2 = 0, speed = -1; | 239 | u8 test1 = 0, test2 = 0, speed = -1; |
241 | u8 AP = 0, cable = 0; | 240 | u8 AP = 0; |
242 | |||
243 | u8 ultra_66 = ((id->dma_ultra & 0x0010) || | ||
244 | (id->dma_ultra & 0x0008)) ? 1 : 0; | ||
245 | |||
246 | if (dev->device != PCI_DEVICE_ID_PROMISE_20246) | ||
247 | cable = pdc202xx_old_cable_detect(hwif); | ||
248 | else | ||
249 | ultra_66 = 0; | ||
250 | |||
251 | if (ultra_66 && cable) { | ||
252 | printk(KERN_WARNING "Warning: %s channel requires an 80-pin cable for operation.\n", hwif->channel ? "Secondary":"Primary"); | ||
253 | printk(KERN_WARNING "%s reduced to Ultra33 mode.\n", drive->name); | ||
254 | } | ||
255 | 241 | ||
256 | if (dev->device != PCI_DEVICE_ID_PROMISE_20246) | 242 | if (dev->device != PCI_DEVICE_ID_PROMISE_20246) |
257 | pdc_old_disable_66MHz_clock(drive->hwif); | 243 | pdc_old_disable_66MHz_clock(drive->hwif); |
@@ -477,10 +463,6 @@ static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif) | |||
477 | if (!noautodma) | 463 | if (!noautodma) |
478 | hwif->autodma = 1; | 464 | hwif->autodma = 1; |
479 | hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; | 465 | hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; |
480 | #if PDC202_DEBUG_CABLE | ||
481 | printk(KERN_DEBUG "%s: %s-pin cable\n", | ||
482 | hwif->name, hwif->udma_four ? "80" : "40"); | ||
483 | #endif /* PDC202_DEBUG_CABLE */ | ||
484 | } | 466 | } |
485 | 467 | ||
486 | static void __devinit init_dma_pdc202xx(ide_hwif_t *hwif, unsigned long dmabase) | 468 | static void __devinit init_dma_pdc202xx(ide_hwif_t *hwif, unsigned long dmabase) |