]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ide: PIO-out error handling fixes (CONFIG_IDE_TASKFILE_IO=y)
authorBartlomiej Zolnierkiewicz <b.zolnierkiewicz@elka.pw.edu.pl>
Wed, 14 Jul 2004 10:41:21 +0000 (03:41 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 14 Jul 2004 10:41:21 +0000 (03:41 -0700)
We shouldn't ever get into ->handler() if drive is busy so
just call ->error() unconditionally if status check fails.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/ide/ide-taskfile.c

index ee6d885dc2b83e3966df34f4b2a60d843f613e5c..74339e6f16b4c7eff29d40f956e0404ccf6a6edb 100644 (file)
@@ -646,16 +646,8 @@ ide_startstop_t task_out_intr (ide_drive_t *drive)
        u8 stat;
 
        stat = HWIF(drive)->INB(IDE_STATUS_REG);
-       if (!OK_STAT(stat, DRIVE_READY, drive->bad_wstat)) {
-               if ((stat & (ERR_STAT | DRQ_STAT)) ||
-                   ((stat & WRERR_STAT) && !drive->nowerr))
-                       return DRIVER(drive)->error(drive, __FUNCTION__, stat);
-               if (stat & BUSY_STAT) {
-                       /* Not ready yet, so wait for another IRQ. */
-                       ide_set_handler(drive, &task_out_intr, WAIT_WORSTCASE, NULL);
-                       return ide_started;
-               }
-       }
+       if (!OK_STAT(stat, DRIVE_READY, drive->bad_wstat))
+               return DRIVER(drive)->error(drive, __FUNCTION__, stat);
 
        /* Deal with unexpected ATA data phase. */
        if ((!(stat & DATA_READY) && rq->nr_sectors) ||
@@ -714,16 +706,8 @@ ide_startstop_t task_mulout_intr (ide_drive_t *drive)
        u8 stat;
 
        stat = HWIF(drive)->INB(IDE_STATUS_REG);
-       if (!OK_STAT(stat, DRIVE_READY, drive->bad_wstat)) {
-               if ((stat & (ERR_STAT | DRQ_STAT)) ||
-                   ((stat & WRERR_STAT) && !drive->nowerr))
-                       return DRIVER(drive)->error(drive, __FUNCTION__, stat);
-               if (stat & BUSY_STAT) {
-                       /* Not ready yet, so wait for another IRQ. */
-                       ide_set_handler(drive, &task_mulout_intr, WAIT_WORSTCASE, NULL);
-                       return ide_started;
-               }
-       }
+       if (!OK_STAT(stat, DRIVE_READY, drive->bad_wstat))
+               return DRIVER(drive)->error(drive, __FUNCTION__, stat);
 
        /* Deal with unexpected ATA data phase. */
        if ((!(stat & DATA_READY) && rq->nr_sectors) ||