Skip to content

Commit

Permalink
[PATCH] ide: fix error handling for drives which clear the FIFO on error
Browse files Browse the repository at this point in the history
If the controller FIFO cleared automatically on error we must not try
and drain it as this will hang some chips.

Based in concept on a broken patch from -mm some while back

Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Alan Cox authored and Linus Torvalds committed Jun 28, 2006
1 parent 2930d1b commit da574af
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/ide/ide-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ static ide_startstop_t ide_ata_error(ide_drive_t *drive, struct request *rq, u8
}
}

if ((stat & DRQ_STAT) && rq_data_dir(rq) == READ)
if ((stat & DRQ_STAT) && rq_data_dir(rq) == READ && hwif->err_stops_fifo == 0)
try_to_flush_leftover_data(drive);

if (hwif->INB(IDE_STATUS_REG) & (BUSY_STAT|DRQ_STAT))
Expand Down
1 change: 1 addition & 0 deletions include/linux/ide.h
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,7 @@ typedef struct hwif_s {
unsigned auto_poll : 1; /* supports nop auto-poll */
unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */
unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */
unsigned err_stops_fifo : 1; /* 1=data FIFO is cleared by an error */

struct device gendev;
struct completion gendev_rel_comp; /* To deal with device release() */
Expand Down

0 comments on commit da574af

Please sign in to comment.