Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 137669
b: refs/heads/master
c: 151055e
h: refs/heads/master
i:
  137667: 5f31a94
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Mar 27, 2009
1 parent 64ba6e7 commit 7e6d787
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 901bd08a543eed7cbd4fd9e46df588f173417388
refs/heads/master: 151055ed84df7bebc77d88471302a7cd02c6e0a4
36 changes: 13 additions & 23 deletions trunk/drivers/ide/ide-taskfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,27 +313,6 @@ void ide_finish_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat)
ide_end_request(drive, 1, cmd->rq->nr_sectors);
}

/*
* We got an interrupt on a task_in case, but no errors and no DRQ.
*
* It might be a spurious irq (shared irq), but it might be a
* command that had no output.
*/
static ide_startstop_t task_in_unexpected(ide_drive_t *drive,
struct ide_cmd *cmd, u8 stat)
{
/* Command all done? */
if (OK_STAT(stat, ATA_DRDY, ATA_BUSY)) {
ide_finish_cmd(drive, cmd, stat);
return ide_stopped;
}

/* Assume it was a spurious irq */
ide_set_handler(drive, &task_pio_intr, WAIT_WORSTCASE, NULL);

return ide_started;
}

/*
* Handler for command with PIO data phase.
*/
Expand All @@ -350,8 +329,19 @@ static ide_startstop_t task_pio_intr(ide_drive_t *drive)
return task_error(drive, cmd, __func__, stat);

/* Didn't want any data? Odd. */
if ((stat & ATA_DRQ) == 0)
return task_in_unexpected(drive, cmd, stat);
if ((stat & ATA_DRQ) == 0) {
/* Command all done? */
if (OK_STAT(stat, ATA_DRDY, ATA_BUSY)) {
ide_finish_cmd(drive, cmd, stat);
return ide_stopped;
}

/* Assume it was a spurious irq */
ide_set_handler(drive, &task_pio_intr, WAIT_WORSTCASE,
NULL);

return ide_started;
}
} else {
if (!OK_STAT(stat, DRIVE_READY, drive->bad_wstat))
return task_error(drive, cmd, __func__, stat);
Expand Down

0 comments on commit 7e6d787

Please sign in to comment.