2002-11-16 20:17:20

by Miguel Sousa Filipe

[permalink] [raw]
Subject: Disk Performance Issues [AMD Viper plus IDE chipset problems. (wrong udma "autodetection")]

Hello there,

I'm sending this email about a problem with udma settings
in a TigerMP motherboard, wich supports UDMA 100.
I've send it to my distribution mailing list, and several others, to no
avail, so, has a last resort I send it now to the Linux ML.
I'm using pure vanilla linux-2.4.19, and I tried all possible configs
settings that I though that could affect this problem.

Notice also, that before sending this I really probed around the
internet, and found some emails in the linux ML relating to this
problem. however, they were all pretty old(one year old), and all
problem reports related to this stopped long time ago, after some
patches from Patrick Vojtech, wich led me to think that recente kernel
versions had this problem fixed.
Following this thread:
http://www.uwsg.iu.edu/hypermail/linux/kernel/0109.3/1003.html i've
found a patch, tried to aply but failed, the patch was:
http://www.uwsg.iu.edu/hypermail/linux/kernel/0109.3/att-1176/01-viper-vojtech.diff
I'm not experienced enough to adapt the patch for 2.4.19 (the author
says it was made against 2.4.10).
I've also read one e-mail related to IDE performance on the Tyan Tiger
mobo, URL:http://lists.insecure.org/linux-kernel/2001/Dec/0544.html


I *do* have the proper cables.
The funny thing is that ONCE.. and only ONCE.. when I was trying to
solve this problem I WAS able to solve it.. and benchmarked the
disk...hdparm -t /dev/hda gave me 40.0MB/S, after enabling DMA.
Also I have tweaked with the bios settings with no luck.

The problem looks like the kernel on boot detects the disks has UDMA33
all the time, although one does UDMA 100 and the other one UDMA 66. My
drive's performance are lousy, and I know they are capable of much more,
hda is a Seagate Barracuda IV 7200rpm 2mb cache (40Gbs)
URL:
http://www.seagate.com/cda/products/discsales/marketing/detail/0,1081,384,00.html
hdc is a Seagate "ST-36421A (U4 6421, Ultra ATA/66)
URL: http://www.seagate.com/cgi-bin/view.cgi?/at/st36421a.txt


I though that my best luck was to ask if you guys, since i'm quite a
stubburn, i won't give up on this easilly, i've tried practically
everything, diferent kernel branches, bios settings, removed all extra
devices from the cables...etc
In case of being a kernel miss configuration problem.. I send attached
my kernel config file.

- If any important information is missing please warn me so I can
provide what's needed.

here's some info from hdparm, and following there's a cut from dmesg:

[191p] quark : ~ $ /sbin/hdparm -c3 -d1 -m16 -X68 /dev/hda

/dev/hda:
~ setting 32-bit IO_support flag to 3
~ setting multcount to 16
~ setting using_dma to 1 (on)
~ setting xfermode to 68 (UltraDMA mode4)
~ multcount = 16 (on)
~ IO_support = 3 (32-bit w/sync)
~ using_dma = 1 (on)
[156p] quark : ~ $ /sbin/hdparm -c3 -d1 -m16 -X66 /dev/hdd

/dev/hdd:
~ setting 32-bit IO_support flag to 3
~ setting multcount to 16
~ setting using_dma to 1 (on)
~ setting xfermode to 66 (UltraDMA mode2)
~ multcount = 16 (on)
~ IO_support = 3 (32-bit w/sync)
~ using_dma = 1 (on)
[156p] quark : ~ $ hdparm -t /dev/hda

/dev/hda:
~ Timing buffered disk reads: 64 MB in 3.91 seconds = 16.37 MB/sec
[156p] quark : ~ $ hdparm -t /dev/hdd

