# Cant enable DMA

## spaceturtle

I have spent the last week searching the boards here at gentoo forums, linuxquestions, and plain google searches, but have found nothing to help me get my DMA working.  everytime i try to hdparm, i get the same old error:

```
 

hdparm -d1 /dev/hda

/dev/hda:

 setting using_dma to 1 (on)

 HDIO_SET_DMA failed: Operation not permitted

 using_dma    =  0 (off)

```

I learned that in order for hdparm to work, you need to have compilied in support for DMA and your chipset.  I looked and DMA was already compiled in, my chipset wasnt however.  I compiled the VIA82CXXX chipset for my mobo (I know this to be the right one), I restarted and hdparm still gives me the same results.  

It seems every other post gets to the part about enabling chipset support, the person enables support, and then it works great, end of posting.  I dont know what I am doing wrong, but it is getting really frustrating.

Any help at all would be appreciated.  Thanks.

----------

## [UK]Superdude

I was having a similar problem, and it did turn out to be due to incorrect kernel settings as far as enabling the chipset.

Can you post some more information such as (part of!) your kernel config, motherboard type, kernel sources.

It sounds like your using the same chipset as myself, so if you can provide a little more info, I'll do my best  :Smile: 

----------

## sobers_2002

```
lspci
```

 this will give u the ide channel info.........compile that thing as a part of kernel and not as module and u should be ok.

luck!

Saurabh

----------

## spaceturtle

okay, here is the info on my hardware.  

I am using a Asus a7v266 motherboard with the VIA kt266 chipset, and kernel 2.6.5 (downloaded from kernel.org).

Here is the line of lspci about my ide:

```
 0000:00:11.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06) 
```

Here is the ATA/ATAPI section of my kernel config:

```
#

# ATA/ATAPI/MFM/RLL support

#

CONFIG_IDE=y

CONFIG_BLK_DEV_IDE=y

#

# Please see Documentation/ide.txt for help/info on IDE drives

#

# CONFIG_BLK_DEV_HD_IDE is not set

CONFIG_BLK_DEV_IDEDISK=y

CONFIG_IDEDISK_MULTI_MODE=y

# CONFIG_IDEDISK_STROKE is not set

CONFIG_BLK_DEV_IDECD=y

# CONFIG_BLK_DEV_IDETAPE is not set

# CONFIG_BLK_DEV_IDEFLOPPY is not set

# CONFIG_BLK_DEV_IDESCSI is not set

# CONFIG_IDE_TASK_IOCTL is not set

CONFIG_IDE_TASKFILE_IO=y

#

# IDE chipset support/bugfixes

#

CONFIG_IDE_GENERIC=y

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 is not set

CONFIG_IDEDMA_PCI_AUTO=y

# CONFIG_IDEDMA_ONLYDISK is not set

CONFIG_BLK_DEV_ADMA=y

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

Thanks for the fast responses.  I hope that this info will help.  Sorry i didnt post it before.

----------

## Corax

I could fix that problem by compiling support for my chipset into the kernel...

----------

## spaceturtle

I have compiled support for my chipset into the kernel:

```
CONFIG_BLK_DEV_VIA82CXXX=y
```

This should make it work, but for some reason it still doesnt, thus my problem...

----------

## zaiyon

sorry for my not-at-all-helping-oh-look-i-have-that-problem-too-help-me-post *g*

Got the same probleme with an nvidia disk controller and the 2.6.5 Kernel, this is my lspci output:

```

0000:00:09.0 IDE interface: nVidia Corporation nForce2 IDE (rev a2)

```

and now the important part of my .config

```

#

# ATA/ATAPI/MFM/RLL support

#

CONFIG_IDE=y

CONFIG_BLK_DEV_IDE=y

#

# Please see Documentation/ide.txt for help/info on IDE drives

#

# CONFIG_BLK_DEV_HD_IDE is not set

CONFIG_BLK_DEV_IDEDISK=y

# CONFIG_IDEDISK_MULTI_MODE is not set

# CONFIG_IDEDISK_STROKE is not set

CONFIG_BLK_DEV_IDECD=y

# CONFIG_BLK_DEV_IDETAPE is not set

# CONFIG_BLK_DEV_IDEFLOPPY is not set

# CONFIG_BLK_DEV_IDESCSI is not set

# CONFIG_IDE_TASK_IOCTL is not set

CONFIG_IDE_TASKFILE_IO=y

#

# IDE chipset support/bugfixes

#

CONFIG_IDE_GENERIC=m

# CONFIG_BLK_DEV_CMD640 is not set

# CONFIG_BLK_DEV_IDEPNP is not set

CONFIG_BLK_DEV_IDEPCI=y

# CONFIG_IDEPCI_SHARE_IRQ is not set

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

# CONFIG_BLK_DEV_AEC62XX is not set

# CONFIG_BLK_DEV_ALI15X3 is not set

CONFIG_BLK_DEV_AMD74XX=y

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

```

```

CONFIG_BLK_DEV_AMD74XX=y

```

This really seems to be the right module for my nforce2 board, thats at least what others hosting the same board confirmed me.

if I try to enable dma manually, just like many users I get the following

```

$ hdparm -d 1 /dev/hda

/dev/hda:

 setting using_dma to 1 (on)

 HDIO_SET_DMA failed: Operation not permitted

 using_dma    =  0 (off)

```

for hdparm -I $DRIVE

I get

```

$ hdparm -I /dev/hda

/dev/hda:

ATA device, with non-removable media

        Model Number:       Maxtor 34098H4

        Serial Number:      L41QMM7C

        Firmware Revision:  YAH814Y0

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:   80043264

        device size with M = 1024*1024:       39083 MBytes

        device size with M = 1000*1000:       40982 MBytes (40 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 = 16

        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 = 0 determined by the jumper

Checksum: correct

```

Of course there has to be something wrong, but I can't manage to find it the passing days, so I decided to post my problem... I don't seem to be alone  :Wink: 

UNIMPORTANT:

Somedays I believe, god didn't make me live to make menuconfig at all. That's really mean, but I'm kinda stupid at those things, don't even nearly get to manage to mount a usb-stick device.. but thats another problem ^^ thx in advance

----------

## spaceturtle

I finally got the problem solved.  I had exhaused about every option with my kernel, so i decided to upgrade my kernel to see if i could have any luck.  I emerged mm-sources 2.6.7-rc2, compiled and configured it.  For some reason my grub.conf was not in existence any more and I couldnt figure out how to make grub boot my new kernel.  I tried to create a grub.conf in the /boot/grub/grub.conf directory, but grub didnt seem to see it or use it.  I dont know how it was booting my old kernel without this config file, but whatever.  I eventually had to use a third party grub installer, and it worked.  i booted off the new kernel, and sure enough DMA works fine.

Thanks for all the responses, and i hope that this will help anyone else with this problem.

----------

## sobers_2002

u have to mount the /boot directory if u installed using std instructions, b4 u can edit grub.conf

----------

## zaiyon

in my case it surely wasn't related to grub, it was a probleme with the kernel config I think, today I stopped using this hairy (not that I don't love my first self-compiled kernel ever...) gentoo-dev-sources 2.6.5-r1 switching to the new love sources 2.6.7-rc2-r2, now dma works perfectly, with the _same_ options as used in my old .config.

this probably helps anyone... ^^

----------

## MasonS

 *zaiyon wrote:*   

> in my case it surely wasn't related to grub, it was a probleme with the kernel config I think, today I stopped using this hairy (not that I don't love my first self-compiled kernel ever...) gentoo-dev-sources 2.6.5-r1 switching to the new love sources 2.6.7-rc2-r2, now dma works perfectly, with the _same_ options as used in my old .config.
> 
> this probably helps anyone... ^^

 

It helped me! I did what you did and everything works great. Not only was DMA not working for me, but neither was AGP. I guess I'm a fan of love sources...this fixes all the slow-down trouble I had with 2.6. It's really, really fast now. Thanks!

----------

