linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jiho@c-zone.net
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: torvalds@osdl.org, akpm@osdl.org, alan@lxorguk.ukuu.org.uk,
	B.Zolnierkiewicz@elka.pw.edu.pl, vojtech@suse.cz
Subject: [PATCH] 2.6.0-test1 - IDE driver VIA support (obscure bug)
Date: Sun, 20 Jul 2003 14:44:42 -0700	[thread overview]
Message-ID: <3F1B0D4A.8000908@c-zone.net> (raw)

(Apoligies if line-wrapping is nuts, I've been confined to Mozilla....)

This patch fixes a *very* obscure bug, which only applies to VIA chipsets that
support UDMA-133 mode, and which is only known to be tickled by one UDMA-66 hard
drive (Maxtor 91360U4) that happens to report 80-wire cable detection opposite to
the ATA standard.

The bug appears in a test to see how the BIOS set up UDMA timing.  This test is
only reached when the drive says 80-wire *and* the chipset says 40-wire (which is
only known to happen with this drive).

The timing bits that are checked represent clocks T minus 2, i.e., ((N - 2) * T).
But Vojtech forgot to subtract 2, and applied N = 8 rather than N = 6 in the
test.  Since the test masks the bits at 7, they are always less than 8, and the
test always succeeds, even though the BIOS set UDMA-33.


--- drivers/ide/pci/via82cxxx.c-orig	Fri Jun 13 07:51:33 2003
+++ drivers/ide/pci/via82cxxx.c	Sun Jul 20 11:38:42 2003
@@ -484,7 +484,7 @@
			for (i = 24; i >= 0; i -= 8)
				if (((u >> i) & 0x10) ||
				    (((u >> i) & 0x20) &&
-				     (((u >> i) & 7) < 8))) {
+				     (((u >> i) & 7) < 6))) {
					/* BIOS 80-wire bit or
					 * UDMA w/ < 60ns/cycle
					 */




                 reply	other threads:[~2003-07-20 21:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=3F1B0D4A.8000908@c-zone.net \
    --to=jiho@c-zone.net \
    --cc=B.Zolnierkiewicz@elka.pw.edu.pl \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    --cc=vojtech@suse.cz \
    /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).