*** ./ide-probe.c Sun Sep 9 17:35:01 2001 --- /usr/src/linux/drivers/ide/ide-probe.c Tue Sep 18 20:48:25 2001 *************** static inline void do_identify (ide_driv *** 176,181 **** --- 176,183 ---- return; } + int ide_disable_irq_on_probe = 0; + /* * try_to_identify() sends an ATA(PI) IDENTIFY request to a drive * and waits for a response. It also monitors irqs while this is *************** static int actual_try_to_identify (ide_d *** 213,223 **** --- 215,234 ---- if ((cmd == WIN_PIDENTIFY)) OUT_BYTE(0,IDE_FEATURE_REG); /* disable dma & overlap */ + if (ide_disable_irq_on_probe == 1) + { + disable_irq(HWIF(drive)->irq); + } + #if CONFIG_BLK_DEV_PDC4030 if (HWIF(drive)->chipset == ide_pdc4030) { /* DC4030 hosted drives need their own identify... */ extern int pdc4030_identify(ide_drive_t *); if (pdc4030_identify(drive)) { + if (ide_disable_irq_on_probe == 1) + { + enable_irq(HWIF(drive)->irq); + } return 1; } } else *************** static int actual_try_to_identify (ide_d *** 227,238 **** --- 238,254 ---- timeout += jiffies; do { if (0 < (signed long)(jiffies - timeout)) { + if (ide_disable_irq_on_probe == 1) + { + enable_irq(HWIF(drive)->irq); + } return 1; /* drive timed-out */ } ide_delay_50ms(); /* give drive a breather */ } while (IN_BYTE(hd_status) & BUSY_STAT); ide_delay_50ms(); /* wait for IRQ and DRQ_STAT */ + if (OK_STAT(GET_STAT(),DRQ_STAT,BAD_R_STAT)) { unsigned long flags; __save_flags(flags); /* local CPU only */ *************** static int actual_try_to_identify (ide_d *** 242,248 **** --- 258,272 ---- (void) GET_STAT(); /* clear drive IRQ */ __restore_flags(flags); /* local CPU only */ } else + { rc = 2; /* drive refused ID */ + } + + if (ide_disable_irq_on_probe == 1) + { + enable_irq(HWIF(drive)->irq); + } + return rc; }