linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chuck Ebbert <cebbert@redhat.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: IDE/ATA development list <linux-ide@vger.kernel.org>
Subject: [patch] libata: fix last_ctl caching in ata_tf_read()
Date: Tue, 17 Jul 2007 09:53:39 -0400	[thread overview]
Message-ID: <469CC9E3.4030907@redhat.com> (raw)

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 <cebbert@redhat.com>

---
(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);

             reply	other threads:[~2007-07-17 13:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-17 13:53 Chuck Ebbert [this message]
2007-07-20 11:46 ` [patch] libata: fix last_ctl caching in ata_tf_read() Jeff Garzik
  -- strict thread matches above, loose matches on Subject: below --
2007-07-16 18:35 Chuck Ebbert
2007-07-16 23:13 ` Mark Lord

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=469CC9E3.4030907@redhat.com \
    --to=cebbert@redhat.com \
    --cc=jeff@garzik.org \
    --cc=linux-ide@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).