diff options
Diffstat (limited to 'drivers/ide/ide-dma.c')
-rw-r--r-- | drivers/ide/ide-dma.c | 60 |
1 files changed, 15 insertions, 45 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index 0d795a1678c7..6879aaae544d 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c | |||
@@ -753,10 +753,12 @@ u8 ide_find_dma_mode(ide_drive_t *drive, u8 req_mode) | |||
753 | mode = XFER_MW_DMA_1; | 753 | mode = XFER_MW_DMA_1; |
754 | } | 754 | } |
755 | 755 | ||
756 | printk(KERN_DEBUG "%s: %s mode selected\n", drive->name, | 756 | mode = min(mode, req_mode); |
757 | |||
758 | printk(KERN_INFO "%s: %s mode selected\n", drive->name, | ||
757 | mode ? ide_xfer_verbose(mode) : "no DMA"); | 759 | mode ? ide_xfer_verbose(mode) : "no DMA"); |
758 | 760 | ||
759 | return min(mode, req_mode); | 761 | return mode; |
760 | } | 762 | } |
761 | 763 | ||
762 | EXPORT_SYMBOL_GPL(ide_find_dma_mode); | 764 | EXPORT_SYMBOL_GPL(ide_find_dma_mode); |
@@ -772,6 +774,9 @@ static int ide_tune_dma(ide_drive_t *drive) | |||
772 | if (__ide_dma_bad_drive(drive)) | 774 | if (__ide_dma_bad_drive(drive)) |
773 | return 0; | 775 | return 0; |
774 | 776 | ||
777 | if (ide_id_dma_bug(drive)) | ||
778 | return 0; | ||
779 | |||
775 | if (drive->hwif->host_flags & IDE_HFLAG_TRUST_BIOS_FOR_DMA) | 780 | if (drive->hwif->host_flags & IDE_HFLAG_TRUST_BIOS_FOR_DMA) |
776 | return config_drive_for_dma(drive); | 781 | return config_drive_for_dma(drive); |
777 | 782 | ||
@@ -806,58 +811,23 @@ static int ide_dma_check(ide_drive_t *drive) | |||
806 | return vdma ? 0 : -1; | 811 | return vdma ? 0 : -1; |
807 | } | 812 | } |
808 | 813 | ||
809 | void ide_dma_verbose(ide_drive_t *drive) | 814 | int ide_id_dma_bug(ide_drive_t *drive) |
810 | { | 815 | { |
811 | struct hd_driveid *id = drive->id; | 816 | struct hd_driveid *id = drive->id; |
812 | ide_hwif_t *hwif = HWIF(drive); | ||
813 | 817 | ||
814 | if (id->field_valid & 4) { | 818 | if (id->field_valid & 4) { |
815 | if ((id->dma_ultra >> 8) && (id->dma_mword >> 8)) | 819 | if ((id->dma_ultra >> 8) && (id->dma_mword >> 8)) |
816 | goto bug_dma_off; | 820 | goto err_out; |
817 | if (id->dma_ultra & ((id->dma_ultra >> 8) & hwif->ultra_mask)) { | ||
818 | if (((id->dma_ultra >> 11) & 0x1F) && | ||
819 | eighty_ninty_three(drive)) { | ||
820 | if ((id->dma_ultra >> 15) & 1) { | ||
821 | printk(", UDMA(mode 7)"); | ||
822 | } else if ((id->dma_ultra >> 14) & 1) { | ||
823 | printk(", UDMA(133)"); | ||
824 | } else if ((id->dma_ultra >> 13) & 1) { | ||
825 | printk(", UDMA(100)"); | ||
826 | } else if ((id->dma_ultra >> 12) & 1) { | ||
827 | printk(", UDMA(66)"); | ||
828 | } else if ((id->dma_ultra >> 11) & 1) { | ||
829 | printk(", UDMA(44)"); | ||
830 | } else | ||
831 | goto mode_two; | ||
832 | } else { | ||
833 | mode_two: | ||
834 | if ((id->dma_ultra >> 10) & 1) { | ||
835 | printk(", UDMA(33)"); | ||
836 | } else if ((id->dma_ultra >> 9) & 1) { | ||
837 | printk(", UDMA(25)"); | ||
838 | } else if ((id->dma_ultra >> 8) & 1) { | ||
839 | printk(", UDMA(16)"); | ||
840 | } | ||
841 | } | ||
842 | } else { | ||
843 | printk(", (U)DMA"); /* Can be BIOS-enabled! */ | ||
844 | } | ||
845 | } else if (id->field_valid & 2) { | 821 | } else if (id->field_valid & 2) { |
846 | if ((id->dma_mword >> 8) && (id->dma_1word >> 8)) | 822 | if ((id->dma_mword >> 8) && (id->dma_1word >> 8)) |
847 | goto bug_dma_off; | 823 | goto err_out; |
848 | printk(", DMA"); | ||
849 | } else if (id->field_valid & 1) { | ||
850 | goto bug_dma_off; | ||
851 | } | 824 | } |
852 | return; | 825 | return 0; |
853 | bug_dma_off: | 826 | err_out: |
854 | printk(", BUG DMA OFF"); | 827 | printk(KERN_ERR "%s: bad DMA info in identify block\n", drive->name); |
855 | hwif->dma_off_quietly(drive); | 828 | return 1; |
856 | return; | ||
857 | } | 829 | } |
858 | 830 | ||
859 | EXPORT_SYMBOL(ide_dma_verbose); | ||
860 | |||
861 | int ide_set_dma(ide_drive_t *drive) | 831 | int ide_set_dma(ide_drive_t *drive) |
862 | { | 832 | { |
863 | ide_hwif_t *hwif = drive->hwif; | 833 | ide_hwif_t *hwif = drive->hwif; |