# hd dma problems

## scape

Update:

it seems it actually was a kernel issue. switching from gentoo-sources to ac-sources actually solved the problem.

so you folks out there with a ss51g (anyone?), better stick with alan cox's kernels...

this is driving me nuts. no matter what i do, my harddrives perform poorly. i've been looking around the forums quite a while now, but no solution came up.

first some information about my setup:

```

root@atair root # hdparm -I /dev/hda

/dev/hda:

ATA device, with non-removable media

powers-up in standby; SET FEATURES subcmd spins-up.

        Model Number:       IC35L120AVVA07-0                        

        Serial Number:      VNC602A6C97LTG

        Firmware Revision:  VA6OA52A

Standards:

        Used: ATA/ATAPI-5 T13 1321D revision 1 

        Supported: 5 4 3 2 & some of 6

Configuration:

        Logical         max     current

        cylinders       16383   16383

        heads           16      16

        sectors/track   63      63

        --

        CHS current addressable sectors:   16514064

        LBA    user addressable sectors:  241254720

        device size with M = 1024*1024:      117800 MBytes

        device size with M = 1000*1000:      123522 MBytes (123 GB)

Capabilities:

        LBA, IORDY(can be disabled)

        bytes avail on r/w long: 52     Queue depth: 32

        Standby timer values: spec'd by Standard, no device specific minimum

        R/W multiple sector transfer: Max = 16  Current = 0

        Advanced power management level: unknown setting (0x0000)

        Recommended acoustic management value: 128, current value: 254

        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:

           *    NOP cmd

           *    READ BUFFER cmd

           *    WRITE BUFFER cmd

           *    Host Protected Area feature set

                Release interrupt

           *    Look-ahead

           *    Write cache

           *    Power Management feature set

                Security Mode feature set

           *    SMART feature set

           *    Mandatory FLUSH CACHE command 

           *    Device Configuration Overlay feature set 

                Automatic Acoustic Management feature set 

                SET MAX security extension

                Address Offset Reserved Area Boot

                SET FEATURES subcommand required to spinup after power up

                Power-Up In Standby feature set

                Advanced Power Management feature set

           *    READ/WRITE DMA QUEUED

Security: 

        Master password revision code = 65534

                supported

        not     enabled

        not     locked

        not     frozen

        not     expired: security count

        not     supported: enhanced erase

        72min for SECURITY ERASE UNIT. 

HW reset results:

        CBLID- above Vih

        Device num = 0 determined by the jumper

Checksum: correct

```

and

```

root@atair root # hdparm -I /dev/hdb

/dev/hdb:

ATA device, with non-removable media

        Model Number:       Maxtor 96147H6                          

        Serial Number:      V604A0EC            

        Firmware Revision:  ZAH814Y0

Standards:

        Used: ATA/ATAPI-6 T13 1410D revision 0 

        Supported: 6 5 4 3 

Configuration:

        Logical         max     current

        cylinders       16383   16383

        heads           16      16

        sectors/track   63      63

        --

        CHS current addressable sectors:   16514064

        LBA    user addressable sectors:  120064896

        device size with M = 1024*1024:       58625 MBytes

        device size with M = 1000*1000:       61473 MBytes (61 GB)

Capabilities:

        LBA, IORDY(can be disabled)

        bytes avail on r/w long: 57     Queue depth: 1

        Standby timer values: spec'd by Standard, no device specific minimum

        R/W multiple sector transfer: Max = 16  Current = 0

        Advanced power management level: unknown setting (0x0000)

        Recommended acoustic management value: 192, current value: 192

        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=120ns  IORDY flow control=120ns

Commands/features:

        Enabled Supported:

           *    NOP cmd

           *    READ BUFFER cmd

           *    WRITE BUFFER cmd

           *    Host Protected Area feature set

           *    Look-ahead

           *    Write cache

           *    Power Management feature set

           *    SMART feature set

           *    Automatic Acoustic Management feature set 

                SET MAX security extension

                Advanced Power Management feature set

           *    DOWNLOAD MICROCODE cmd

HW reset results:

        CBLID- above Vih

        Device num = 1 determined by the jumper

Checksum: correct

```

I don't have one of these 80-whatsoever-cables, but nonetheless they should go faster than this:

```

root@atair root # hdparm -Tt /dev/hda

/dev/hda:

 Timing buffer-cache reads:   128 MB in  0.46 seconds =277.66 MB/sec

 Timing buffered disk reads:  64 MB in 28.41 seconds =  2.25 MB/sec

```

same applies to /dev/hdb. i've been trying around with different kernel configurations - nothing. tried adding /etc/init.d/hdparm - no effect either.

i keep playing around with hdparm without success, the strange thing though is this:

