Messages in this thread Patch in this message | | | Date | Sun, 13 Sep 1998 17:13:19 +0200 | From | "robin 'xer.xes' putters" <> | Subject | Small patch for drivers/block/ide-probe.c |
| |
I've made a small patch for a bug in ide-probe.c wich prevented my CD-Rom from being detected.
--- linux/drivers/block/ide-probe.c.OLD Sun Sep 13 16:21:32 1998 +++ linux/drivers/block/ide-probe.c Sun Sep 13 16:53:55 1998 @@ -249,6 +249,7 @@ { int rc; ide_hwif_t *hwif = HWIF(drive); + unsigned long timeout; if (drive->present) { /* avoid waiting for inappropriate probes */ if ((drive->media != ide_disk) && (cmd == WIN_IDENTIFY)) return 4; @@ -273,6 +274,16 @@ { if ((rc = try_to_identify(drive,cmd))) /* send cmd and wait */ rc = try_to_identify(drive,cmd); /* failed: try again */ + if (rc == 1 && cmd == WIN_PIDENTIFY && drive->autotune != 2) { + delay_50ms(); + OUT_BYTE(drive->select.all, IDE_SELECT_REG); + delay_50ms(); + OUT_BYTE(WIN_SRST, IDE_COMMAND_REG); + timeout = jiffies; + while ((GET_STAT() & BUSY_STAT) && jiffies < timeout + WAIT_WORSTCASE) + delay_50ms(); + rc = try_to_identify(drive, cmd); + } if (rc == 1) printk("%s: no response (status = 0x%02x)\n", drive->name, GET_STAT()); (void) GET_STAT(); /* ensure drive irq is clear */ | |