Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f31f0cc2f0b7527072d94d02da332d9bb8d7d94c
Commit:     f31f0cc2f0b7527072d94d02da332d9bb8d7d94c
Parent:     032af1ce16d496b825adde0fa03948785ee16830
Author:     Jeff Garzik <[EMAIL PROTECTED]>
AuthorDate: Fri Mar 2 17:47:28 2007 -0500
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Fri Mar 2 17:47:28 2007 -0500

    [libata] change master/slave IDENTIFY order
    
    2.6.21-rc has horrible problems with libata and PATA cable types (and
    thus speeds). This occurs because Tejun fixed a pile of other bugs and
    we now do cable detect enforcement for drive side detection properly.
    
    Unfortunately we don't do the process around cable detection right. Tejun
    identified the problem and pointed to the right Annex in the spec, this 
patch
    implements the needed changes.
    
    The basic requirement is that we have to identify the slave before the
    master.
    
    The patch switches the identify order so that we can do the drive side
    detection correctly.
    
    [NOTE: patch and description extracted from a larger work written
    and signed-off-by Alan Cox]
    
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/ata/libata-core.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index eb59f16..606145e 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1850,8 +1850,11 @@ int ata_bus_probe(struct ata_port *ap)
        for (i = 0; i < ATA_MAX_DEVICES; i++)
                ap->device[i].pio_mode = XFER_PIO_0;
 
-       /* read IDENTIFY page and configure devices */
-       for (i = 0; i < ATA_MAX_DEVICES; i++) {
+       /* read IDENTIFY page and configure devices. We have to do the identify
+          specific sequence bass-ackwards so that PDIAG- is released by
+          the slave device */
+
+       for (i = ATA_MAX_DEVICES - 1; i >=  0; i--) {
                dev = &ap->device[i];
 
                if (tries[i])
@@ -1864,6 +1867,15 @@ int ata_bus_probe(struct ata_port *ap)
                                     dev->id);
                if (rc)
                        goto fail;
+       }
+
+       /* After the identify sequence we can now set up the devices. We do
+          this in the normal order so that the user doesn't get confused */
+
+       for(i = 0; i < ATA_MAX_DEVICES; i++) {
+               dev = &ap->device[i];
+               if (!ata_dev_enabled(dev))
+                       continue;
 
                ap->eh_context.i.flags |= ATA_EHI_PRINTINFO;
                rc = ata_dev_configure(dev);
-
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