2001-03-29 05:30:51

by Wayne Whitney

[permalink] [raw]
Subject: 2.4.3-p8 pci_fixup_vt8363 + ASUS A7V "Optimal" = IDE disk corruption


Hi,

I'm running kernel 2.4.3-pre8 on an ASUS A7V (BIOS 1007) motherboard and
recently noticed that it sometimes corrupts my hard disk, an IBM 75GXP on
the onboard PDC20265 IDE controller. The corruption is detectable with a
simple 'dd if=/dev/urandom of=test bs=16384 count=32768; cp test test2 ;
diff test test2'.

I traced the problem to a combination of choosing "Optimal" for the System
Permorfance Setting in the BIOS and the the new pci_fixup_vt8363 added to
arch/i386/kernel/pci-pc.c in kernel 2.4.3-pre3. So I did a bunch of tests
using no pci_fixup function, the pci_fixup_vt8363 function, and the
following subset of pci_fixup_vt8363:

pci_read_config_byte(d, 0x54, &tmp);
if(tmp & (1<<2)) {
printk("PCI: Bus master Pipeline request disabled\n");
pci_write_config_byte(d, 0x54, tmp & ~(1<<2));
}
pci_read_config_byte(d, 0x70, &tmp);
if(tmp & (1<<2)) {
printk("PCI: Disabled Master Read Caching\n");
pci_write_config_byte(d, 0x70, tmp & ~(1<<2));
}

The results for me:
Normal Optimal
------ -------
no pci_fixup no corruption no corruption
pci_fixup_vt8363 subset corruption corruption
pci_fixup_vt8363 no corruption corruption

At this point my skills and perseverance gave out, but if someone would
like me to do a few more specific tests, I could.

Below is the output of 'lspci -xxx -s 0:0' on this hardware, with no
pci_fixup, for both the Normal and Optimal BIOS settings, in the form of a
unified diff. Hopefully this will shed some light on what the BIOS is
doing, as we don't see to have pci_fixup_vt8363 quite right yet.

Cheers,
Wayne


[root@pizza /mnt]# diff -u --unified=20 normal optimal
--- normal Wed Mar 28 20:37:57 2001
+++ optimal Wed Mar 28 20:35:32 2001
@@ -1,18 +1,18 @@
00:00.0 Host bridge: VIA Technologies, Inc. VT8363/8365 [KT133/KM133] (rev 02)
00: 06 11 05 03 06 00 10 22 02 00 00 06 00 00 00 00
10: 08 00 00 e4 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 43 10 33 80
30: 00 00 00 00 a0 00 00 00 00 00 00 00 00 00 00 00
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50: 17 a4 6b b4 07 89 20 20 80 80 10 10 10 10 20 20
-60: 33 ff 55 a0 d4 d4 d4 00 40 78 86 2f 08 23 00 00
-70: d8 c0 cc 0d 0e a1 d2 00 01 b4 09 02 00 00 00 03
+60: 33 ff 55 a0 d4 d4 d4 00 44 5c 86 2f 08 23 00 00
+70: de c0 cc 0d 0e a1 d2 00 01 b4 19 02 00 00 00 03
80: 0f 40 00 00 c0 00 00 00 03 00 25 1f 00 00 00 00
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a0: 02 c0 20 00 17 02 00 1f 00 00 00 00 6e 02 14 00
b0: 62 ec 80 e5 32 33 28 00 00 00 00 00 00 00 00 00
c0: 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 0e 22 00 00 00 00 00 91 06


2001-03-29 12:06:04

by Todd M. Roy

[permalink] [raw]
Subject: re: 2.4.3-p8 pci_fixup_vt8363 + ASUS A7V "Optimal" = IDE disk corruption

Wayne,
I have also been seeing disk corruption with my ASUS A7V with both
2.4.3-pre7 and pre8.

-- todd --

Hi,

I'm running kernel 2.4.3-pre8 on an ASUS A7V (BIOS 1007) motherboard and
recently noticed that it sometimes corrupts my hard disk, an IBM 75GXP
on
the onboard PDC20265 IDE controller. The corruption is detectable with
a
simple 'dd if=/dev/urandom of=test bs=16384 count=32768; cp test test2 ;
diff test test2'.

I traced the problem to a combination of choosing "Optimal" for the
System
Permorfance Setting in the BIOS and the the new pci_fixup_vt8363 added
to
arch/i386/kernel/pci-pc.c in kernel 2.4.3-pre3. So I did a bunch of
tests
using no pci_fixup function, the pci_fixup_vt8363 function, and the
following subset of pci_fixup_vt8363:

pci_read_config_byte(d, 0x54, &tmp);
if(tmp & (1<<2)) {
printk("PCI: Bus master Pipeline request disabled\n");
pci_write_config_byte(d, 0x54, tmp & ~(1<<2));
}
pci_read_config_byte(d, 0x70, &tmp);
if(tmp & (1<<2)) {
printk("PCI: Disabled Master Read Caching\n");
pci_write_config_byte(d, 0x70, tmp & ~(1<<2));
}

