Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4742d54fa4b391342dfb8f34de14d51da101fb39
Commit:     4742d54fa4b391342dfb8f34de14d51da101fb39
Parent:     59117d3f4e3f5a7980353d2f476e516c758ce921
Author:     Mark Lord <[EMAIL PROTECTED]>
AuthorDate: Mon Apr 2 16:20:35 2007 -0400
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Wed Apr 4 02:07:28 2007 -0400

    2.6.21 fix lba48 bug in libata fill_result_tf()
    
    Current 2.6.21 libata does the following:
    
    void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
    {
            struct ata_ioports *ioaddr = &ap->ioaddr;
    
            tf->command = ata_check_status(ap);
        ...
            if (tf->flags & ATA_TFLAG_LBA48) {
                    iowrite8(tf->ctl | ATA_HOB, ioaddr->ctl_addr);
                    tf->hob_feature = ioread8(ioaddr->error_addr);
                    ...
            }
    }
    ...
    static void fill_result_tf(struct ata_queued_cmd *qc)
    {
            struct ata_port *ap = qc->ap;
    
            ap->ops->tf_read(ap, &qc->result_tf);
            qc->result_tf.flags = qc->tf.flags;
    }
    
    Based on this, those last two statements fill_result_tf()
    appear to me to be in the wrong order, in that the tf->flags
    are uninitialized at the point where tf_read() is invoked.
    So for lba48 commands, tf_read() won't be reading back the
    full lba48 register contents..
    
    Correct?
    
    This patch corrects fill_result_tf() so that the flags
    get copied to result_tf before they are used by tf_read().
    
    Signed-off-by:  Mark Lord <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/ata/libata-core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index ddb3909..e07142b 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4717,8 +4717,8 @@ static void fill_result_tf(struct ata_queued_cmd *qc)
 {
        struct ata_port *ap = qc->ap;
 
-       ap->ops->tf_read(ap, &qc->result_tf);
        qc->result_tf.flags = qc->tf.flags;
+       ap->ops->tf_read(ap, &qc->result_tf);
 }
 
 /**
-
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