Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <b.zolnierkiewicz@elka.pw.edu.pl>2004-06-04 23:01:17 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-06-04 23:01:17 -0700
commit7f1d74add33a922da1674f3b78199d09adddbe30 (patch)
treeacde418f954908c0c7941c871fcba4c7c82d14cc
parentb53259fa2ee8561e7904dea9cbd40e52a263b134 (diff)
[PATCH] ide: use try_to_flush_leftover_data() in idedisk_error()
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/ide/ide-disk.c19
-rw-r--r--include/linux/ide.h2
2 files changed, 4 insertions, 17 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index c10cfe589817..e86438409d2f 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -811,7 +811,6 @@ ide_startstop_t idedisk_error (ide_drive_t *drive, const char *msg, u8 stat)
ide_hwif_t *hwif;
struct request *rq;
u8 err;
- int i = (drive->mult_count ? drive->mult_count : 1) * SECTOR_WORDS;
err = idedisk_dump_status(drive, msg, stat);
@@ -851,22 +850,8 @@ ide_startstop_t idedisk_error (ide_drive_t *drive, const char *msg, u8 stat)
rq->errors |= ERROR_RECAL;
}
}
- if ((stat & DRQ_STAT) && rq_data_dir(rq) == READ) {
- /*
- * try_to_flush_leftover_data() is invoked in response to
- * a drive unexpectedly having its DRQ_STAT bit set. As
- * an alternative to resetting the drive, this routine
- * tries to clear the condition by read a sector's worth
- * of data from the drive. Of course, this may not help
- * if the drive is *waiting* for data from *us*.
- */
- while (i > 0) {
- u32 buffer[16];
- unsigned int wcount = (i > 16) ? 16 : i;
- i -= wcount;
- taskfile_input_data(drive, buffer, wcount);
- }
- }
+ if ((stat & DRQ_STAT) && rq_data_dir(rq) == READ)
+ try_to_flush_leftover_data(drive);
if (hwif->INB(IDE_STATUS_REG) & (BUSY_STAT|DRQ_STAT)) {
/* force an abort */
hwif->OUTB(WIN_IDLEIMMEDIATE,IDE_COMMAND_REG);
diff --git a/include/linux/ide.h b/include/linux/ide.h
index aab7091972e2..d752e2f64fb7 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1359,6 +1359,8 @@ extern int ide_do_drive_cmd(ide_drive_t *, struct request *, ide_action_t);
*/
extern void ide_end_drive_cmd(ide_drive_t *, u8, u8);
+extern void try_to_flush_leftover_data(ide_drive_t *);
+
/*
* Issue ATA command and wait for completion.
* Use for implementing commands in kernel