For all of you out there who get
>> HDIO_SET_DMA failed: Operation not permitted
on your machine with a VIA VT8235 Southbridge: get the new VIA IDE drivers for your kernel (v3.35). It finally solved my hd speed problem.
Get it at VIA IDE Drivers v3.35 by Vojtech Pavlik. Replace your old via82xxx.c in drivers/ide and have fun.

Both from ~3MB/sec and both are ide drives. Man, this post is a god send, before, doing anything in the background (compiling, copying etc) my music would stutter so bad, now it fixed . btw I noticed that in my current kernel, dma isn't enabled by default, if i enabled and recompiled with the via82C... option, will it enable by default?_________________Gentoo Linux amd64 2004.2 --> updated
Amd 3000+
Asus K8N-E mobo
Geforce4 ti 4200

I also have this problem ... I can not setup the DMA in a new HITACHI hard disk to on. So, I am stuck with poor hard disk performance. I have been compiling the kernel with different options but no luck yet.

The options I have:
# ATA/IDE/MFM/RLL support
CONFIG_IDE=y
# IDE, ATA and ATAPI Block devices
CONFIG_BLK_DEV_IDE=y
# IDE, ATA and ATAPI Block devices
CONFIG_BLK_DEV_IDE=y
# 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_IDEDISK_VENDOR is not set
# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set
# CONFIG_BLK_DEV_IDEDISK_IBM is not set
# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set
# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set
# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set
# CONFIG_BLK_DEV_IDEDISK_WD is not set
# CONFIG_BLK_DEV_IDECS 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=m
CONFIG_IDE_TASK_IOCTL=y
CONFIG_IDE_TASKFILE_IO=y
CONFIG_BLK_DEV_IDEPCI=y
CONFIG_IDEPCI_SHARE_IRQ=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_PCI_WIP is not set
# CONFIG_BLK_DEV_IDEDMA_TIMEOUT is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
# CONFIG_AMD74XX_OVERRIDE is not set
# CONFIG_IDE_CHIPSETS is not set
CONFIG_IDEDMA_AUTO=y
# CONFIG_IDEDMA_IVB is not set
CONFIG_BLK_DEV_IDE_MODES=y

Maybe I am getting a bit off topic here. I found the following information about my IDE controller (Intel's 82801CAM IDE U100 controller), which I barely understand but seems to be the reason of why hdparm -d 1 /dev/hda fails:
Mode Data Corruption

Problem:

DMA compatible mode on the secondary channel causes data corruption on primary channel. If a device on one of the IDE interfaces (e.g., the secondary channel), is operating in Multi-Word DMA Mode with compatible timings where the cycle time is 600 ns, while a device on the other interface (primary channel) is running in PIO mode), the IDE PIO pre-fetch buffer will inadvertently provide an extra piece of secondary channel data to the primary device resulting in data corruption. This happens when DMAREQ is deasserted and a DMA transaction is running while a PIO transaction
is outstanding on the other channel.

Implication:

Systems configured in this manner may experience a situation in which the DMA IDE controller transfers incorrect data from the PIO configured device. Exactly how this manifests itself in a system is dependent on the system activity at the time.

Workaround:

When BIOS is determining which mode(s) an IDE device is capable of, it must not set the DMA capable bits in the ICH3-M if that device only supports Mode-0 DMA or slower. That device should be configured for PIO instead.

Status:

There are no plans to fix this erratum.

Is this the really reason why "hdparm -d 1 /dev/hda" does not work ? Any enlightment about what is going on ?

I have since learned that DMA for the ICH4 chipset will not work in the 2.4.19 kernel. It does however wrok very well in the 2.4.20 kernel. This is the one that the livecd uses and it is also the version for the vanilla-sources aswell.

I compiled and tested the 2.4.20 and it worked great with the drives, i forgot to re-link /usr/src/linux the the new kernel and it caused problems with X.

pablo_pita wrote:

Maybe I am getting a bit off topic here. I found the following information about my IDE controller (Intel's 82801CAM IDE U100 controller), which I barely understand but seems to be the reason of why hdparm -d 1 /dev/hda fails:
Mode Data Corruption

Problem:

DMA compatible mode on the secondary channel causes data corruption on primary channel. If a device on one of the IDE interfaces (e.g., the secondary channel), is operating in Multi-Word DMA Mode with compatible timings where the cycle time is 600 ns, while a device on the other interface (primary channel) is running in PIO mode), the IDE PIO pre-fetch buffer will inadvertently provide an extra piece of secondary channel data to the primary device resulting in data corruption. This happens when DMAREQ is deasserted and a DMA transaction is running while a PIO transaction
is outstanding on the other channel.

Implication:

Systems configured in this manner may experience a situation in which the DMA IDE controller transfers incorrect data from the PIO configured device. Exactly how this manifests itself in a system is dependent on the system activity at the time.

Workaround:

When BIOS is determining which mode(s) an IDE device is capable of, it must not set the DMA capable bits in the ICH3-M if that device only supports Mode-0 DMA or slower. That device should be configured for PIO instead.

Status:

There are no plans to fix this erratum.

Is this the really reason why "hdparm -d 1 /dev/hda" does not work ? Any enlightment about what is going on ?

I turned on multcount (it was 0). I also set UDMA to 5 like I said, but neither seems to have any effect at all on my transfer speed. This seems really low for a 7200 rpm hd on a 1533 mhz athlon system and in fact my second hd, a 5200 Maxtor gets the following.

Is this the really reason why "hdparm -d 1 /dev/hda" does not work ? Any enlightment about what is going on ?

I got hdparm to set up the DMA to on !

I had to compile some other options in the kernel to get the support.

I saw in the hdparm source that setting DMA failed on the call to ioctl. I downloaded the 2.4.20-r1 kernel, checked more flags, especially if they had something to do with ioctl or with DMA (and of course, the IDE drive) ... and voila.

the DMA Mode is max out already... I am running on a i810e chipset
I wonder if I get squeeze more performance out of this chipset + HD?
Especially the low "timing buffer-cache reads" speed... since others
are getting something like 4xxMB/sec_________________PIII-S 1.4G / 512MB / TUSL2-M / 3C920 x 2 / Seagate Barracuda IV 40GB

You probably read wrong, it must be 40MB/sec. Your results are quite good and I don't think you can get much more than that.

volospin wrote:

the DMA Mode is max out already... I am running on a i810e chipset
I wonder if I get squeeze more performance out of this chipset + HD?
Especially the low "timing buffer-cache reads" speed... since others
are getting something like 4xxMB/sec

_________________"I'm just very selective about the reality I choose to accept." -- Calvin