]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ide: change master/slave IDENTIFY order
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 13 Oct 2007 15:47:51 +0000 (17:47 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 13 Oct 2007 15:47:51 +0000 (17:47 +0200)
Need to probe slave device first to make it release PDIAG-
(this is required for correct device side cable detection).

Based on libata commit f31f0cc2f0b7527072d94d02da332d9bb8d7d94c.

Thanks to Craig for testing this patch.

Cc: Craig Block <chblock3@yahoo.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-iops.c
drivers/ide/ide-probe.c

index f5e73e2950d433664e82d387675dda5f5bd62f50..bb691f2eb5bff539659d8fb71f39f65395a16263 100644 (file)
@@ -613,7 +613,6 @@ u8 eighty_ninty_three (ide_drive_t *drive)
 
        /*
         * FIXME:
-        * - change master/slave IDENTIFY order
         * - force bit13 (80c cable present) check also for !ivb devices
         *   (unless the slave device is pre-ATA3)
         */
index b4c9f63a38544b68123a03ab9fc44947530c623b..d1011712601c9a01913d143200c615d713d4bae2 100644 (file)
@@ -719,9 +719,9 @@ EXPORT_SYMBOL_GPL(ide_undecoded_slave);
  */
 static void probe_hwif(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif))
 {
-       unsigned int unit;
        unsigned long flags;
        unsigned int irqd;
+       int unit;
 
        if (hwif->noprobe)
                return;
@@ -777,10 +777,9 @@ static void probe_hwif(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif))
                printk(KERN_DEBUG "%s: Wait for ready failed before probe !\n", hwif->name);
 
        /*
-        * Second drive should only exist if first drive was found,
-        * but a lot of cdrom drives are configured as single slaves.
+        * Need to probe slave device first to make it release PDIAG-.
         */
-       for (unit = 0; unit < MAX_DRIVES; ++unit) {
+       for (unit = MAX_DRIVES - 1; unit >= 0; unit--) {
                ide_drive_t *drive = &hwif->drives[unit];
                drive->dn = (hwif->channel ? 2 : 0) + unit;
                (void) probe_for_drive(drive);