aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-taskfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-taskfile.c')
-rw-r--r--drivers/ide/ide-taskfile.c36
1 files changed, 13 insertions, 23 deletions
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 99d6ed434978..a01c2c0450dc 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -314,27 +314,6 @@ void ide_finish_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat)
314} 314}
315 315
316/* 316/*
317 * We got an interrupt on a task_in case, but no errors and no DRQ.
318 *
319 * It might be a spurious irq (shared irq), but it might be a
320 * command that had no output.
321 */
322static ide_startstop_t task_in_unexpected(ide_drive_t *drive,
323 struct ide_cmd *cmd, u8 stat)
324{
325 /* Command all done? */
326 if (OK_STAT(stat, ATA_DRDY, ATA_BUSY)) {
327 ide_finish_cmd(drive, cmd, stat);
328 return ide_stopped;
329 }
330
331 /* Assume it was a spurious irq */
332 ide_set_handler(drive, &task_pio_intr, WAIT_WORSTCASE, NULL);
333
334 return ide_started;
335}
336
337/*
338 * Handler for command with PIO data phase. 317 * Handler for command with PIO data phase.
339 */ 318 */
340static ide_startstop_t task_pio_intr(ide_drive_t *drive) 319static ide_startstop_t task_pio_intr(ide_drive_t *drive)
@@ -350,8 +329,19 @@ static ide_startstop_t task_pio_intr(ide_drive_t *drive)
350 return task_error(drive, cmd, __func__, stat); 329 return task_error(drive, cmd, __func__, stat);
351 330
352 /* Didn't want any data? Odd. */ 331 /* Didn't want any data? Odd. */
353 if ((stat & ATA_DRQ) == 0) 332 if ((stat & ATA_DRQ) == 0) {
354 return task_in_unexpected(drive, cmd, stat); 333 /* Command all done? */
334 if (OK_STAT(stat, ATA_DRDY, ATA_BUSY)) {
335 ide_finish_cmd(drive, cmd, stat);
336 return ide_stopped;
337 }
338
339 /* Assume it was a spurious irq */
340 ide_set_handler(drive, &task_pio_intr, WAIT_WORSTCASE,
341 NULL);
342
343 return ide_started;
344 }
355 } else { 345 } else {
356 if (!OK_STAT(stat, DRIVE_READY, drive->bad_wstat)) 346 if (!OK_STAT(stat, DRIVE_READY, drive->bad_wstat))
357 return task_error(drive, cmd, __func__, stat); 347 return task_error(drive, cmd, __func__, stat);