# How to turn on DMA [SOLVED]

## jkruer01

Hello,

Everytime I boot my computer I get a message about DMA on my harddrive is turned off.  When I try to turn it on 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)

```

I am assuming it is something in the bios maybe?  How can I get DMA turned on?

Thanks,

JeremyLast edited by jkruer01 on Sun Jun 19, 2005 11:56 am; edited 1 time in total

----------

## furanku

I'm not an expert on this, but for a first guess we certainly need more informations.

- Did you build your own kernel?

- If so, which options have you set (See under "ATA/ATAPI/MFM/RLL support")?

- Is it an ATA or SATA harddisk?

- Does turning on DMA for other devices (CDROM/DVD) work?

- If so, are they on the same bus/cable?

- Anything relevant in your log files?

- Does it work in Knoppix or another LiveCD Distribution?

----------

## conchyliferous

I had that problem once. And that was cos I got the wrong chipset driver compiled into kernel.

E.g if you got a motherboard with an Intel chipset you should compile the following option into kernel:

```

Device Drivers->ATA/ATAPI/MFM/RLL support->Intel PIIXn chipsets support

```

If you got a different chipset you have to use a different driver.

This doesn't only make DMA to work but will also make your box better in many other ways, including making it more stable. (If this really is your problem that is)Last edited by conchyliferous on Wed Jul 20, 2005 3:49 pm; edited 1 time in total

----------

## jkruer01

Ok,

When I type lspci I get the following:

```
# lspci

0000:00:00.0 Host bridge: VIA Technologies, Inc. VT8385 [K8T800 AGP] Host Bridge (rev 01)

0000:00:01.0 PCI bridge: VIA Technologies, Inc. VT8237 PCI bridge [K8T800/K8T890 South]

0000:00:0b.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet (rev 10)

0000:00:0f.0 RAID bus controller: VIA Technologies, Inc. VIA VT6420 SATA RAID Controller (rev 80)

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

0000:00:10.0 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)

0000:00:10.1 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)

0000:00:10.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)

0000:00:10.3 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 81)

0000:00:10.4 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 86)

0000:00:11.0 ISA bridge: VIA Technologies, Inc. VT8237 ISA bridge [KT600/K8T800/K8T890 South]

0000:00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller (rev 60)

0000:00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration

0000:00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map

0000:00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller

0000:00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control

0000:01:00.0 VGA compatible controller: nVidia Corporation NV25 [GeForce4 Ti 4600] (rev a3)

```

That means I have a VIA chipset correct?  When I look in ATA/ATAPI/MFM/RLL support, it has Intel PIIXn support enabled but it has VIA as a module.  Does that mean that I need to have the VIA module loaded automatically and it will correct the problem?

Thanks,

Jeremy

----------

## conchyliferous

Yes, I'm certain of it. And since you got a AMD-based system you can safely remove the support for Intel chipsets.

Less things in kernel, faster system.Last edited by conchyliferous on Wed Jul 20, 2005 3:50 pm; edited 1 time in total

----------

## jkruer01

ok, thanks.  I added via82cxxx to /etc/modules.autoload.d/kernel-2.6 and I also did a 

```
modprobe via82cxxx
```

 but when I try to turn DMA on, I still get the same messge.

Do I need to reboot first?

----------

## jkruer01

I find the following via modules:

```
# find /lib/modules/2.6.11-gentoo-r7/ -type f -iname '*via*.o' -or -iname '*via*.ko'

/lib/modules/2.6.11-gentoo-r7/kernel/sound/pci/snd-via82xx.ko

/lib/modules/2.6.11-gentoo-r7/kernel/drivers/i2c/chips/via686a.ko

/lib/modules/2.6.11-gentoo-r7/kernel/drivers/i2c/busses/i2c-viapro.ko

/lib/modules/2.6.11-gentoo-r7/kernel/drivers/ide/pci/via82cxxx.ko

/lib/modules/2.6.11-gentoo-r7/kernel/drivers/net/via-rhine.ko

/lib/modules/2.6.11-gentoo-r7/kernel/drivers/scsi/sata_via.ko

```

I was assuming that via82cxxx was the correct one.  Am I wrong?  Do I need to include more?

----------

## conchyliferous

Hmm.. I don't really know. If I where you I would compile kernel with that module as a built-in. And if that wouldn't work I would compile all chipset drivers into kernel just to see if I'm on the right track. (and remove them later, just experiment with it  :Cool:  )

There is also a module called 'Generic PCI bus-master DMA support' in the same section you could try to get into your kernel.

 EDIT: 'Generic PCI bus-master DMA support' instead of 'Include IDE/ATA-2 DISK support'

----------

## furanku

You still didn't tell us wether it's an ATA or on SATA harddisk. If it's an SATA HD look at the informations at http://linuxmafia.com/faq/Hardware/sata.html, then the relevant chip is the VT6420 and the needed module is "sata_via", some people also report that they needed to unload/exclude from the kernel the generic IDE drivers "ide-cd, ide-disk, ide-generic". But, as I said, I'm not an expert.

----------

## conchyliferous

Looked at one of your previous posts and found the following:

 *Quote:*   

> 0000:00:0f.0 RAID bus controller: VIA Technologies, Inc. VIA VT6420 SATA RAID Controller (rev 80) 

 

This looks lika SATA to me. To get proper support for this you should consider to also compile the following into kernel:

```
Device Drivers -> SCSI device support -> SCSI low-level drivers -> Serial ATA (SATA) support