/dev/hdd:
~ Timing buffered disk reads: 64 MB in 4.05 seconds = 15.80 MB/sec
--(quark)-(pts0)-(16:00/04-Oct-02)--
--(m3thos#:~)-- sudo hdparm -t /dev/hda

- --(quark)-(pts0)-(13:55/10-Nov-02)--
- --(m3thos#:~)-- sudo hdparm -i /dev/hda

/dev/hda:

~ Model=ST340016A, FwRev=3.05, SerialNo=3HS0403R
~ Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs RotSpdTol>.5% }
~ RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4
~ BuffType=unknown, BuffSize=2048kB, MaxMultSect=16, MultSect=16
~ CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=78165360
~ IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}
~ PIO modes: pio0 pio1 pio2 pio3 pio4
~ DMA modes: mdma0 mdma1 mdma2
~ UDMA modes: udma0 udma1 *udma2
~ AdvancedPM=no WriteCache=enabled
~ Drive conforms to: device does not report version: 1 2 3 4 5

- --(quark)-(pts0)-(14:11/10-Nov-02)--
- --(m3thos#:~)-- sudo hdparm -i /dev/hdd

/dev/hdd:

~ Model=ST36421A, FwRev=8.01, SerialNo=6BE072C1
~ Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs RotSpdTol>.5% }
~ RawCHS=13330/15/63, TrkSize=0, SectSize=0, ECCbytes=4
~ BuffType=unknown, BuffSize=256kB, MaxMultSect=16, MultSect=16
~ CurCHS=13330/15/63, CurSects=12596850, LBA=yes, LBAsects=12596850
~ IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}
~ PIO modes: pio0 pio1 pio2 pio3 pio4
~ DMA modes: mdma0 mdma1 mdma2
~ UDMA modes: udma0 udma1 *udma2 udma3 udma4
~ AdvancedPM=no WriteCache=enabled
~ Drive conforms to: device does not report version: 1 2 3 4

