Crash in IDE code
Forwarded SuSE Mail
suse at linux-ide.org
Sun Jul 9 18:09:49 EST 2000
Apply this against any 2.4.0-test3 and it should go.
If this fails then holler.
Cheers,
Andre Hedrick
The Linux ATA/IDE guy
-------------- next part --------------
diff -urN linux-2.4.0-t3-6/drivers/ide/ide.c linux-2.4.0-t3-6.1/drivers/ide/ide.c
--- linux-2.4.0-t3-6/drivers/ide/ide.c Sat Jul 8 02:01:18 2000
+++ linux-2.4.0-t3-6.1/drivers/ide/ide.c Sat Jul 8 22:42:09 2000
@@ -481,13 +481,19 @@
*/
static inline int drive_is_ready (ide_drive_t *drive)
{
+ byte stat = 0;
if (drive->waiting_for_dma)
return HWIF(drive)->dmaproc(ide_dma_test_irq, drive);
#if 0
udelay(1); /* need to guarantee 400ns since last command was issued */
#endif
-// if (GET_STAT() & BUSY_STAT) /* Note: this may clear a pending IRQ!! */
- if (IN_BYTE(IDE_ALTSTATUS_REG) & BUSY_STAT)
+
+ if (IDE_CONTROL_REG)
+ stat = GET_ALTSTAT();
+ else
+ stat = GET_STAT(); /* Note: this may clear a pending IRQ!! */
+
+ if (stat & BUSY_STAT)
return 0; /* drive busy: definitely not interrupting */
return 1; /* drive ready: *might* be interrupting */
}
diff -urN linux-2.4.0-t3-6/include/linux/ide.h linux-2.4.0-t3-6.1/include/linux/ide.h
--- linux-2.4.0-t3-6/include/linux/ide.h Sat Jul 8 02:01:29 2000
+++ linux-2.4.0-t3-6.1/include/linux/ide.h Sat Jul 8 22:53:04 2000
@@ -162,6 +162,7 @@
#define GET_ERR() IN_BYTE(IDE_ERROR_REG)
#define GET_STAT() IN_BYTE(IDE_STATUS_REG)
+#define GET_ALTSTAT() IN_BYTE(IDE_CONTROL_REG)
#define OK_STAT(stat,good,bad) (((stat)&((good)|(bad)))==(good))
#define BAD_R_STAT (BUSY_STAT | ERR_STAT)
#define BAD_W_STAT (BAD_R_STAT | WRERR_STAT)
More information about the Linuxppc-dev
mailing list