# activate DMA

## zaggo

Hi!

When i do a hdparm -d1 /dev/bla i get an error. I searched the forum and the google.groups but only found the problems with older kernels. I don't know what the problem could be. I've activated DMA in the kernel and the VIA chipset support. It also worked some time ago but I've tried to patch the kernel with v4l2, which failed and had to recompile the kernel and since then it isn't working.

The error msg:

```

b-28 root # hdparm -d1 /dev/hda

/dev/hda:

 setting using_dma to 1 (on)

 HDIO_SET_DMA failed: Operation not permitted

 using_dma    =  0 (off)

b-28 root # hdparm -d1 /dev/dvd

/dev/dvd:

 setting using_dma to 1 (on)

 HDIO_SET_DMA failed: Operation not permitted

 using_dma    =  0 (off)

```

my Kernel .config:

```

b-28 root # less /usr/src/linux/.config | grep DMA

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

# CONFIG_BLK_DEV_IDEDMA_TIMEOUT is not set

# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set

CONFIG_BLK_DEV_ADMA=y

# CONFIG_HPT34X_AUTODMA is not set

CONFIG_IDEDMA_AUTO=y

# CONFIG_IDEDMA_IVB is not set

# CONFIG_DMA_NONPCI is not set

# CONFIG_SCSI_EATA_DMA is not set

b-28 root # less /usr/src/linux/.config | grep VIA

# CONFIG_VIA_NORTHBRIDGE_FIXUP is not set

CONFIG_BLK_DEV_VIA82CXXX=y

# CONFIG_VIA_RHINE is not set

# CONFIG_VIA_RHINE_MMIO is not set

CONFIG_AGP_VIA=y

# CONFIG_SOUND_VIA82CXXX is not set

# CONFIG_MIDI_VIA82CXXX is not set

```

I hope that someone can help me because without activating dma on my dvd drive i can't watch dvds   :Crying or Very sad:  .

greetings

 Manuel

----------

## gabberist

I had the exact same problem with my laptop.

the way i got dma to work was by using the ac series of kernels or the development(using the ac-pre102 ebuild now)

