Small patch for drivers/block/ide-probe.c

robin 'xer.xes' putters (xer.xes@wxs.nl)
Sun, 13 Sep 1998 17:13:19 +0200


This is a multi-part message in MIME format.
--------------771C2DF4D546657C2454AF94
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I've made a small patch for a bug in ide-probe.c wich prevented my CD-Rom from being detected.

--------------771C2DF4D546657C2454AF94
Content-Type: text/plain; charset=us-ascii; name="ide-probe-bug-patch.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="ide-probe-bug-patch.diff"

--- 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 */

--------------771C2DF4D546657C2454AF94--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/faq.html