# Another DMA issue [solved]

## kmrivers

Hello all. I just want you to know that i have looked at 10-15 different posts containing the problem I have. I have gentoo-sources 2.6.11-r6 compiled. THis is what lspci gives me as a ide chipset:

```
IDE Interface: VIA Technologies , Inc. VT82C586A/B/VT82c686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06)
```

From that i gather that is my chipset. So in my menuconfig i have enabled and disabled the following:

```

ATA/IDE/MFM/RLL support ---> 

<*> ATA/IDE/MFM/RLL support 

IDE,ATA and ATAPI Block devices ---> 

<*> Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support 

<*> Include IDE/ATA-2 DISK support 

<*> Include IDE/ATAPI CDROM support 

< > SCSI emulation support 

[*] PCI IDE Chipset Support 

[ ] Generic PCI IDE Chipset Support 

[ ] Sharing PCI IDE interrupts support 

[*] Generic PCI bus-master DMA support 

[*] Use PCI DMA by default when available 

[ ] Enable DMA only for disks (This is currently off but I have tried it on as well) 

< > HPT36X/37X chipset support (This is currently off but I have tried it on as well) 

<*> VIA82CXXX chipset support 

```

Ok... so for my chipset I have compiled both in the kernel and as a module.  I disabled Generic PCI IDE Chipset Support per recommendation on this post https://forums.gentoo.org/viewtopic.php?p=1999092#1999092

So I have ran the following and recieved this output:

```

/ # hd parm -d1 /dev/hda

     /dev/hda

      setting using_dma to 1 (on)

      HDIO_SET_DMA failed: Operation not permitted

      using_dma = 0 (off)

```

It will not take DMA I won't do KDE without DMA. I have looked all over for the answer. I have found solutions that seem to work for some but not me. Here is a breakdown of my hardware. I tried to include all the information that should be needed but im sure i forgot something so just let me know and my apologies in advance.

Soyo KT400 Dragon Ultra Platinum (sucky board i know)

AMD Athlon XP2800+

VIA 8235 IDE Chipset

160GB Western Digital BB

200GB Maxtor

The chipset # is the one Soyo says specifically in the manual which can be found here http://www.soyogroup.com/dl/manuals/k7/mk7vx413.pdf

Alright. If i forgot tell me. Hopefully someone can help. Thanks in advance!Last edited by kmrivers on Tue May 03, 2005 4:12 pm; edited 1 time in total

----------

## drescherjm

Turn off Generic PCI bus-master DMA support

----------

## kmrivers

if i turn that off the options for my driver dissapear. I am not sure why that is. but that is what happens. can you explain that?

----------

## kmrivers

I still havent had any luck. Can someone please help me!?

----------

## jdgill0

I have the same chipset, the following is what I have

```
<*> ATA/ATAPI/MFM/RLL support

<*>   Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support

<*>     Include IDE/ATA-2 DISK support

[*]       Use multi-mode by default

<*>     Include IDE/ATAPI CDROM support

<*>     generic/default IDE chipset support

[*]     PCI IDE chipset support

[*]       Sharing PCI IDE interrupts support

<*>       Generic PCI IDE Chipset Support

[*]       Generic PCI bus-master DMA support

[*]         Use PCI DMA by default when available

<*>         VIA82CXXX chipset support
```

Maybe that will help.

----------

## kmrivers

jdgill0, i used the same settings installed the new kernel then ran hdparm -d1 /dev/hda... and got the same message.I don't know what to do.

----------

## jdgill0

 *kmrivers wrote:*   

> jdgill0, i used the same settings installed the new kernel then ran hdparm -d1 /dev/hda... and got the same message.I don't know what to do.

 

When you say you installed the new kernel ... do you also mean that you rebooted?  If not, you have to reboot to load the new kernel.  Also, don't run hdparm command until you see for sure dma isn't working with the new kernel.

----------

## kmrivers

yes i rebooted. i compiled and placed the new kernel and the boot partition. rebooted and ran hdparm and still isnt working.

----------

## jdgill0

Can you reboot and run hdparm -I /dev/hda without running hdparm -d1 /dev/hda beforehand, and post the results?