I have a feeling the gentoo sources should work but i never could get dma working with them:(

I'll post my config when i get around my laptop later today maybe that would help to

----------

## pjp

What kind of drive is /dev/hda?  I don't think DVD/CD drives support DMA modes (or at least I've read that hdparm doesn't work on them).

----------

## ReBirth

I too have the same problem.. 

What VIA chipset you using? I am using VIA 8235 chipset. I may try the ac series kernel later and see if it will help.

----------

## zaggo

 *kanuslupus wrote:*   

> What kind of drive is /dev/hda?  I don't think DVD/CD drives support DMA modes (or at least I've read that hdparm doesn't work on them).

 

/dev/hda is a harddisk. The strange thing is that it used to work with no problems. Also with the DVD drive.

@ReBirth:

I've got an VT8367 (VIA Apollo KT333).

Are there any others problems known with the ac kernel series (because of the development status,...)?

greetings,

 Manuel

----------

## TuxFriend

 *kanuslupus wrote:*   

> What kind of drive is /dev/hda?  I don't think DVD/CD drives support DMA modes (or at least I've read that hdparm doesn't work on them).

 

Actually they do, but (at least for me) turning DMA on makes the drive slower.

TuxFriend

----------

## zaggo

 *gabberist wrote:*   

> I had the exact same problem with my laptop.
> 
> the way i got dma to work was by using the ac series of kernels or the development(using the ac-pre102 ebuild now)
> 
> I have a feeling the gentoo sources should work but i never could get dma working with them:(
> ...

 

I just tried the ac-sources and it works great. DMA is working again.  :Smile: 

I just have one more question: What's the difference between the different kernel-sources. Is there a good description somewhere? Would be interesting.

greetings

 Manuel

----------

## ReBirth

yeah. I tried the ac sources kernel and DMA is working again now. 

I guess the ac sources isn't as stable as the other kernels. That's fine with me cause I only use it at home for my workstation.

----------

## Fmangeant

Hi

I had the same problem on a laptop (Pentium IV + ALI M15x3 chipset).

The only kernel allowing DMA on the hard disk (FUJITSU MHR2020AT, 20 Gb) is the 2.4.20-pre5-ac4 + IDE patch (available here : http://www.linuxdiskcert.org/).

I went from 3 Mb/s to ~ 20 Mb/s...

Regards,

----------

## gabberist

good to hear it got working as far as the descriptioon of the ac series all i ever found was a long list of what the patches fixed change/added tho i hope the dma issue gets into the vanilla or gentoo sources soon.

with the dma on dvd/cdrom I'm pretty sure that they wont accept hdparm commands unless you have them listed as scsi devices(well its the only way i could figure it out)

to do that I enabled cdrom scsi support , scsi generic support and scsi emulation for atapi ias modules from the kernel.

then stick a hdx=ide-scsi line in grub/lilo  and add symlinks from your cd/dvd drive to /dev/srx,/dev/scx or /dev/scsi ..i think the scsi device in /dev depend on the kernel but im not sure

----------

## Bosnian[X]

where did you find AC kernels that enables DMA mode. I have latest VIA8235 as well and can't get dma to work. I tried latest 2.5.x kernel and it workd but Nvidia doesen't support that kernel.

Only thing i found was the patches 2.4.20-pre-something. How do u patch existing kernel. Little guide would be a huge help.

Thanx in advance   :Smile: 

----------

## zaggo

 *gabberist wrote:*   

> 
> 
> [snip]
> 
> with the dma on dvd/cdrom I'm pretty sure that they wont accept hdparm commands unless you have them listed as scsi devices(well its the only way i could figure it out)
> ...

 

That's not true becuause I haven't listed my DVD-drive as SCSI-drive (i've my CD-RW emulated as SCSI) and it accepts hdparm commands. Without DMA for example i'm not realley able to watch dvd movies because they are bucking but when I do a hdparm -d1 /dev/dvd (which is linked to my dvd drive) it works great   :Very Happy:  .

```

b-28 root # hdparm -d1 /dev/dvd 

/dev/dvd:

 setting using_dma to 1 (on)

 using_dma    =  1 (on)

```

@Bosnian[X]:

The AC-kernel is in the portage tree /sys-kernel/ac-sources. Just emerge the kernel sources and "bake" the new kernel   :Smile:  . If you need some help doing that just let me know.

Greets,

 Manuel

----------

## Bosnian[X]

can i "cd" directly to AC kernel and bake the kernel or should i: mv linux linux-2.4.19-pre9 and than mv AC kernel to linux???

----------

## zaggo

Hi!

 *Bosnian[X] wrote:*   

> can i "cd" directly to AC kernel and bake the kernel or should i: mv linux linux-2.4.19-pre9 and than mv AC kernel to linux???

 

I've just emerged ac-sources and got a directory /usr/src/linux-2.4.20-pre10-ac2. In addition you should have a link named /usr/src/linux which is linked to your actual kernel (e.g.: linux -> linux-2.4.19-gentoo-r9). Now you have to make a new link to linux-2.4.20-pre10-ac2 with ln -s. Then change in the /usr/src/linux directory and make a make menuconfig.

Ciao,

 Manuel

----------

## phong

A friend of mine had this problem.  Apparently it's a conflict between the 2.4.19 kernel and certain chipsets.  The bug did not exist in 2.4.18 and since it's fixed in the AC kernel tree, it will likely be fixed in 2.4.20.

----------

## Bosnian[X]

It's working now....i had to re-install my system because i changed my cflags to suit my AMD XP and now with the AC kernel-sources everything works perfect and faster than damn "M$ XP".

----------

## Reformist

I had a similar problem, same error message. The problem was that I did not check the box in the kernel config for my particular chipset's ide controller support, although I had DMA enabled. Upon rebuilding that kernel (and solving a lot of othe trouble) my cache speed went from 2.5MB to 36MB.

Woohoo!! Hopefully I'll get some better loading speeds.

----------

