diff options
Diffstat (limited to 'drivers/ide/ide-dma-sff.c')
-rw-r--r-- | drivers/ide/ide-dma-sff.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/ide/ide-dma-sff.c b/drivers/ide/ide-dma-sff.c index 75a9ea2e4c82..16fc46edc32d 100644 --- a/drivers/ide/ide-dma-sff.c +++ b/drivers/ide/ide-dma-sff.c | |||
@@ -38,10 +38,9 @@ int config_drive_for_dma(ide_drive_t *drive) | |||
38 | * Enable DMA on any drive that has mode2 DMA | 38 | * Enable DMA on any drive that has mode2 DMA |
39 | * (multi or single) enabled | 39 | * (multi or single) enabled |
40 | */ | 40 | */ |
41 | if (id[ATA_ID_FIELD_VALID] & 2) /* regular DMA */ | 41 | if ((id[ATA_ID_MWDMA_MODES] & 0x404) == 0x404 || |
42 | if ((id[ATA_ID_MWDMA_MODES] & 0x404) == 0x404 || | 42 | (id[ATA_ID_SWDMA_MODES] & 0x404) == 0x404) |
43 | (id[ATA_ID_SWDMA_MODES] & 0x404) == 0x404) | 43 | return 1; |
44 | return 1; | ||
45 | 44 | ||
46 | /* Consult the list of known "good" drives */ | 45 | /* Consult the list of known "good" drives */ |
47 | if (ide_dma_good_drive(drive)) | 46 | if (ide_dma_good_drive(drive)) |
@@ -166,8 +165,6 @@ use_pio_instead: | |||
166 | printk(KERN_ERR "%s: %s\n", drive->name, | 165 | printk(KERN_ERR "%s: %s\n", drive->name, |
167 | count ? "DMA table too small" : "empty DMA table?"); | 166 | count ? "DMA table too small" : "empty DMA table?"); |
168 | 167 | ||
169 | ide_destroy_dmatable(drive); | ||
170 | |||
171 | return 0; /* revert to PIO for this request */ | 168 | return 0; /* revert to PIO for this request */ |
172 | } | 169 | } |
173 | EXPORT_SYMBOL_GPL(ide_build_dmatable); | 170 | EXPORT_SYMBOL_GPL(ide_build_dmatable); |
@@ -218,7 +215,6 @@ int ide_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd) | |||
218 | /* clear INTR & ERROR flags */ | 215 | /* clear INTR & ERROR flags */ |
219 | ide_dma_sff_write_status(hwif, dma_stat | ATA_DMA_ERR | ATA_DMA_INTR); | 216 | ide_dma_sff_write_status(hwif, dma_stat | ATA_DMA_ERR | ATA_DMA_INTR); |
220 | 217 | ||
221 | drive->waiting_for_dma = 1; | ||
222 | return 0; | 218 | return 0; |
223 | } | 219 | } |
224 | EXPORT_SYMBOL_GPL(ide_dma_setup); | 220 | EXPORT_SYMBOL_GPL(ide_dma_setup); |
@@ -292,8 +288,6 @@ int ide_dma_end(ide_drive_t *drive) | |||
292 | ide_hwif_t *hwif = drive->hwif; | 288 | ide_hwif_t *hwif = drive->hwif; |
293 | u8 dma_stat = 0, dma_cmd = 0, mask; | 289 | u8 dma_stat = 0, dma_cmd = 0, mask; |
294 | 290 | ||
295 | drive->waiting_for_dma = 0; | ||
296 | |||
297 | /* stop DMA */ | 291 | /* stop DMA */ |
298 | if (hwif->host_flags & IDE_HFLAG_MMIO) { | 292 | if (hwif->host_flags & IDE_HFLAG_MMIO) { |
299 | dma_cmd = readb((void __iomem *)(hwif->dma_base + ATA_DMA_CMD)); | 293 | dma_cmd = readb((void __iomem *)(hwif->dma_base + ATA_DMA_CMD)); |
@@ -310,8 +304,6 @@ int ide_dma_end(ide_drive_t *drive) | |||
310 | /* clear INTR & ERROR bits */ | 304 | /* clear INTR & ERROR bits */ |
311 | ide_dma_sff_write_status(hwif, dma_stat | ATA_DMA_ERR | ATA_DMA_INTR); | 305 | ide_dma_sff_write_status(hwif, dma_stat | ATA_DMA_ERR | ATA_DMA_INTR); |
312 | 306 | ||
313 | /* purge DMA mappings */ | ||
314 | ide_destroy_dmatable(drive); | ||
315 | wmb(); | 307 | wmb(); |
316 | 308 | ||
317 | /* verify good DMA status */ | 309 | /* verify good DMA status */ |
@@ -338,9 +330,8 @@ const struct ide_dma_ops sff_dma_ops = { | |||
338 | .dma_start = ide_dma_start, | 330 | .dma_start = ide_dma_start, |
339 | .dma_end = ide_dma_end, | 331 | .dma_end = ide_dma_end, |
340 | .dma_test_irq = ide_dma_test_irq, | 332 | .dma_test_irq = ide_dma_test_irq, |
341 | .dma_timer_expiry = ide_dma_sff_timer_expiry, | ||
342 | .dma_timeout = ide_dma_timeout, | ||
343 | .dma_lost_irq = ide_dma_lost_irq, | 333 | .dma_lost_irq = ide_dma_lost_irq, |
334 | .dma_timer_expiry = ide_dma_sff_timer_expiry, | ||
344 | .dma_sff_read_status = ide_dma_sff_read_status, | 335 | .dma_sff_read_status = ide_dma_sff_read_status, |
345 | }; | 336 | }; |
346 | EXPORT_SYMBOL_GPL(sff_dma_ops); | 337 | EXPORT_SYMBOL_GPL(sff_dma_ops); |