I have never had a problem using the kernel configs setting I posted, so I am a good bit confused why it's not working.  :Confused: 

----------

## kmrivers

here are the results of running the hdparm -i /dev/hda before trying to turn DMA on. 

bash-2.05b# hdparm -i /dev/hda

/dev/hda:

 Model=WDC WD1600BB-00DWA0, FwRev=15.05R15, SerialNo=WD-WMAEH1952831

 Config={ HardSect NotMFM HdSw>15uSec SpinMotCtl Fixed DTR>5Mbs FmtGapReq }

 RawCHS=16383/16/63, TrkSize=57600, SectSize=600, ECCbytes=74

 BuffType=DualPortCache, BuffSize=2048kB, MaxMultSect=16, MultSect=16

 CurCHS=65535/1/63, CurSects=4128705, LBA=yes, LBAsects=268435455

 IORDY=on/off, tPIO={min:120,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 *udma5

 AdvancedPM=no WriteCache=enabled

 Drive conforms to: device does not report version:

 * signifies the current active mode

----------

## jdgill0

 *kmrivers wrote:*   

> ...  UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5
> 
> ...
> 
>  * signifies the current active mode

 

This signifies you have DMA working.  I don't see anything else that might indicate a problem.

----------

## jdgill0

Also, can your run hdparm -tT /dev/hda without having issued hdparm -d1 /dev/hda, and post those results?

----------

## kmrivers

here are the results after running hdparm -tT /dev/hda. Thanks for all your help, i really appreciate it. 

bash-2.05b# hdparm -tT /dev/hda

/dev/hda:

 Timing cached reads:   904 MB in  2.01 seconds = 450.72 MB/sec

 Timing buffered disk reads:   18 MB in  4.85 seconds =   3.71 MB/sec

Alright there it is. If DMA is enabled why does it report a 0 when i run hdparm -d /dev/hda?

----------

## drescherjm

Your numbers say that DMA is not enabled.

----------

## jdgill0

Yes, those numbers definitely indicate no dma ... and you should see that with

```
cat /proc/ide/hda/settings
```

So, apparently having *udma5 say that it's active does not mean it's actually working ... the reason for wanting you to run hdparm -tT /dev/hda.

----------

## jdgill0

Can you post the output of

```
dmesg | grep -i ide
```

Also, you are sure you are using the kernel with the setting like I have? -- i.e. if you have a separate /boot partition you did mount /boot then copy the kernel to /boot?

And you for sure don't have CONFIG_BLK_DEV_IDEDMA_FORCED=y in your kernel's .config file?

Sorry for those questions, but I wanted to double check just in case.

----------

## kmrivers

here is the output you asked for.

bash-2.05b# dmesg | grep -i ide

BIOS-provided physical RAM map:

ACPI: IRQ0 used by override.

ACPI: IRQ2 used by override.

ACPI: IRQ9 used by override.

CPU: After generic identify, caps: 0383fbff c1c3fbff 00000000 00000000 0000000000000000 00000000

CPU: After vendor identify, caps: 0383fbff c1c3fbff 00000000 00000000 00000000 00000000 00000000

Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2

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

Probing IDE interface ide0...

Probing IDE interface ide1...

Probing IDE interface ide2...

Probing IDE interface ide3...

Probing IDE interface ide4...

Probing IDE interface ide5...

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

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

Warning: /proc/ide/hd?/settings interface is obsolete, and will be removed soon!

----------

## jdgill0

Hmmm .... can you boot from a LiveCD and post the results from dmesg | grep -i ide as well?  Maybe you could also post results from hdparm -tT /dev/hda, and see what cat /proc/ide/hda/settings says about dma?

Also, I re-edited my previous post ... could you report back on the extra questions? Thanks.

----------

## kmrivers

Ok. here is my entire ide section in my kernel config 

```
# IDE chipset support/bugfixes

#

CONFIG_IDE_GENERIC=y

# CONFIG_BLK_DEV_CMD640 is not set

# CONFIG_BLK_DEV_IDEPNP is not set

CONFIG_BLK_DEV_IDEPCI=y

CONFIG_IDEPCI_SHARE_IRQ=y

# CONFIG_BLK_DEV_OFFBOARD is not set

CONFIG_BLK_DEV_GENERIC=y

# CONFIG_BLK_DEV_OPTI621 is not set

# CONFIG_BLK_DEV_RZ1000 is not set

CONFIG_BLK_DEV_IDEDMA_PCI=y

# CONFIG_BLK_DEV_IDEDMA_FORCED is not set

CONFIG_IDEDMA_PCI_AUTO=y

# CONFIG_IDEDMA_ONLYDISK is not set

# CONFIG_BLK_DEV_AEC62XX is not set

# CONFIG_BLK_DEV_ALI15X3 is not set

# CONFIG_BLK_DEV_AMD74XX is not set

# CONFIG_BLK_DEV_ATIIXP is not set

# CONFIG_BLK_DEV_CMD64X is not set

# CONFIG_BLK_DEV_TRIFLEX is not set

# CONFIG_BLK_DEV_CY82C693 is not set

# CONFIG_BLK_DEV_CS5520 is not set

# CONFIG_BLK_DEV_CS5530 is not set

# CONFIG_BLK_DEV_HPT34X is not set

# CONFIG_BLK_DEV_HPT366 is not set

# CONFIG_BLK_DEV_SC1200 is not set

# CONFIG_BLK_DEV_PIIX is not set

# CONFIG_BLK_DEV_NS87415 is not set

# CONFIG_BLK_DEV_PDC202XX_OLD is not set

# CONFIG_BLK_DEV_PDC202XX_NEW is not set

# CONFIG_BLK_DEV_SVWKS is not set

# CONFIG_BLK_DEV_SIIMAGE is not set

# CONFIG_BLK_DEV_SIS5513 is not set

# CONFIG_BLK_DEV_SLC90E66 is not set

# CONFIG_BLK_DEV_TRM290 is not set

CONFIG_BLK_DEV_VIA82CXXX=y

# CONFIG_IDE_ARM is not set

# CONFIG_IDE_CHIPSETS is not set

CONFIG_BLK_DEV_IDEDMA=y

# CONFIG_IDEDMA_IVB is not set

CONFIG_IDEDMA_AUTO=y

# CONFIG_BLK_DEV_HD is not set

```

next we have the results of....oh /boot. im positive i mounted boot and copied the new kernel over. I am about to boot to a livecd so ill post those results in a few minutes. thanks.

----------

## cascamorto

sry this doesn't have much to do with anything here but how do i check if my IDE is using DMA?

----------

## kmrivers

in your konsole run hdparm -d /dev/hda or whatever drive you want to run it on.

news... ok its working i have no idea why. i recompiled my kernel to get my audio working(its workin but my audio still works. thank again.

----------

## jdgill0

 *kmrivers wrote:*   

> ... news... ok its working i have no idea why. i recompiled my kernel to get my audio working(its workin but my audio still works. thank again.

 

Great  :Smile:  ... glad to hear it's working ... wish you knew exactly what was the cause of failure before.  Considering you recompiled your kernel for audio reasons and it is now working makes me think maybe you did something wrong with the previous kernel compile or installation of the kernel -- or maybe not. Oh well, important thing I suppose is that it works now.

----------

## kmrivers

yeah i have no idea. i did have a via chipset driver in my ide section of the kernel config it was built into the kernel. So i removed it. That could have done it i suppose. Wait no that was an audio chipset i removed. nvm. ill take a look at my kernel config and see if anything else is different. thanks.

----------

## slydini

Same exact problem here only I didn't have the via82cxxx compiled in the kernel at all. I just compiled it in and now dma is working as it should. Unfortunatly for me I compiled KDE with no dma enabled because I didn't notice the no dma enabled error on bootup. Hope this helps someone out.

----------

## danorris

Ditto to what slydini said. Recompiling my kernel now... thanks for all the good info on this thread, I expect I'll be back on DMA shortly  :Smile: 

----------

## danorris

Actually, it didn't work for me. I was missing the via82cxxx driver, but now it's in there and I still get the same "Operation not permitted" error message from hdparm, and using_dma is still 0.

hdparm -tT /dev/hda:

```
/dev/hda:

 Timing cached reads:   2192 MB in  2.00 seconds = 1094.52 MB/sec

 Timing buffered disk reads:   12 MB in  3.03 seconds =   3.97 MB/sec
```

hdparm -d1 /dev/hda:

```
/dev/hda:

 setting using_dma to 1 (on)

 HDIO_SET_DMA failed: Operation not permitted

 using_dma    =  0 (off)
```

cat /proc/ide/hda/settings:

```
name                    value           min             max             mode

----                    -----           ---             ---             ----

acoustic                0               0               254             rw

address                 0               0               2               rw

bios_cyl                65535           0               65535           rw

bios_head               16              0               255             rw

bios_sect               63              0               63              rw

bswap                   0               0               1               r

current_speed           0               0               70              rw

failures                0               0               65535           rw

init_speed              0               0               70              rw

io_32bit                0               0               3               rw

keepsettings            0               0               1               rw

lun                     0               0               7               rw

max_failures            1               0               65535           rw

multcount               16              0               16              rw

nice1                   1               0               1               rw

nowerr                  0               0               1               rw

number                  0               0               3               rw

pio_mode                write-only      0               255             w

unmaskirq               0               0               1               rw

using_dma               0               0               1               rw

wcache                  1               0               1               rw
```

lspci:

```
0000:00:00.0 Host bridge: Intel Corporation 82850 850 (Tehama) Chipset Host Bridge (MCH) (rev 04)

0000:00:01.0 PCI bridge: Intel Corporation 82850 850 (Tehama) Chipset AGP Bridge (rev 04)

0000:00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 04)

0000:00:1f.0 ISA bridge: Intel Corporation 82801BA ISA Bridge (LPC) (rev 04)

0000:00:1f.1 IDE interface: Intel Corporation 82801BA IDE U100 (rev 04)

0000:00:1f.3 SMBus: Intel Corporation 82801BA/BAM SMBus (rev 04)

0000:00:1f.5 Multimedia audio controller: Intel Corporation 82801BA/BAM AC'97 Audio (rev 04)

0000:01:00.0 VGA compatible controller: ATI Technologies Inc Radeon R200 QH [Radeon 8500] (rev 80)

0000:02:01.0 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 50)

0000:02:01.1 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 50)

0000:02:01.2 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 51)

0000:02:02.0 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 50)

0000:02:02.1 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 50)

0000:02:02.2 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 51)

0000:02:09.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8029(AS)

0000:02:0c.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)
```

kernel IDE configuration (2.6.11-gentoo-r5):

```
#

# ATA/ATAPI/MFM/RLL support

#

CONFIG_IDE=y

CONFIG_BLK_DEV_IDE=y

#

# IDE chipset support/bugfixes

#

CONFIG_IDE_GENERIC=y

# CONFIG_BLK_DEV_CMD640 is not set

CONFIG_BLK_DEV_IDEPCI=y

CONFIG_IDEPCI_SHARE_IRQ=y

# CONFIG_BLK_DEV_OFFBOARD is not set

CONFIG_BLK_DEV_GENERIC=y

# CONFIG_BLK_DEV_OPTI621 is not set

# CONFIG_BLK_DEV_RZ1000 is not set

CONFIG_BLK_DEV_IDEDMA_PCI=y

# CONFIG_BLK_DEV_IDEDMA_FORCED is not set

CONFIG_IDEDMA_PCI_AUTO=y

# CONFIG_IDEDMA_ONLYDISK is not set

# CONFIG_BLK_DEV_AEC62XX is not set

# CONFIG_BLK_DEV_ALI15X3 is not set

# CONFIG_BLK_DEV_AMD74XX is not set

# CONFIG_BLK_DEV_ATIIXP is not set

# CONFIG_BLK_DEV_CMD64X is not set

# CONFIG_BLK_DEV_TRIFLEX is not set

# CONFIG_BLK_DEV_CY82C693 is not set

# CONFIG_BLK_DEV_CS5520 is not set

# CONFIG_BLK_DEV_CS5530 is not set

# CONFIG_BLK_DEV_HPT34X is not set

# CONFIG_BLK_DEV_HPT366 is not set

# CONFIG_BLK_DEV_SC1200 is not set

# CONFIG_BLK_DEV_PIIX is not set

# CONFIG_BLK_DEV_NS87415 is not set

# CONFIG_BLK_DEV_PDC202XX_OLD is not set

# CONFIG_BLK_DEV_PDC202XX_NEW is not set

# CONFIG_BLK_DEV_SVWKS is not set

# CONFIG_BLK_DEV_SIIMAGE is not set

# CONFIG_BLK_DEV_SIS5513 is not set

# CONFIG_BLK_DEV_SLC90E66 is not set

# CONFIG_BLK_DEV_TRM290 is not set

CONFIG_BLK_DEV_VIA82CXXX=y

# CONFIG_IDE_ARM is not set

CONFIG_BLK_DEV_IDEDMA=y

CONFIG_IDEDMA_IVB=y

CONFIG_IDEDMA_AUTO=y

# CONFIG_BLK_DEV_HD is not set
```

snippets from dmesg:

```
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2

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

Probing IDE interface ide0...

hda: WDC WD1200JB-75CRA0, ATA DISK drive

Probing IDE interface ide1...

hdc: SAMSUNG DVD-ROM SD-616T, ATAPI CD/DVD-ROM drive

hdd: SAMSUNG CD-R/RW SW-248F, ATAPI CD/DVD-ROM drive

Probing IDE interface ide2...

Probing IDE interface ide3...

Probing IDE interface ide4...

Probing IDE interface ide5...

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

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

hda: max request size: 128KiB

hda: Host Protected Area detected.

        current capacity is 234375000 sectors (120000 MB)

        native  capacity is 234441648 sectors (120034 MB)

hda: Host Protected Area disabled.

hda: 234441648 sectors (120034 MB) w/8192KiB Cache, CHS=65535/16/63

hda: cache flushes not supported

 hda: hda1 hda2 hda3 hda4 < hda5 hda6 hda7 >

hdc: ATAPI 48X DVD-ROM drive, 512kB Cache

Uniform CD-ROM driver Revision: 3.20

hdd: ATAPI 48X CD-ROM CD-R/RW drive, 2048kB Cache

ide-floppy driver 0.99.newide
```

Any suggestions on what to try next? Maybe one of the people who have gotten this working could compare my kernel's IDE configuration against yours, and see if I missed something?

Many thanks.

----------

## danorris

Hah, I just noticed that it's actually an Intel IDE chipset, not VIA. Oops! The only Intel-related support I can find in the IDE drivers section is "PIIXn" support; I'm trying that now, will post results.

----------

## danorris

Yes, enabling Intel PIIXn IDE support fixed the problem. I'm now getting about 46 MB/sec for buffered reads with hdparm. Sorry for the excess posts... and thanks again for all the info on this thread. Cheers!

----------

## kmrivers

Hey I am glad it helped. Good luck. Btw, how slow is your drive? I am pulling 128MB+ on my buffered reads.

----------

## danorris

Wow! That's impressive, if it's accurate, but I have to wonder about that? All the numbers I've ever seen posted are in about the 50-80 MB/sec range. I have 3x SATA Seagate ST3300831AS (300 GB, 7200 RPM) and 1x SATA Maxtor 6B200M0 (250 GB, 7200 RPM). The Seagates are on a Silicon Image 3114 SATA RAID controller (onboard), and the Maxtor is on an onboard VIA VT6420. On average it seems I get low-60s MB/sec from all of them (no noticeable difference between the two controllers). I also have a Maxtor IDE (UDMA/100) disk at work that gets around 45 MB/sec (this is the one I was posting about).

Anyway, if you really are getting true reads > 100 MB/sec, then I'm extremely jealous  :Wink: 

----------

## kmrivers

Yeah i read that wrong. sorry. its about 40.

----------

