aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide-taskfile.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 1a34edb183ec..5f6d01a4222c 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -170,23 +170,25 @@ ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task)
170 170
171 ide_tf_load(drive, task); 171 ide_tf_load(drive, task);
172 172
173 if (task->handler != NULL) { 173 switch (task->data_phase) {
174 if (task->prehandler != NULL) { 174 case TASKFILE_MULTI_OUT:
175 hwif->OUTBSYNC(drive, tf->command, IDE_COMMAND_REG); 175 case TASKFILE_OUT:
176 ndelay(400); /* FIXME */ 176 hwif->OUTBSYNC(drive, tf->command, IDE_COMMAND_REG);
177 return task->prehandler(drive, task->rq); 177 ndelay(400); /* FIXME */
178 } 178 return pre_task_out_intr(drive, task->rq);
179 case TASKFILE_MULTI_IN:
180 case TASKFILE_IN:
181 case TASKFILE_NO_DATA:
179 ide_execute_command(drive, tf->command, task->handler, WAIT_WORSTCASE, NULL); 182 ide_execute_command(drive, tf->command, task->handler, WAIT_WORSTCASE, NULL);
180 return ide_started; 183 return ide_started;
181 } 184 default:
182 185 if (task_dma_ok(task) == 0 || drive->using_dma == 0 ||
183 if (task_dma_ok(task) && drive->using_dma && !hwif->dma_setup(drive)) { 186 hwif->dma_setup(drive))
187 return ide_stopped;
184 hwif->dma_exec_cmd(drive, tf->command); 188 hwif->dma_exec_cmd(drive, tf->command);
185 hwif->dma_start(drive); 189 hwif->dma_start(drive);
186 return ide_started; 190 return ide_started;
187 } 191 }
188
189 return ide_stopped;
190} 192}
191 193
192/* 194/*
@@ -665,7 +667,6 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
665 } 667 }
666 /* fall through */ 668 /* fall through */
667 case TASKFILE_OUT: 669 case TASKFILE_OUT:
668 args.prehandler = &pre_task_out_intr;
669 args.handler = &task_out_intr; 670 args.handler = &task_out_intr;
670 /* fall through */ 671 /* fall through */
671 case TASKFILE_OUT_DMAQ: 672 case TASKFILE_OUT_DMAQ: