# DMA with via82cxxx not working [solved]

## OEP

Hi,

I've been trying to get DMA working for a while. I've gone through the steps to make sure it's being compiled right in my kernel... everything looks right but I can't  figure out what's not working about it.

I have via82cxxx compiled into my kernel; before, it was a module which wasn't working either.

```
# hdparm -Tt

/dev/hdb:

 Timing cached reads:   1620 MB in  2.00 seconds = 810.12 MB/sec

 Timing buffered disk reads:   20 MB in  3.14 seconds =   6.36 MB/sec

/dev/hda:

 Timing cached reads:   1640 MB in  2.00 seconds = 818.90 MB/sec

 Timing buffered disk reads:   22 MB in  3.00 seconds =   7.33 MB/sec

# hdparm -d1

/dev/hdb:

 setting using_dma to 1 (on)

 HDIO_SET_DMA failed: Operation not permitted

 using_dma    =  0 (off)

# lspci -v

0000:00:11.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06) (prog-if 8a [Master SecP PriP])

        Subsystem: VIA Technologies, Inc.: Unknown device c001

        Flags: bus master, medium devsel, latency 32, IRQ 255

        I/O ports at dc00 [size=16]

        Capabilities: [c0] Power Management version 2

# grep DMA /usr/src/linux/.config

CONFIG_GENERIC_ISA_DMA=y

CONFIG_ISA_DMA_API=y

CONFIG_BLK_DEV_IDEDMA_PCI=y

CONFIG_BLK_DEV_IDEDMA_FORCED=y

CONFIG_IDEDMA_PCI_AUTO=y

# CONFIG_IDEDMA_ONLYDISK is not set

CONFIG_BLK_DEV_IDEDMA=y

# CONFIG_IDEDMA_IVB is not set

CONFIG_IDEDMA_AUTO=y

# grep VIA /usr/src/linux/.config

# CONFIG_MVIAC3_2 is not set

CONFIG_BLK_DEV_VIA82CXXX=y

# CONFIG_SCSI_SATA_VIA is not set

# CONFIG_VIA_RHINE is not set

# CONFIG_VIA_VELOCITY is not set

# CONFIG_AGP_VIA is not set

CONFIG_SND_VIA82XX=m

# CONFIG_SND_VIA82XX_MODEM is not set

CONFIG_SOUND_VIA82CXXX=m

CONFIG_MIDI_VIA82CXXX=y

```

Last edited by OEP on Tue Sep 27, 2005 9:18 pm; edited 1 time in total

----------

## NeddySeagoon

OEP,

Please post the entire IDE section of your kernel config file.

Also check the time stamp in 

```
uname -a
```

It shows the time the running kernel was compiled.

Its possible you are not running the kernel you think you are.

----------

## OEP

Here's the whole IDE section:

```
#

# IDE chipset support/bugfixes

#

# CONFIG_IDE_GENERIC is not set

CONFIG_BLK_DEV_CMD640=y

# CONFIG_BLK_DEV_CMD640_ENHANCED 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=y

CONFIG_BLK_DEV_IDEDMA_PCI=y

CONFIG_BLK_DEV_IDEDMA_FORCED=y

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=m

# 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=m

# CONFIG_BLK_DEV_IT821X 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
```

You were right about the kernel though; I'm running one from two weeks ago. I'm going to recompile and try that again. Thanks for the reply.

EDIT: Actually that was exactly what was wrong. In my specific case, my /boot was not mounted. Thanks for the help!

----------

## vbatman

How are the steps to mount /boot????

In the fstab???

Thanks!!!!

----------

## NeddySeagoon

vbatman,

In /etc/fstab, remove the no from noauto in the options to have boot automatically mounted at boot.

```
/dev/md0               /boot           ext2            noauto,noatime          1 1

                                                       ^^
```

----------

## vbatman

NeddySeagoon,

Thanks for the help!!!

I´m with the same problem that the OEP user. When I execute the command uname -a, the kernel date that it shows to me isn´t correct because I compiled it today and the command uname - a shows to me a kernel compiled on monday... ????

How to correct this????

Sorry for my bad english!!!

Thank you very much!!!!!!!!

----------

## NeddySeagoon

vbatman,

You have not installed your kernel correctly.

The most frequent mistake is not mounting /boot before you copy the kernel image over.

Close second, is doing the copy to /boot but using a new file name, so the old kernel is still loaded by grub.

Look in /boot with ls -l /boot, so you can see the file dates

Is your new kernel there?

Is boot mounted ?

Look in grub.conf on the kernel line and check the kernel file name.

Check the initrd name too, if you use one

The kernel and initrd file names in grub.conf must match those files you want loaded from /boot

----------

## moron

I am having the exact same problem except in my case as far as I can tell VIA support is compiled and should be working fine:

uname -a

Linux longwang 2.6.12-gentoo-r10 #2 SMP Sat Oct 22 12:28:00 PDT 2005 i686 AMD Athlon(TM) XP 1800+ AuthenticAMD GNU/Linux

grep VIA /usr/src/linux/.config

# CONFIG_MVIAC3_2 is not set

CONFIG_BLK_DEV_VIA82CXXX=y

# CONFIG_SCSI_SATA_VIA is not set

# CONFIG_VIA_RHINE is not set

# CONFIG_VIA_VELOCITY is not set

CONFIG_AGP_VIA=m

# CONFIG_I2C_VIA is not set

# CONFIG_I2C_VIAPRO is not set

# CONFIG_SENSORS_VIA686A is not set

CONFIG_SND_VIA82XX=m

# CONFIG_SND_VIA82XX_MODEM is not set

grep DMA /usr/src/linux/.config

CONFIG_GENERIC_ISA_DMA=y

CONFIG_ISA_DMA_API=y

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_IDEDMA=y

# CONFIG_IDEDMA_IVB is not set

CONFIG_IDEDMA_AUTO=y

lspci -v 

0000:00:11.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06) (prog-if 8a [Master SecP PriP])

        Subsystem: ASUSTeK Computer Inc. A7V8X / A7V333 motherboard

        Flags: bus master, medium devsel, latency 64

        I/O ports at a400 [size=16]

        Capabilities: [c0] Power Management version 2

But then I get the following:

hdparm -d1 /dev/hda

/dev/hda:

 setting using_dma to 1 (on)

 HDIO_SET_DMA failed: Operation not permitted

 using_dma    =  0 (off)

Any ideas? 

Cheers

----------

## NeddySeagoon

moron,

As you say, it looks good but doesn't work.

Please post the output of 

```
ls -l /boot 

ls -l /usr/src/linux
```

 and the content of your grub.conf

I suspect is something like you have configured one kernel and are running another.

----------

## moron

Thanks for the feedback Neddy but I did solve it.  A Debian related post elsewhere led me to the culprit which was generic IDE support enabled in the kernel.  This was interfering with the Via module and so was stopping DMA from being enabled.  Once that was removed everything automagically came up with DMA enabled after a reboot.

There are a couple of spots that generic IDE support is listed in the "make menuconfig" menu, it was the first one (which the help text did not list as absolutely mandatory) that was the problem for me.

No more xruns in Ardour, yay!

Cheers

----------

