aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2006-06-28 07:27:01 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-28 17:59:06 -0400
commitda574af755bcb1d604e01feadf2a8c31b364447c (patch)
treede8548adf6ea7205314f0813afb3fb83a9e7da6a
parent2930d1bed7ffea3062e43b8acdeb9e0587bfc6a9 (diff)
[PATCH] ide: fix error handling for drives which clear the FIFO on error
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>
-rw-r--r--drivers/ide/ide-io.c2
-rw-r--r--include/linux/ide.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 935cb2583770..26ceab1e90bb 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -505,7 +505,7 @@ static ide_startstop_t ide_ata_error(ide_drive_t *drive, struct request *rq, u8
505 } 505 }
506 } 506 }
507 507
508 if ((stat & DRQ_STAT) && rq_data_dir(rq) == READ) 508 if ((stat & DRQ_STAT) && rq_data_dir(rq) == READ && hwif->err_stops_fifo == 0)
509 try_to_flush_leftover_data(drive); 509 try_to_flush_leftover_data(drive);
510 510
511 if (hwif->INB(IDE_STATUS_REG) & (BUSY_STAT|DRQ_STAT)) 511 if (hwif->INB(IDE_STATUS_REG) & (BUSY_STAT|DRQ_STAT))
diff --git a/include/linux/ide.h b/include/linux/ide.h
index ef7bef207f48..0c100168c0cf 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -793,6 +793,7 @@ typedef struct hwif_s {
793 unsigned auto_poll : 1; /* supports nop auto-poll */ 793 unsigned auto_poll : 1; /* supports nop auto-poll */
794 unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ 794 unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */
795 unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */ 795 unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */
796 unsigned err_stops_fifo : 1; /* 1=data FIFO is cleared by an error */
796 797
797 struct device gendev; 798 struct device gendev;
798 struct completion gendev_rel_comp; /* To deal with device release() */ 799 struct completion gendev_rel_comp; /* To deal with device release() */