Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8266105b15192177ac732ab8a27b315dc9291100
Commit:     8266105b15192177ac732ab8a27b315dc9291100
Parent:     8ac98ce17cf318f6ceb1eb88053917001f5ca60a
Author:     Jonas Stare <[EMAIL PROTECTED]>
AuthorDate: Tue Nov 27 21:35:53 2007 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Tue Nov 27 21:35:53 2007 +0100

    ide: skip ide_wait_not_busy() on noprobe-disks
    
    There is a problem in some hardware where the kernel will stall for
    35 seconds waiting for disks that don't exist. This patch will skip
    waiting for the BSY-bit on IDE drives to go away if you set "hdx=noprobe"
    as a kernel option and the disk is not marked as 'present' (like when
    you set the geometry by hand).
    
    If no noprobe-option is set the code will work (more or less) as the
    original but if set the code will skip the ide_wait_not_busy() for
    that drive. Even if there would be a drive there and it is still busy
    afterwards it should not matter since it isn't probed for later.
    
    The code also honors the MAX_DRIVES variable instead of assuming that
    there will be two harddrives on the bus.
    
    Bart: minor cleanups
    
    Signed-off-by: Jonas Stare <[EMAIL PROTECTED]>
    CC: Andrew Morton <[EMAIL PROTECTED]>,
    Cc: Linus Torvalds <[EMAIL PROTECTED]>
    Cc: Alan Cox <[EMAIL PROTECTED]>
    Cc: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
    Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-probe.c |   32 +++++++++++++++++++-------------
 1 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 56fb0b8..ee848c7 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -644,7 +644,7 @@ static void hwif_register (ide_hwif_t *hwif)
 
 static int wait_hwif_ready(ide_hwif_t *hwif)
 {
-       int rc;
+       int unit, rc;
 
        printk(KERN_DEBUG "Probing IDE interface %s...\n", hwif->name);
 
@@ -661,20 +661,26 @@ static int wait_hwif_ready(ide_hwif_t *hwif)
                return rc;
 
        /* Now make sure both master & slave are ready */
-       SELECT_DRIVE(&hwif->drives[0]);
-       hwif->OUTB(8, hwif->io_ports[IDE_CONTROL_OFFSET]);
-       mdelay(2);
-       rc = ide_wait_not_busy(hwif, 35000);
-       if (rc)
-               return rc;
-       SELECT_DRIVE(&hwif->drives[1]);
-       hwif->OUTB(8, hwif->io_ports[IDE_CONTROL_OFFSET]);
-       mdelay(2);
-       rc = ide_wait_not_busy(hwif, 35000);
+       for (unit = 0; unit < MAX_DRIVES; unit++) {
+               ide_drive_t *drive = &hwif->drives[unit];
 
+               /* Ignore disks that we will not probe for later. */
+               if (!drive->noprobe || drive->present) {
+                       SELECT_DRIVE(drive);
+                       hwif->OUTB(8, hwif->io_ports[IDE_CONTROL_OFFSET]);
+                       mdelay(2);
+                       rc = ide_wait_not_busy(hwif, 35000);
+                       if (rc)
+                               goto out;
+               } else
+                       printk(KERN_DEBUG "%s: ide_wait_not_busy() skipped\n",
+                                         drive->name);
+       }
+out:
        /* Exit function with master reselected (let's be sane) */
-       SELECT_DRIVE(&hwif->drives[0]);
-       
+       if (unit)
+               SELECT_DRIVE(&hwif->drives[0]);
+
        return rc;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to