diff options
Diffstat (limited to 'drivers/ide/ide-dma.c')
-rw-r--r-- | drivers/ide/ide-dma.c | 110 |
1 files changed, 62 insertions, 48 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index ead141e2db9e..5fe1d72ab451 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c | |||
@@ -91,45 +91,45 @@ | |||
91 | 91 | ||
92 | static const struct drive_list_entry drive_whitelist [] = { | 92 | static const struct drive_list_entry drive_whitelist [] = { |
93 | 93 | ||
94 | { "Micropolis 2112A" , "ALL" }, | 94 | { "Micropolis 2112A" , NULL }, |
95 | { "CONNER CTMA 4000" , "ALL" }, | 95 | { "CONNER CTMA 4000" , NULL }, |
96 | { "CONNER CTT8000-A" , "ALL" }, | 96 | { "CONNER CTT8000-A" , NULL }, |
97 | { "ST34342A" , "ALL" }, | 97 | { "ST34342A" , NULL }, |
98 | { NULL , NULL } | 98 | { NULL , NULL } |
99 | }; | 99 | }; |
100 | 100 | ||
101 | static const struct drive_list_entry drive_blacklist [] = { | 101 | static const struct drive_list_entry drive_blacklist [] = { |
102 | 102 | ||
103 | { "WDC AC11000H" , "ALL" }, | 103 | { "WDC AC11000H" , NULL }, |
104 | { "WDC AC22100H" , "ALL" }, | 104 | { "WDC AC22100H" , NULL }, |
105 | { "WDC AC32500H" , "ALL" }, | 105 | { "WDC AC32500H" , NULL }, |
106 | { "WDC AC33100H" , "ALL" }, | 106 | { "WDC AC33100H" , NULL }, |
107 | { "WDC AC31600H" , "ALL" }, | 107 | { "WDC AC31600H" , NULL }, |
108 | { "WDC AC32100H" , "24.09P07" }, | 108 | { "WDC AC32100H" , "24.09P07" }, |
109 | { "WDC AC23200L" , "21.10N21" }, | 109 | { "WDC AC23200L" , "21.10N21" }, |
110 | { "Compaq CRD-8241B" , "ALL" }, | 110 | { "Compaq CRD-8241B" , NULL }, |
111 | { "CRD-8400B" , "ALL" }, | 111 | { "CRD-8400B" , NULL }, |
112 | { "CRD-8480B", "ALL" }, | 112 | { "CRD-8480B", NULL }, |
113 | { "CRD-8482B", "ALL" }, | 113 | { "CRD-8482B", NULL }, |
114 | { "CRD-84" , "ALL" }, | 114 | { "CRD-84" , NULL }, |
115 | { "SanDisk SDP3B" , "ALL" }, | 115 | { "SanDisk SDP3B" , NULL }, |
116 | { "SanDisk SDP3B-64" , "ALL" }, | 116 | { "SanDisk SDP3B-64" , NULL }, |
117 | { "SANYO CD-ROM CRD" , "ALL" }, | 117 | { "SANYO CD-ROM CRD" , NULL }, |
118 | { "HITACHI CDR-8" , "ALL" }, | 118 | { "HITACHI CDR-8" , NULL }, |
119 | { "HITACHI CDR-8335" , "ALL" }, | 119 | { "HITACHI CDR-8335" , NULL }, |
120 | { "HITACHI CDR-8435" , "ALL" }, | 120 | { "HITACHI CDR-8435" , NULL }, |
121 | { "Toshiba CD-ROM XM-6202B" , "ALL" }, | 121 | { "Toshiba CD-ROM XM-6202B" , NULL }, |
122 | { "TOSHIBA CD-ROM XM-1702BC", "ALL" }, | 122 | { "TOSHIBA CD-ROM XM-1702BC", NULL }, |
123 | { "CD-532E-A" , "ALL" }, | 123 | { "CD-532E-A" , NULL }, |
124 | { "E-IDE CD-ROM CR-840", "ALL" }, | 124 | { "E-IDE CD-ROM CR-840", NULL }, |
125 | { "CD-ROM Drive/F5A", "ALL" }, | 125 | { "CD-ROM Drive/F5A", NULL }, |
126 | { "WPI CDD-820", "ALL" }, | 126 | { "WPI CDD-820", NULL }, |
127 | { "SAMSUNG CD-ROM SC-148C", "ALL" }, | 127 | { "SAMSUNG CD-ROM SC-148C", NULL }, |
128 | { "SAMSUNG CD-ROM SC", "ALL" }, | 128 | { "SAMSUNG CD-ROM SC", NULL }, |
129 | { "ATAPI CD-ROM DRIVE 40X MAXIMUM", "ALL" }, | 129 | { "ATAPI CD-ROM DRIVE 40X MAXIMUM", NULL }, |
130 | { "_NEC DV5800A", "ALL" }, | 130 | { "_NEC DV5800A", NULL }, |
131 | { "SAMSUNG CD-ROM SN-124", "N001" }, | 131 | { "SAMSUNG CD-ROM SN-124", "N001" }, |
132 | { "Seagate STT20000A", "ALL" }, | 132 | { "Seagate STT20000A", NULL }, |
133 | { NULL , NULL } | 133 | { NULL , NULL } |
134 | 134 | ||
135 | }; | 135 | }; |
@@ -147,8 +147,8 @@ int ide_in_drive_list(struct hd_driveid *id, const struct drive_list_entry *driv | |||
147 | { | 147 | { |
148 | for ( ; drive_table->id_model ; drive_table++) | 148 | for ( ; drive_table->id_model ; drive_table++) |
149 | if ((!strcmp(drive_table->id_model, id->model)) && | 149 | if ((!strcmp(drive_table->id_model, id->model)) && |
150 | ((strstr(id->fw_rev, drive_table->id_firmware)) || | 150 | (!drive_table->id_firmware || |
151 | (!strcmp(drive_table->id_firmware, "ALL")))) | 151 | strstr(id->fw_rev, drive_table->id_firmware))) |
152 | return 1; | 152 | return 1; |
153 | return 0; | 153 | return 0; |
154 | } | 154 | } |
@@ -702,8 +702,22 @@ static unsigned int ide_get_mode_mask(ide_drive_t *drive, u8 base) | |||
702 | mask = id->dma_mword & hwif->mwdma_mask; | 702 | mask = id->dma_mword & hwif->mwdma_mask; |
703 | break; | 703 | break; |
704 | case XFER_SW_DMA_0: | 704 | case XFER_SW_DMA_0: |
705 | if (id->field_valid & 2) | 705 | if (id->field_valid & 2) { |
706 | mask = id->dma_1word & hwif->swdma_mask; | 706 | mask = id->dma_1word & hwif->swdma_mask; |
707 | } else if (id->tDMA) { | ||
708 | /* | ||
709 | * ide_fix_driveid() doesn't convert ->tDMA to the | ||
710 | * CPU endianness so we need to do it here | ||
711 | */ | ||
712 | u8 mode = le16_to_cpu(id->tDMA); | ||
713 | |||
714 | /* | ||
715 | * if the mode is valid convert it to the mask | ||
716 | * (the maximum allowed mode is XFER_SW_DMA_2) | ||
717 | */ | ||
718 | if (mode <= 2) | ||
719 | mask = ((2 << mode) - 1) & hwif->swdma_mask; | ||
720 | } | ||
707 | break; | 721 | break; |
708 | default: | 722 | default: |
709 | BUG(); | 723 | BUG(); |
@@ -847,27 +861,27 @@ int ide_set_dma(ide_drive_t *drive) | |||
847 | return rc; | 861 | return rc; |
848 | } | 862 | } |
849 | 863 | ||
850 | EXPORT_SYMBOL_GPL(ide_set_dma); | ||
851 | |||
852 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI | 864 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI |
853 | int __ide_dma_lostirq (ide_drive_t *drive) | 865 | void ide_dma_lost_irq (ide_drive_t *drive) |
854 | { | 866 | { |
855 | printk("%s: DMA interrupt recovery\n", drive->name); | 867 | printk("%s: DMA interrupt recovery\n", drive->name); |
856 | return 1; | ||
857 | } | 868 | } |
858 | 869 | ||
859 | EXPORT_SYMBOL(__ide_dma_lostirq); | 870 | EXPORT_SYMBOL(ide_dma_lost_irq); |
860 | 871 | ||
861 | int __ide_dma_timeout (ide_drive_t *drive) | 872 | void ide_dma_timeout (ide_drive_t *drive) |
862 | { | 873 | { |
874 | ide_hwif_t *hwif = HWIF(drive); | ||
875 | |||
863 | printk(KERN_ERR "%s: timeout waiting for DMA\n", drive->name); | 876 | printk(KERN_ERR "%s: timeout waiting for DMA\n", drive->name); |
864 | if (HWIF(drive)->ide_dma_test_irq(drive)) | ||
865 | return 0; | ||
866 | 877 | ||
867 | return HWIF(drive)->ide_dma_end(drive); | 878 | if (hwif->ide_dma_test_irq(drive)) |
879 | return; | ||
880 | |||
881 | hwif->ide_dma_end(drive); | ||
868 | } | 882 | } |
869 | 883 | ||
870 | EXPORT_SYMBOL(__ide_dma_timeout); | 884 | EXPORT_SYMBOL(ide_dma_timeout); |
871 | 885 | ||
872 | /* | 886 | /* |
873 | * Needed for allowing full modular support of ide-driver | 887 | * Needed for allowing full modular support of ide-driver |
@@ -1018,10 +1032,10 @@ void ide_setup_dma (ide_hwif_t *hwif, unsigned long dma_base, unsigned int num_p | |||
1018 | hwif->ide_dma_end = &__ide_dma_end; | 1032 | hwif->ide_dma_end = &__ide_dma_end; |
1019 | if (!hwif->ide_dma_test_irq) | 1033 | if (!hwif->ide_dma_test_irq) |
1020 | hwif->ide_dma_test_irq = &__ide_dma_test_irq; | 1034 | hwif->ide_dma_test_irq = &__ide_dma_test_irq; |
1021 | if (!hwif->ide_dma_timeout) | 1035 | if (!hwif->dma_timeout) |
1022 | hwif->ide_dma_timeout = &__ide_dma_timeout; | 1036 | hwif->dma_timeout = &ide_dma_timeout; |
1023 | if (!hwif->ide_dma_lostirq) | 1037 | if (!hwif->dma_lost_irq) |
1024 | hwif->ide_dma_lostirq = &__ide_dma_lostirq; | 1038 | hwif->dma_lost_irq = &ide_dma_lost_irq; |
1025 | 1039 | ||
1026 | if (hwif->chipset != ide_trm290) { | 1040 | if (hwif->chipset != ide_trm290) { |
1027 | u8 dma_stat = hwif->INB(hwif->dma_status); | 1041 | u8 dma_stat = hwif->INB(hwif->dma_status); |