diff options
Diffstat (limited to 'drivers/ide/ide-iops.c')
-rw-r--r-- | drivers/ide/ide-iops.c | 53 |
1 files changed, 29 insertions, 24 deletions
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index ed6128f6cd98..f0be5f665a0e 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c | |||
@@ -571,25 +571,40 @@ EXPORT_SYMBOL(ide_wait_stat); | |||
571 | */ | 571 | */ |
572 | u8 eighty_ninty_three (ide_drive_t *drive) | 572 | u8 eighty_ninty_three (ide_drive_t *drive) |
573 | { | 573 | { |
574 | if(HWIF(drive)->udma_four == 0) | 574 | ide_hwif_t *hwif = drive->hwif; |
575 | return 0; | 575 | struct hd_driveid *id = drive->id; |
576 | |||
577 | if (hwif->udma_four == 0) | ||
578 | goto no_80w; | ||
576 | 579 | ||
577 | /* Check for SATA but only if we are ATA5 or higher */ | 580 | /* Check for SATA but only if we are ATA5 or higher */ |
578 | if (drive->id->hw_config == 0 && (drive->id->major_rev_num & 0x7FE0)) | 581 | if (id->hw_config == 0 && (id->major_rev_num & 0x7FE0)) |
579 | return 1; | 582 | return 1; |
580 | if (!(drive->id->hw_config & 0x6000)) | 583 | |
581 | return 0; | ||
582 | #ifndef CONFIG_IDEDMA_IVB | ||
583 | if(!(drive->id->hw_config & 0x4000)) | ||
584 | return 0; | ||
585 | #endif /* CONFIG_IDEDMA_IVB */ | ||
586 | /* | 584 | /* |
587 | * FIXME: | 585 | * FIXME: |
588 | * - change master/slave IDENTIFY order | 586 | * - change master/slave IDENTIFY order |
589 | * - force bit13 (80c cable present) check | 587 | * - force bit13 (80c cable present) check |
590 | * (unless the slave device is pre-ATA3) | 588 | * (unless the slave device is pre-ATA3) |
591 | */ | 589 | */ |
592 | return 1; | 590 | #ifndef CONFIG_IDEDMA_IVB |
591 | if (id->hw_config & 0x4000) | ||
592 | #else | ||
593 | if (id->hw_config & 0x6000) | ||
594 | #endif | ||
595 | return 1; | ||
596 | |||
597 | no_80w: | ||
598 | if (drive->udma33_warned == 1) | ||
599 | return 0; | ||
600 | |||
601 | printk(KERN_WARNING "%s: %s side 80-wire cable detection failed, " | ||
602 | "limiting max speed to UDMA33\n", | ||
603 | drive->name, hwif->udma_four ? "drive" : "host"); | ||
604 | |||
605 | drive->udma33_warned = 1; | ||
606 | |||
607 | return 0; | ||
593 | } | 608 | } |
594 | 609 | ||
595 | int ide_ata66_check (ide_drive_t *drive, ide_task_t *args) | 610 | int ide_ata66_check (ide_drive_t *drive, ide_task_t *args) |
@@ -597,23 +612,13 @@ int ide_ata66_check (ide_drive_t *drive, ide_task_t *args) | |||
597 | if ((args->tfRegister[IDE_COMMAND_OFFSET] == WIN_SETFEATURES) && | 612 | if ((args->tfRegister[IDE_COMMAND_OFFSET] == WIN_SETFEATURES) && |
598 | (args->tfRegister[IDE_SECTOR_OFFSET] > XFER_UDMA_2) && | 613 | (args->tfRegister[IDE_SECTOR_OFFSET] > XFER_UDMA_2) && |
599 | (args->tfRegister[IDE_FEATURE_OFFSET] == SETFEATURES_XFER)) { | 614 | (args->tfRegister[IDE_FEATURE_OFFSET] == SETFEATURES_XFER)) { |
600 | #ifndef CONFIG_IDEDMA_IVB | 615 | if (eighty_ninty_three(drive) == 0) { |
601 | if ((drive->id->hw_config & 0x6000) == 0) { | 616 | printk(KERN_WARNING "%s: UDMA speeds >UDMA33 cannot " |
602 | #else /* !CONFIG_IDEDMA_IVB */ | 617 | "be set\n", drive->name); |
603 | if (((drive->id->hw_config & 0x2000) == 0) || | ||
604 | ((drive->id->hw_config & 0x4000) == 0)) { | ||
605 | #endif /* CONFIG_IDEDMA_IVB */ | ||
606 | printk("%s: Speed warnings UDMA 3/4/5 is not " | ||
607 | "functional.\n", drive->name); | ||
608 | return 1; | ||
609 | } | ||
610 | if (!HWIF(drive)->udma_four) { | ||
611 | printk("%s: Speed warnings UDMA 3/4/5 is not " | ||
612 | "functional.\n", | ||
613 | HWIF(drive)->name); | ||
614 | return 1; | 618 | return 1; |
615 | } | 619 | } |
616 | } | 620 | } |
621 | |||
617 | return 0; | 622 | return 0; |
618 | } | 623 | } |
619 | 624 | ||