lkml.org 
[lkml]   [1998]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectSmall 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 */
\
 
 \ /
  Last update: 2005-03-22 13:44    [W:0.051 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site