- -(quark)-(pts0)-(14:11/10-Nov-02)--
- --(m3thos#:~)-- sudo hdparm -I /dev/hda

/dev/hda:

ATA device, with non-removable media
~ Model Number: ST340016A
~ Serial Number: 3HS0403R
~ Firmware Revision: 3.05
Standards:
~ Supported: 5 4 3 2
~ Likely used: 6
Configuration:
~ Logical max current
~ cylinders 16383 16383
~ heads 16 16
~ sectors/track 63 63
~ --
~ CHS current addressable sectors: 16514064
~ LBA user addressable sectors: 78165360
~ device size with M = 1024*1024: 38166 MBytes
~ device size with M = 1000*1000: 40020 MBytes (40 GB)
Capabilities:
~ LBA, IORDY(can be disabled)
~ bytes avail on r/w long: 4 Queue depth: 1
~ Standby timer values: spec'd by Standard
~ R/W multiple sector transfer: Max = 16 Current = 16
~ Recommended acoustic management value: 128, current value: 128
~ DMA: mdma0 mdma1 mdma2 udma0 udma1 *udma2 udma3 udma4 udma5
~ Cycle time: min=120ns recommended=120ns
~ PIO: pio0 pio1 pio2 pio3 pio4
~ Cycle time: no flow control=240ns IORDY flow control=120ns
Commands/features:
~ Enabled Supported:
~ * READ BUFFER cmd
~ * WRITE BUFFER cmd
~ * Host Protected Area feature set
~ * Look-ahead
~ * Write cache
~ * Power Management feature set
~ Security Mode feature set
~ * SMART feature set
~ Device Configuration Overlay feature set
~ * Automatic Acoustic Management feature set
~ SET MAX security extension
~ * DOWNLOAD MICROCODE cmd
Security:
~ Master password revision code = 65534
~ supported
~ not enabled
~ not locked
~ not frozen
~ not expired: security count
~ not supported: enhanced erase
HW reset results:
~ CBLID- below Vih
~ Device num = 1
Checksum: correct

- --(quark)-(pts0)-(14:11/10-Nov-02)--
- --(m3thos#:~)-- sudo hdparm -I /dev/hdd

/dev/hdd:

ATA device, with non-removable media
~ Model Number: ST36421A
~ Serial Number: 6BE072C1
~ Firmware Revision: 8.01
Standards:
~ Supported: 4 3 2 1
~ Likely used: 5
Configuration:
~ Logical max current
~ cylinders 13330 13330
~ heads 15 15
~ sectors/track 63 63
~ --
~ CHS current addressable sectors: 12596850
~ LBA user addressable sectors: 12596850
~ device size with M = 1024*1024: 6150 MBytes
~ device size with M = 1000*1000: 6449 MBytes (6 GB)
Capabilities:
~ LBA, IORDY(can be disabled)
~ Buffer size: 256.0kB bytes avail on r/w long: 4 Queue
depth: 1
~ Standby timer values: spec'd by Standard
~ R/W multiple sector transfer: Max = 16 Current = 16
~ DMA: mdma0 mdma1 mdma2 udma0 udma1 *udma2 udma3 udma4
~ Cycle time: min=120ns recommended=120ns
~ PIO: pio0 pio1 pio2 pio3 pio4
~ Cycle time: no flow control=240ns IORDY flow control=120ns
Commands/features:
~ Enabled Supported:
~ * READ BUFFER cmd
~ * WRITE BUFFER cmd
~ * Host Protected Area feature set
~ * Look-ahead
~ * Write cache
~ * Power Management feature set
~ * Security Mode feature set
~ SMART feature set
~ * DOWNLOAD MICROCODE cmd
Security:
~ supported
~ not enabled
~ not locked
~ not frozen
~ not expired: security count
~ not supported: enhanced erase
HW reset results:
~ CBLID- above Vih
~ Device num = 1



dmesg gives this:
--cut--
Uniform Multi-Platform E-IDE driver Revision: 6.31
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
AMD7411: IDE controller on PCI bus 00 dev 39
AMD7411: chipset revision 1
AMD7411: not 100% native mode: will probe irqs later
AMD7411: disabling single-word DMA support (revision < C4)
ide0: BM-DMA at 0xf000-0xf007, BIOS settings: hda:DMA, hdb:DMA
ide1: BM-DMA at 0xf008-0xf00f, BIOS settings: hdc:pio, hdd:DMA
hda: ST340016A, ATA DISK drive
hdb: TOSHIBA CD-ROM XM-6602B, ATAPI CD/DVD-ROM drive
hdc: PCRW804, ATAPI CD/DVD-ROM drive
hdd: ST36421A, ATA DISK drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
hda: 78165360 sectors (40021 MB) w/2048KiB Cache, CHS=77545/16/63, UDMA(33)
hdd: 12596850 sectors (6450 MB) w/256KiB Cache, CHS=13330/15/63, UDMA(33)
hdb: ATAPI 40X CD-ROM drive, 128kB Cache, UDMA(33)
--cut--



Thanx in Advance,
help me out!

Miguel Sousa Filipe



Attachments:
config-2.4.19-vanilla.gz (4.80 kB)

2002-11-16 22:59:55

by Alan

[permalink] [raw]
Subject: Re: Disk Performance Issues [AMD Viper plus IDE chipset problems. (wrong udma "autodetection")]

On Sat, 2002-11-16 at 20:19, Miguel S Filipe wrote:
> Hello there,
>
> I'm sending this email about a problem with udma settings
> in a TigerMP motherboard, wich supports UDMA 100.
> I've send it to my distribution mailing list, and several others, to no
> avail, so, has a last resort I send it now to the Linux ML.
> I'm using pure vanilla linux-2.4.19, and I tried all possible configs
> settings that I though that could affect this problem.

If I remember rightly 2.4.19 doesnt have full support for the AMD
760MP/X although

2002-11-20 02:03:58

by Manish Lachwani

[permalink] [raw]
Subject: RE: Disk Performance Issues [AMD Viper plus IDE chipset problems. (wrong udma "autodetection")]

I have noticed something with the IDE drivers especially with the Seagate
drives. The promise driver (eg 20277) detects the UDMA 5 mode correctly.

This is what it does:

byte ultra_66 = ((id->dma_ultra & 0x0010) ||
(id->dma_ultra & 0x0008)) ? 1 : 0;
byte ultra_100 = ((id->dma_ultra & 0x0020) ||
(ultra_66)) ? 1 : 0;
byte ultra_133 = ((id->dma_ultra & 0x0040) ||
(ultra_100)) ? 1 : 0;

Now, lets take a PIIX driver

int ultra100 = ((dev->device ==
PCI_DEVICE_ID_INTEL_82801BA_8) ||
(dev->device ==
PCI_DEVICE_ID_INTEL_82801BA_9) ||
(dev->device ==
PCI_DEVICE_ID_INTEL_82801CA_10)) ? 1 : 0;
int ultra66 = ((ultra100) ||
(dev->device ==
PCI_DEVICE_ID_INTEL_82801AA_1) ||
(dev->device ==
PCI_DEVICE_ID_INTEL_82372FB_1)) ? 1 : 0;

if ((id->dma_ultra & 0x0020) && (udma_66) && (ultra100)) {
speed = XFER_UDMA_5;

where ultra100 and ultra66 is not or'ed with 0x0010 and 0x0008. The final
check is only with 0x0020. I have found this issues with other IDE drivers
like amd74xx.c, serverworks.c etc. SO, make the above changes in the drivers
and u should see UDMA 5 on those seagate drives on startup ...

Thanks
Manish


-----Original Message-----
From: Alan Cox [mailto:[email protected]]
Sent: Saturday, November 16, 2002 3:34 PM
To: Miguel S Filipe
Cc: Linux Kernel Mailing List
Subject: Re: Disk Performance Issues [AMD Viper plus IDE chipset
problems. (wrong udma "autodetection")]


On Sat, 2002-11-16 at 20:19, Miguel S Filipe wrote:
> Hello there,
>
> I'm sending this email about a problem with udma settings
> in a TigerMP motherboard, wich supports UDMA 100.
> I've send it to my distribution mailing list, and several others, to no
> avail, so, has a last resort I send it now to the Linux ML.
> I'm using pure vanilla linux-2.4.19, and I tried all possible configs
> settings that I though that could affect this problem.

If I remember rightly 2.4.19 doesnt have full support for the AMD
760MP/X although

2002-11-20 02:12:04

by Manish Lachwani

[permalink] [raw]
Subject: RE: Disk Performance Issues [AMD Viper plus IDE chipset problems. (wrong udma "autodetection")]

I have actually used the ASUS motherboard with the amd768 southbridge. It is
also the 760MPX solution. And after making changes to the
config_chipset_for_dma function, you can get it to work at udma 100 ...

Thanks
Manish

-----Original Message-----
From: Alan Cox [mailto:[email protected]]
Sent: Saturday, November 16, 2002 3:34 PM
To: Miguel S Filipe
Cc: Linux Kernel Mailing List
Subject: Re: Disk Performance Issues [AMD Viper plus IDE chipset
problems. (wrong udma "autodetection")]


On Sat, 2002-11-16 at 20:19, Miguel S Filipe wrote:
> Hello there,
>
> I'm sending this email about a problem with udma settings
> in a TigerMP motherboard, wich supports UDMA 100.
> I've send it to my distribution mailing list, and several others, to no
> avail, so, has a last resort I send it now to the Linux ML.
> I'm using pure vanilla linux-2.4.19, and I tried all possible configs
> settings that I though that could affect this problem.

If I remember rightly 2.4.19 doesnt have full support for the AMD
760MP/X although

2002-11-20 20:09:31

by Miguel Sousa Filipe

[permalink] [raw]
Subject: Re: Disk Performance Issues [AMD Viper plus IDE chipset problems. (wrong udma "autodetection")]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Manish Lachwani wrote:
| I have noticed something with the IDE drivers especially with the Seagate
| drives. The promise driver (eg 20277) detects the UDMA 5 mode correctly.
|
| This is what it does:
|
| byte ultra_66 = ((id->dma_ultra & 0x0010) ||
| (id->dma_ultra & 0x0008)) ? 1 : 0;
| byte ultra_100 = ((id->dma_ultra & 0x0020) ||
| (ultra_66)) ? 1 : 0;
| byte ultra_133 = ((id->dma_ultra & 0x0040) ||
| (ultra_100)) ? 1 : 0;
|
| Now, lets take a PIIX driver
|
| int ultra100 = ((dev->device ==
| PCI_DEVICE_ID_INTEL_82801BA_8) ||
| (dev->device ==
| PCI_DEVICE_ID_INTEL_82801BA_9) ||
| (dev->device ==
| PCI_DEVICE_ID_INTEL_82801CA_10)) ? 1 : 0;
| int ultra66 = ((ultra100) ||
| (dev->device ==
| PCI_DEVICE_ID_INTEL_82801AA_1) ||
| (dev->device ==
| PCI_DEVICE_ID_INTEL_82372FB_1)) ? 1 : 0;
|
| if ((id->dma_ultra & 0x0020) && (udma_66) && (ultra100)) {
| speed = XFER_UDMA_5;
|
| where ultra100 and ultra66 is not or'ed with 0x0010 and 0x0008. The final
| check is only with 0x0020. I have found this issues with other IDE drivers
| like amd74xx.c, serverworks.c etc. SO, make the above changes in the
drivers
| and u should see UDMA 5 on those seagate drives on startup ...
|
| Thanks
| Manish
Okay, now, i've been looking in drivers/ide/amd74xx.c
and
config_chipset_for_dma(ide_drive_t)
has:
byte udma_66 = eighty_ninty_three(drive);
byte udma_100 = ((dev->device==PCI_DEVICE_ID_AMD_VIPER_7411)||

(dev->device==PCI_DEVICE_ID_AMD_VIPER_7441)) ? 1 : 0;

and.. also.. like you've said:
if ((id->dma_ultra & 0x0020) && (udma_66) && (udma_100)) {
~ speed = XFER_UDMA_5;

now.. my lame question is:
should I put:
byte udma66 = (eighty_ninty_three(drive) & 0x0010 ||
eighty_ninty_three(drive) & 0x0008) ? 1 : 0;
or eighty_ninty_three (ide_drive_t *drive), or even some other thing be
the one that should be changed for a proper fix. (if this is really the
way to solve it)


One other thing...
in config_chipset_for_dma() right after the declarations we have:

if(udma_100)
udma_66 = eighty_ninty_three(drive);

is this really needed, since udma_66 is declared and initialized with
that same value?

Sorry if this are lame questions, just trying to learn... :-\

Thanks
Miguel Sousa Filipe

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE92+w8YBjDU2rJcrARAolPAJ4xi1LIpGcNUTUlGY+Qg9ZlzABxSQCcDBzl
Q/y4q7IiE0O5HllvTD877ZU=
=RBMC
-----END PGP SIGNATURE-----

2002-11-20 20:25:56

by Manish Lachwani

[permalink] [raw]
Subject: RE: Disk Performance Issues [AMD Viper plus IDE chipset problems. (wrong udma "autodetection")]

just do the following:

replace

if ((id->dma_ultra & 0x0020) && (udma_66) && (udma_100)) {
~ speed = XFER_UDMA_5;

with

if (( (id->dma_ultra & 0x0020) || (id->dma_ultra & 0x0010) || (id->dma_ultra
& 0x0008) ) && (udma_66) && (udma_100)) {
~ speed = XFER_UDMA_5;

Note that u should do the same for UDMA 4. In the 2.4.19 driver, I have seen
that UDMA 5 is not supported and so it defaults to UDMA 4. try with and
without the above change to udma 4 but make it for udma 5 ...

Thanks


-----Original Message-----
From: Miguel S Filipe [mailto:[email protected]]
Sent: Wednesday, November 20, 2002 12:11 PM
To: Manish Lachwani
Cc: 'Alan Cox'; Linux Kernel Mailing List
Subject: Re: Disk Performance Issues [AMD Viper plus IDE chipset
problems. (wrong udma "autodetection")]


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Manish Lachwani wrote:
| I have noticed something with the IDE drivers especially with the Seagate
| drives. The promise driver (eg 20277) detects the UDMA 5 mode correctly.
|
| This is what it does:
|
| byte ultra_66 = ((id->dma_ultra & 0x0010) ||
| (id->dma_ultra & 0x0008)) ? 1 : 0;
| byte ultra_100 = ((id->dma_ultra & 0x0020) ||
| (ultra_66)) ? 1 : 0;
| byte ultra_133 = ((id->dma_ultra & 0x0040) ||
| (ultra_100)) ? 1 : 0;
|
| Now, lets take a PIIX driver
|
| int ultra100 = ((dev->device ==
| PCI_DEVICE_ID_INTEL_82801BA_8) ||
| (dev->device ==
| PCI_DEVICE_ID_INTEL_82801BA_9) ||
| (dev->device ==
| PCI_DEVICE_ID_INTEL_82801CA_10)) ? 1 : 0;
| int ultra66 = ((ultra100) ||
| (dev->device ==
| PCI_DEVICE_ID_INTEL_82801AA_1) ||
| (dev->device ==
| PCI_DEVICE_ID_INTEL_82372FB_1)) ? 1 : 0;
|
| if ((id->dma_ultra & 0x0020) && (udma_66) && (ultra100)) {
| speed = XFER_UDMA_5;
|
| where ultra100 and ultra66 is not or'ed with 0x0010 and 0x0008. The final
| check is only with 0x0020. I have found this issues with other IDE drivers
| like amd74xx.c, serverworks.c etc. SO, make the above changes in the
drivers
| and u should see UDMA 5 on those seagate drives on startup ...
|
| Thanks
| Manish
Okay, now, i've been looking in drivers/ide/amd74xx.c
and
config_chipset_for_dma(ide_drive_t)
has:
byte udma_66 = eighty_ninty_three(drive);
byte udma_100 = ((dev->device==PCI_DEVICE_ID_AMD_VIPER_7411)||

(dev->device==PCI_DEVICE_ID_AMD_VIPER_7441)) ? 1 : 0;

and.. also.. like you've said:
if ((id->dma_ultra & 0x0020) && (udma_66) && (udma_100)) {
~ speed = XFER_UDMA_5;

now.. my lame question is:
should I put:
byte udma66 = (eighty_ninty_three(drive) & 0x0010 ||
eighty_ninty_three(drive) & 0x0008) ? 1 : 0;
or eighty_ninty_three (ide_drive_t *drive), or even some other thing be
the one that should be changed for a proper fix. (if this is really the
way to solve it)


One other thing...
in config_chipset_for_dma() right after the declarations we have:

if(udma_100)
udma_66 = eighty_ninty_three(drive);

is this really needed, since udma_66 is declared and initialized with
that same value?

Sorry if this are lame questions, just trying to learn... :-\

Thanks
Miguel Sousa Filipe

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE92+w8YBjDU2rJcrARAolPAJ4xi1LIpGcNUTUlGY+Qg9ZlzABxSQCcDBzl
Q/y4q7IiE0O5HllvTD877ZU=
=RBMC
-----END PGP SIGNATURE-----