The results for me:
Normal Optimal
------ -------
no pci_fixup no corruption no corruption
pci_fixup_vt8363 subset corruption corruption
pci_fixup_vt8363 no corruption corruption

At this point my skills and perseverance gave out, but if someone would
like me to do a few more specific tests, I could.

Below is the output of 'lspci -xxx -s 0:0' on this hardware, with no
pci_fixup, for both the Normal and Optimal BIOS settings, in the form of
a
unified diff. Hopefully this will shed some light on what the BIOS is
doing, as we don't see to have pci_fixup_vt8363 quite right yet.

Cheers,
Wayne


--
.~. Todd Roy, Senior Database Administrator .~.
/V\ Holstein Association, U.S.A. Inc. /V\
// \\ [email protected] // \\
/( )\ 1-802-254-4551x4230 /( )\
^^-^^ ^^-^^

2001-03-29 16:18:23

by Arjan van de Ven

[permalink] [raw]
Subject: Re: 2.4.3-p8 pci_fixup_vt8363 + ASUS A7V "Optimal" = IDE disk corruption

On Wed, Mar 28, 2001 at 09:29:46PM -0800, Wayne Whitney wrote:

> I'm running kernel 2.4.3-pre8 on an ASUS A7V (BIOS 1007) motherboard and
> recently noticed that it sometimes corrupts my hard disk, an IBM 75GXP on
> the onboard PDC20265 IDE controller. The corruption is detectable with a
> simple 'dd if=/dev/urandom of=test bs=16384 count=32768; cp test test2 ;
> diff test test2'.


/me throws arms in the air in despiration
It seems that the exact same settings corrupt a lot on one board and not on
another. But if you remove the quirk, the corruption is the
other way around........

Greetings,
Arjan van de Ven

2001-03-29 18:10:44

by Wayne Whitney

[permalink] [raw]
Subject: Re: 2.4.3-p8 pci_fixup_vt8363 + ASUS A7V "Optimal" = IDE disk corruption

On 29 Mar 2001, Juan Quintela wrote:

> Hi I have the same motherboard and BIOS version. I was having
> filesystem corruption. There is a bugfix (from Arjan van der Ven) in
> the ac tree (around ac20 I think), could you test the last ac patch
> and test if the filesystem corruption persist??

I took a look at 2.4.2-ac28; rather than test the kernel itself, I used
setpci to duplicate what the fixup function does. The upshot is that
2.4.2-ac28 does not cause any corruption with the ASUS A7V 1007 "Optimal".
Its pci_fixup_vt8363 function has a subset of the tests from 2.4.3-pre8,
namely it omits:

pci_read_config_byte(d, 0x54, &tmp);
if(tmp & (1)) {
printk("PCI: Fast Write to Read turnaround disabled\n");
pci_write_config_byte(d, 0x54, tmp & ~(1));
}
pci_read_config_byte(d, 0x70, &tmp);
if(tmp & (1<<2)) {
printk("PCI: Disabled Master Read Caching\n");
pci_write_config_byte(d, 0x70, tmp & ~(1<<2));
}

This second test was part of the 2.4.3-pre8 pci_fixup_vt8363 subset from
my previous email which causes corruption on the ASUS A7V 1007 for both
Optimal and Normal settings. I verified that if I add it back in, I do
get corruption with ASUS A7V 1007 "Optimal". By omitting it, I guess
2.4.2-ac28 avoids the corruption of 2.4.3-pre8.

Perhaps 2.4.3-pre9 should adopt the pci_fixup_vt8363 from 2.4.2-ac28?
Below is a patch.

Cheers,
Wayne

--- linux-2.4.3-pre8/arch/i386/kernel/pci-pc.c Wed Mar 28 22:56:04 2001
+++ linux-2.4.2-ac28/arch/i386/kernel/pci-pc.c Wed Mar 28 22:51:00 2001
@@ -968,23 +971,13 @@
printk("PCI: Bus master Pipeline request disabled\n");
pci_write_config_byte(d, 0x54, tmp & ~(1<<2));
}
- pci_read_config_byte(d, 0x54, &tmp);
- if(tmp & (1)) {
- printk("PCI: Fast Write to Read turnaround disabled\n");
- pci_write_config_byte(d, 0x54, tmp & ~(1));
- }
pci_read_config_byte(d, 0x70, &tmp);
if(tmp & (1<<3)) {
printk("PCI: Disabled enhanced CPU to PCI writes\n");
pci_write_config_byte(d, 0x70, tmp & ~(1<<3));
}
- pci_read_config_byte(d, 0x70, &tmp);
- if(tmp & (1<<2)) {
- printk("PCI: Disabled Master Read Caching\n");
- pci_write_config_byte(d, 0x70, tmp & ~(1<<2));
- }
pci_read_config_byte(d, 0x71, &tmp);
- if ((tmp & (1<<3))==0) {
+ if((tmp & (1<<3)) == 0) {
printk("PCI: Bursting cornercase bug worked around\n");
pci_write_config_byte(d, 0x71, tmp | (1<<3));
}