Device Drivers -> SCSI device support -> SCSI low-level drivers -> VIA SATA support
```

But be sure not to have the following:

```
Device Drivers -> ATA/ATAPI/MFM/RLL support -> Support for SATA (deprecated; conflicts with libata SATA driver)
```

Try this.

----------

## jkruer01

I didn't think it was SATA.  I thought it was just ATA.  Is there anyway to tell for sure?  I think my motherboard supports SATA but I don't think mine is, but maybe I am wrong.

----------

## conchyliferous

Well..  :Razz: 

The best way is to pick up a screwdriver and crack the box open and look at the disks.

I guess another way is to look in bios, you could get a nice list of disks in there.

Otherwise just put those things into kernel and see if that makes any difference. It doesn't hurt, just makes the boot slower. And if it's not good for anything just change it back.

Don't be afraid of playing with kernel configurations. I re-compile mine very often...Last edited by conchyliferous on Wed Jul 20, 2005 3:51 pm; edited 1 time in total

----------

## simkin

jkruer01, my lspci output is similar to yours (possibly very similar motherboard) and also had this problem. Like conchyliferous said, It was because of the chipset driver. If you compile it in the kernel (not as a module), I'm sure that'd solve the problem. It worked in my box.

```

    Device Drivers  --->

       ATA/ATAPI/MFM/RLL support  --->

            <*>         VIA82CXXX chipset support

```

----------

## jkruer01

Hey everyone,

I rebuilt the kernel and enabled support for the VIA chipset and everything worked great.  Thanks a lot!

----------

## Nille

 *jkruer01 wrote:*   

> Hey everyone,
> 
> I rebuilt the kernel and enabled support for the VIA chipset and everything worked great.  Thanks a lot!

 

What did you select in the menuconfig? I've been struggeling with the DMA enabling myself...

----------

## conchyliferous

That depends on what chipset you got, and therefore what motherboard you got.

If you got an Intel processor it's most certain the following chipset driver (since motherboards with Intel sockets got Intel chipsets):

```
Device Drivers->ATA/ATAPI/MFM/RLL support->Intel PIIXn chipsets support
```

If you got anything else you have to either know what brand of chipset you got (check motherboard manual) or try to get the computer to tell you. Try the following command:

```
# lspci
```

There you will get alot of information and if for instance VIA comes up a lot it's a VIA chipset you got, and so on.

If it's VIA chipset enable the following:

```
Device Drivers->ATA/ATAPI/MFM/RLL support->VIA82CXXX chipset support
```

The thing is that you should have the right chipset driver compiled into kernel and they are all there and there is not that many to choose from.

It's just to experiment with it until it works. You can't make your computer explode by compiling kernel  :Razz: 

And if you find the right one and everything works, be sure to have only one chipset driver compiled, just for your computer performance. You only have one chipset and only need one driver...

That should be clear enough.

----------

## Nille

It's very clear, but it's not working... I've got a Via 82cxxx chipset, so i enabled that in menuconfig, make && make install_modules, cp arch/i386/... , cp System.Map, cp .config all to /boot. reboot, not working..

I compiled kernels with various DMA/IDE/chipset support. Never got dma working...

When booting from livecd it works. VP_IDE shows up in dmesg, when i boot with my kernel i get no VP_IDE in dmesg.

No DMA gives me 5.6MB/sec, DMA gives me 41MB/sec.

Sucks extremely...

----------

## conchyliferous

Strange.

I don't really know exactly what it is that's missing.

But since it workes with livecd it have to be a kernel thing. Just experiment with it and try to enable everything you see that might help your disk. If it works then try to disable things and see when it's not working anymore. Just to try figure out what it is.

Also be sure to not compile them as modules.

Also remember that if it's a SATA disk you need some SCSI support for it. You should in that case look if the following kernel options is enabled:

```
Device Drivers->SCSI device support->SCSI low-level drivers->Serial ATA (SATA) support->VIA SATA support
```

And also the following:

```
Device Drivers->SCSI device support->SCSI disk support
```

But I guess you already have that one since the disk is working.

Hope that helps to get DMA to work, I know how hard it sucks not having it...

----------

## Nille

update:

Since the Gentoo LiveCD is using DMA, i took a drastic approach.  :Smile: 

1) i took the .config file from the the livecd and copied it over my .config in /usr/src/linux. 

2) make && make modules_install

3) waiting

4) cp /arch/i386 etc

5) cp System.Map etc

6) shutdown -r now

Assuming the kernel would have the same settings, drivers,.. i was full with hope. But unfortunately, DMA support still not there.

Am i doing it wrong or what?

PS: The VIA chipset is the VIA82C686A, there is en B version too. But i doubt that would be the problem.

----------

## fcgreg

 *Nille wrote:*   

> update:
> 
> Since the Gentoo LiveCD is using DMA, i took a drastic approach. 
> 
> 1) i took the .config file from the the livecd and copied it over my .config in /usr/src/linux. ....
> ...

 

IIRC, I think the LiveCD's use genkernel, which makes modules out of many things and requires additional kernel parameters at boot-up to work properly.  Therefore, merely taking that config and sticking on your system to compile would NOT necessarily help you.  You would also need to load all of the relevant modules on boot-up.

You have two choices:

1) Either do more testing and research as others here have suggested.  This means learning more about your system and about Linux, which is a good option if you have the time.

- OR -

2) You can go back and install your kernel via the Gentoo Handbook, but this time use the genkernel option (instead of a manual compile).  For an x86 system you can find it in the manual here.  If you don't want to learn the ins-and-outs of manual compilation then this is the route for you.

----------

## Nille

I fixed it already.

uname -v told me that i was still using the first kernel I compiled. One without VIA82cXXX support.

I compiled a new one, added it next to the boot partition and configured grub to use the new one. Then booted with that one and it worked. So somehow my kernel upgrade procedure was wrong. Although i followed the guides...

It's working fine now.

----------

## fcgreg

Glad to hear it.  Nice going!  I suspected something like that.

Now you're that much better with Linux for the experience.  :Wink: 

----------