```

root@atair root # hdparm -d1 -u1 /dev/hdb

/dev/hdb:

 setting unmaskirq to 1 (on)

 setting using_dma to 1 (on)

 unmaskirq    =  1 (on)

 using_dma    =  1 (on)

root@atair root # hdparm -d /dev/hdb

/dev/hdb:

 using_dma    =  0 (off)

```

oh yeah, btw: got a ss51g (german) with shuttle mobo fs51 (SiS651/SiS962L chipset)

so, any suggestions? i'm really desperate   :Confused: 

----------

## Malakin

Well I suppose this is obvious but I can tell you your dma isn't working ;) This is about what performance you get without dma.

I looked around and couldn't really find any answers.

What kernel are you using? does dmesg say anything interesting about your ide?

----------

## scape

 *Malakin wrote:*   

> Well I suppose this is obvious but I can tell you your dma isn't working ;) This is about what performance you get without dma.
> 
> 

 

yeah, i was thinking of that, too ;)

 *Malakin wrote:*   

> 
> 
> I looked around and couldn't really find any answers.
> 
> What kernel are you using? does dmesg say anything interesting about your ide?

 

```
root@atair root # uname -a

Linux atair 2.4.20-gentoo-r1 #4 Fri Feb 28 00:05:32 CET 2003 i686 Intel(R) Pentium(R) 4 CPU 2.00GHz GenuineIntel GNU/Linux

```

and the important (i guess) part from dmesg:

```
Uniform Multi-Platform E-IDE driver Revision: 6.31

ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx

SIS5513: IDE controller on PCI bus 00 dev 15

PCI: Found IRQ 11 for device 00:02.5

SIS5513: chipset revision 0

SIS5513: not 100% native mode: will probe irqs later

SiS5513

    ide0: BM-DMA at 0x4000-0x4007, BIOS settings: hda:DMA, hdb:DMA

    ide1: BM-DMA at 0x4008-0x400f, BIOS settings: hdc:DMA, hdd:pio

hda: IC35L120AVVA07-0, ATA DISK drive

hdb: Maxtor 96147H6, ATA DISK drive

hdc: HL-DT-ST RW/DVD GCC-4320B, ATAPI CD/DVD-ROM drive

ide0 at 0x1f0-0x1f7,0x3f6 on irq 14

ide1 at 0x170-0x177,0x376 on irq 15

hda: 241254720 sectors (123522 MB) w/1863KiB Cache, CHS=15017/255/63

hdb: 120064896 sectors (61473 MB) w/2048KiB Cache, CHS=7473/255/63

hdc: ATAPI 40X DVD-ROM CD-R/RW drive, 2048kB Cache

```

----------

## modal

First, make sure that your IDE controller is supported and compiled in your kernel (either as modules or not)...for me, I have an nforce ATA100 controller card, which is only supported in certain patches (not in gentoo-sources, or vanilla-sources)

Second, run 

```
hdparm -Tt /dev/hdx
```

  and look at your performance.  Your cached setting (the first one) should be good, while your second one should be really poor.

Third, your ata controller supports udma5, which if you forced it with an -X option, would be:

udma5 : "-X 69"

the others are this:

udma2 : "-X 66"

udma4 : "-X 68"

udma5 : "-X 69"

udma6 : "-X 70"

Forth, make sure when you run hdparm to you -d1 to enable ultradma...

These are my hdparm settings:

```
hdparm -d1 -X69 -c1 A1 -m16 -u1 -a64
```

My performance went from 3MB/s to 30+MB/s

Hope this helps.

----------

## scape

nope, already tried all of this stuff. as i said, i'm browsing the forums for quite a while now. all this stuff came up, but with no or little effect. for example if i set all this hdparm stuff + run the tests (-Tt) in one single command, the performance seems quite ok. afterwards its just shitty again, so i reallly dont know what to do anymore

----------

## Malakin

 *Quote:*   

> for example if i set all this hdparm stuff + run the tests (-Tt) in one single command, the performance seems quite ok. afterwards its just shitty again, so i reallly dont know what to do anymore

 

So your performance will speed up for a while after enabling dma but will go back to being slow? This is without a reboot? How long will it remain fast for?

If ide errors are generated I believe it jumps down speeds until it stops gettings errors so a bad cable could cause this.

You could try a different kernel but I have a feeling it's not the kernel.

----------

## scape

yep, without reboot. most of the time it stays fast just during the test, but once in a while it even remains for 2-3 secs.

i don't believe it's the kernel either, as i tried many different configurations.

i'll try switching cables, but running win2000 i get normal performance. that's why i think it isn't the cable....

----------

## scape

as far as i can tell it isn't the cable. i tried another one but that didn't fix it...

----------

