]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[PATCH] ide: fix error handling for drives which clear the FIFO on error
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Wed, 28 Jun 2006 11:27:01 +0000 (04:27 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 28 Jun 2006 21:59:06 +0000 (14:59 -0700)
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>
drivers/ide/ide-io.c
include/linux/ide.h

index 935cb2583770fa567c7c531dbda03d5d0f935985..26ceab1e90bb5d94f71100e6239349343cd849cc 100644 (file)
@@ -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))
index ef7bef207f48d3ae0b458c063e788eaf69f803d3..0c100168c0cf2e20f5dc53ce83290545b2961876 100644 (file)
@@ -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() */