patch-2.2.15 linux/drivers/block/ide.c

Next file: linux/drivers/block/ide_modes.h
Previous file: linux/drivers/block/ide-probe.c
Back to the patch index
Back to the overall index

diff -u --new-file --recursive --exclude-from ../../exclude v2.2.14/drivers/block/ide.c linux/drivers/block/ide.c
@@ -598,14 +598,16 @@
 
 static void pre_reset (ide_drive_t *drive)
 {
+	if (drive->driver != NULL)
+		DRIVER(drive)->pre_reset(drive);
 	if (!drive->keep_settings) {
-		drive->unmask = 0;
-		drive->io_32bit = 0;
-		if (drive->using_dma)
+		if (drive->using_dma) {
 			(void) HWIF(drive)->dmaproc(ide_dma_off, drive);
+		} else {
+			drive->unmask = 0;
+			drive->io_32bit = 0;
+		}
 	}
-	if (drive->driver != NULL)
-		DRIVER(drive)->pre_reset(drive);
 }
 
 /*
@@ -830,8 +832,8 @@
 		if ((stat & DRQ_STAT) && rq->cmd != WRITE)
 			try_to_flush_leftover_data(drive);
 	}
-	if (GET_STAT() & (BUSY_STAT|DRQ_STAT))
-		rq->errors |= ERROR_RESET;	/* Mmmm.. timing problem */
+	if (GET_STAT() & (BUSY_STAT|DRQ_STAT))	/* possible timing problem? */
+		OUT_BYTE(WIN_IDLEIMMEDIATE,IDE_COMMAND_REG); /* force an abort */
 
 	if (rq->errors >= ERROR_MAX) {
 		if (drive->driver != NULL)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)