diff options
Diffstat (limited to 'drivers/ide/sgiioc4.c')
-rw-r--r-- | drivers/ide/sgiioc4.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/drivers/ide/sgiioc4.c b/drivers/ide/sgiioc4.c index b12de8346c73..e5d2a48a84de 100644 --- a/drivers/ide/sgiioc4.c +++ b/drivers/ide/sgiioc4.c | |||
@@ -258,9 +258,6 @@ static int sgiioc4_dma_end(ide_drive_t *drive) | |||
258 | } | 258 | } |
259 | } | 259 | } |
260 | 260 | ||
261 | drive->waiting_for_dma = 0; | ||
262 | ide_destroy_dmatable(drive); | ||
263 | |||
264 | return dma_stat; | 261 | return dma_stat; |
265 | } | 262 | } |
266 | 263 | ||
@@ -280,10 +277,12 @@ static void sgiioc4_dma_host_set(ide_drive_t *drive, int on) | |||
280 | sgiioc4_clearirq(drive); | 277 | sgiioc4_clearirq(drive); |
281 | } | 278 | } |
282 | 279 | ||
283 | static void | 280 | static void sgiioc4_resetproc(ide_drive_t *drive) |
284 | sgiioc4_resetproc(ide_drive_t * drive) | ||
285 | { | 281 | { |
282 | struct ide_cmd *cmd = &drive->hwif->cmd; | ||
283 | |||
286 | sgiioc4_dma_end(drive); | 284 | sgiioc4_dma_end(drive); |
285 | ide_dma_unmap_sg(drive, cmd); | ||
287 | sgiioc4_clearirq(drive); | 286 | sgiioc4_clearirq(drive); |
288 | } | 287 | } |
289 | 288 | ||
@@ -412,7 +411,6 @@ sgiioc4_configure_for_dma(int dma_direction, ide_drive_t * drive) | |||
412 | writel(ending_dma_addr, (void __iomem *)(dma_base + IOC4_DMA_END_ADDR * 4)); | 411 | writel(ending_dma_addr, (void __iomem *)(dma_base + IOC4_DMA_END_ADDR * 4)); |
413 | 412 | ||
414 | writel(dma_direction, (void __iomem *)ioc4_dma_addr); | 413 | writel(dma_direction, (void __iomem *)ioc4_dma_addr); |
415 | drive->waiting_for_dma = 1; | ||
416 | } | 414 | } |
417 | 415 | ||
418 | /* IOC4 Scatter Gather list Format */ | 416 | /* IOC4 Scatter Gather list Format */ |
@@ -442,7 +440,7 @@ static int sgiioc4_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd) | |||
442 | printk(KERN_WARNING | 440 | printk(KERN_WARNING |
443 | "%s: DMA table too small\n", | 441 | "%s: DMA table too small\n", |
444 | drive->name); | 442 | drive->name); |
445 | goto use_pio_instead; | 443 | return 0; |
446 | } else { | 444 | } else { |
447 | u32 bcount = | 445 | u32 bcount = |
448 | 0x10000 - (cur_addr & 0xffff); | 446 | 0x10000 - (cur_addr & 0xffff); |
@@ -477,9 +475,6 @@ static int sgiioc4_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd) | |||
477 | return count; | 475 | return count; |
478 | } | 476 | } |
479 | 477 | ||
480 | use_pio_instead: | ||
481 | ide_destroy_dmatable(drive); | ||
482 | |||
483 | return 0; /* revert to PIO for this request */ | 478 | return 0; /* revert to PIO for this request */ |
484 | } | 479 | } |
485 | 480 | ||
@@ -488,11 +483,9 @@ static int sgiioc4_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd) | |||
488 | int ddir; | 483 | int ddir; |
489 | u8 write = !!(cmd->tf_flags & IDE_TFLAG_WRITE); | 484 | u8 write = !!(cmd->tf_flags & IDE_TFLAG_WRITE); |
490 | 485 | ||
491 | if (sgiioc4_build_dmatable(drive, cmd) == 0) { | 486 | if (sgiioc4_build_dmatable(drive, cmd) == 0) |
492 | /* try PIO instead of DMA */ | 487 | /* try PIO instead of DMA */ |
493 | ide_map_sg(drive, cmd); | ||
494 | return 1; | 488 | return 1; |
495 | } | ||
496 | 489 | ||
497 | if (write) | 490 | if (write) |
498 | /* Writes TO the IOC4 FROM Main Memory */ | 491 | /* Writes TO the IOC4 FROM Main Memory */ |
@@ -510,9 +503,9 @@ static const struct ide_tp_ops sgiioc4_tp_ops = { | |||
510 | .exec_command = ide_exec_command, | 503 | .exec_command = ide_exec_command, |
511 | .read_status = sgiioc4_read_status, | 504 | .read_status = sgiioc4_read_status, |
512 | .read_altstatus = ide_read_altstatus, | 505 | .read_altstatus = ide_read_altstatus, |
506 | .write_devctl = ide_write_devctl, | ||
513 | 507 | ||
514 | .set_irq = ide_set_irq, | 508 | .dev_select = ide_dev_select, |
515 | |||
516 | .tf_load = ide_tf_load, | 509 | .tf_load = ide_tf_load, |
517 | .tf_read = ide_tf_read, | 510 | .tf_read = ide_tf_read, |
518 | 511 | ||
@@ -533,7 +526,6 @@ static const struct ide_dma_ops sgiioc4_dma_ops = { | |||
533 | .dma_end = sgiioc4_dma_end, | 526 | .dma_end = sgiioc4_dma_end, |
534 | .dma_test_irq = sgiioc4_dma_test_irq, | 527 | .dma_test_irq = sgiioc4_dma_test_irq, |
535 | .dma_lost_irq = sgiioc4_dma_lost_irq, | 528 | .dma_lost_irq = sgiioc4_dma_lost_irq, |
536 | .dma_timeout = ide_dma_timeout, | ||
537 | }; | 529 | }; |
538 | 530 | ||
539 | static const struct ide_port_info sgiioc4_port_info __devinitconst = { | 531 | static const struct ide_port_info sgiioc4_port_info __devinitconst = { |