Skip to contentSkip to conversation

libata: fix last_ctl caching in ata_tf_read()

PATCH In review Chuck Ebbert 2 participants 2 messages Jul 17, 2007 – Jul 20, 2007 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libata: fix last_ctl caching in ata_tf_read()

libata: fix last_ctl caching in ata_tf_read()

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

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

 drivers/ata/libata-sff.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/ata/libata-sff.c +4 -0
@@ -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);
#1 lore raw
Quoted 5 lines · Chuck Ebbert

libata: fix last_ctl caching in ata_tf_read()

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

Quoted 7 lines

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

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

Petr's new patch eliminates the need for this...