Commit 613d9c3b authored by Jim Howard's avatar Jim Howard Committed by Linus Torvalds

[PATCH] IDE driver VIA support (obscure bug)

This 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.
parent 41bb852b
...@@ -484,7 +484,7 @@ static unsigned int __init init_chipset_via82cxxx(struct pci_dev *dev, const cha ...@@ -484,7 +484,7 @@ static unsigned int __init init_chipset_via82cxxx(struct pci_dev *dev, const cha
for (i = 24; i >= 0; i -= 8) for (i = 24; i >= 0; i -= 8)
if (((u >> i) & 0x10) || if (((u >> i) & 0x10) ||
(((u >> i) & 0x20) && (((u >> i) & 0x20) &&
(((u >> i) & 7) < 8))) { (((u >> i) & 7) < 6))) {
/* BIOS 80-wire bit or /* BIOS 80-wire bit or
* UDMA w/ < 60ns/cycle * UDMA w/ < 60ns/cycle
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment