Skip to contentSkip to conversation

PATCH: Fix error handling for drives which clear the FIFO on error

PATCH Alan Cox 1 participant 1 message Jun 26, 2006 libata

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

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

drivers/ide/ide-io.c +1 -1
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.17/drivers/ide/ide-io.c linux-2.6.17/drivers/ide/ide-io.c
@@ -444,7 +444,7 @@
 		}
 	}
 
-	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))
include/linux/ide.h +1 -0
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.17/include/linux/ide.h linux-2.6.17/include/linux/ide.h
@@ -793,6 +793,7 @@
 	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() */