libata: fix last_ctl caching in ata_tf_read()

last_ctl was not cached properly. (Pointed out
by Tejun Heo.)

Signed-off-by: Chuck Ebbert <[EMAIL PROTECTED]>

---
(Apply after Petr's patch to fix SMART bugs.)

 drivers/ata/libata-sff.c |    4 ++++
 1 file changed, 4 insertions(+)

--- 2.6.22-d390.orig/drivers/ata/libata-sff.c
+++ 2.6.22-d390/drivers/ata/libata-sff.c
@@ -196,7 +196,9 @@ void ata_tf_read(struct ata_port *ap, st
 {
        struct ata_ioports *ioaddr = &ap->ioaddr;
 
+       ap->last_ctl = tf->ctl;
        iowrite8(tf->ctl, ioaddr->ctl_addr);
+
        tf->command = ata_check_status(ap);
        tf->feature = ioread8(ioaddr->error_addr);
        tf->nsect = ioread8(ioaddr->nsect_addr);
@@ -206,7 +208,9 @@ void ata_tf_read(struct ata_port *ap, st
        tf->device = ioread8(ioaddr->device_addr);
 
        if (tf->flags & ATA_TFLAG_LBA48) {
+               ap->last_ctl = tf->ctl | ATA_HOB;
                iowrite8(tf->ctl | ATA_HOB, ioaddr->ctl_addr);
+
                tf->hob_feature = ioread8(ioaddr->error_addr);
                tf->hob_nsect = ioread8(ioaddr->nsect_addr);
                tf->hob_lbal = ioread8(ioaddr->lbal_addr);
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to