linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Warner <andyw@pobox.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: linux-ide@vger.kernel.org
Subject: libata - error register patch.
Date: Wed, 29 Sep 2004 17:50:11 -0500	[thread overview]
Message-ID: <20040929175011.L15041@florence.linkmargin.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 398 bytes --]

It's entirely possible I'm missing something either
very obvious, or very subtle, but I think the reading
of the error register in libata et al is incorrect.

Current code only reads the error register when
in LBA48 mode, and then stores it in tf->hob_feature.
Attached patch always reads it and stores it
in tf->feature.
-- 
andyw@pobox.com

Andy Warner		Voice: (612) 801-8549	Fax: (208) 575-5634

[-- Attachment #2: error_patch --]
[-- Type: text/plain, Size: 2414 bytes --]

diff -ur pre/drivers/scsi/libata-core.c post/drivers/scsi/libata-core.c
--- pre/drivers/scsi/libata-core.c	2004-09-29 17:28:02.128241280 -0500
+++ post/drivers/scsi/libata-core.c	2004-09-29 17:30:39.849416316 -0500
@@ -321,10 +321,10 @@
 	tf->lbam = inb(ioaddr->lbam_addr);
 	tf->lbah = inb(ioaddr->lbah_addr);
 	tf->device = inb(ioaddr->device_addr);
+	tf->feature = inb(ioaddr->error_addr);
 
 	if (tf->flags & ATA_TFLAG_LBA48) {
 		outb(tf->ctl | ATA_HOB, ioaddr->ctl_addr);
-		tf->hob_feature = inb(ioaddr->error_addr);
 		tf->hob_nsect = inb(ioaddr->nsect_addr);
 		tf->hob_lbal = inb(ioaddr->lbal_addr);
 		tf->hob_lbam = inb(ioaddr->lbam_addr);
@@ -353,10 +353,10 @@
 	tf->lbam = readb((void __iomem *)ioaddr->lbam_addr);
 	tf->lbah = readb((void __iomem *)ioaddr->lbah_addr);
 	tf->device = readb((void __iomem *)ioaddr->device_addr);
+	tf->feature = readb((void __iomem *)ioaddr->error_addr);
 
 	if (tf->flags & ATA_TFLAG_LBA48) {
 		writeb(tf->ctl | ATA_HOB, (void __iomem *) ap->ioaddr.ctl_addr);
-		tf->hob_feature = readb((void __iomem *)ioaddr->error_addr);
 		tf->hob_nsect = readb((void __iomem *)ioaddr->nsect_addr);
 		tf->hob_lbal = readb((void __iomem *)ioaddr->lbal_addr);
 		tf->hob_lbam = readb((void __iomem *)ioaddr->lbam_addr);
diff -ur pre/drivers/scsi/sata_svw.c post/drivers/scsi/sata_svw.c
--- pre/drivers/scsi/sata_svw.c	2004-09-29 17:32:42.396805890 -0500
+++ post/drivers/scsi/sata_svw.c	2004-09-29 17:34:39.625030054 -0500
@@ -138,9 +138,9 @@
 	lbam = tf->lbam = readw(ioaddr->lbam_addr);
 	lbah = tf->lbah = readw(ioaddr->lbah_addr);
 	tf->device = readw(ioaddr->device_addr);
+	tf->feature = readw(ioaddr->error_addr);
 
 	if (tf->flags & ATA_TFLAG_LBA48) {
-		tf->hob_feature = readw(ioaddr->error_addr) >> 8;
 		tf->hob_nsect = nsect >> 8;
 		tf->hob_lbal = lbal >> 8;
 		tf->hob_lbam = lbam >> 8;
diff -ur pre/drivers/scsi/sata_vsc.c post/drivers/scsi/sata_vsc.c
--- pre/drivers/scsi/sata_vsc.c	2004-09-29 17:32:30.539605204 -0500
+++ post/drivers/scsi/sata_vsc.c	2004-09-29 17:36:36.286359905 -0500
@@ -139,9 +139,9 @@
 	lbam = tf->lbam = readw(ioaddr->lbam_addr);
 	lbah = tf->lbah = readw(ioaddr->lbah_addr);
 	tf->device = readw(ioaddr->device_addr);
+	tf->feature = readb(ioaddr->error_addr);
 
 	if (tf->flags & ATA_TFLAG_LBA48) {
-		tf->hob_feature = readb(ioaddr->error_addr);
 		tf->hob_nsect = nsect >> 8;
 		tf->hob_lbal = lbal >> 8;
 		tf->hob_lbam = lbam >> 8;

             reply	other threads:[~2004-09-29 22:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-29 22:50 Andy Warner [this message]
2004-10-04 21:25 ` libata - error register patch Jeff Garzik
2004-10-04 21:44   ` Andy Warner

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=20040929175011.L15041@florence.linkmargin.com \
    --to=andyw@pobox.com \
    --cc=jgarzik@pobox.com \
    --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).