# STUPID DMA [SOLVED]

## memborg

Mjallo

I am going crazy. I have tried searching the forums for help on this and the problem will not go away. As you probably already have figured out the problem concerns DMA on my primary HD. I can not seem to switch it on at all. As already mentioned I have searched the forums and it did not help me.

Here is my lspci output:

```

0000:00:00.0 Host bridge: Intel Corporation 82875P/E7210 Memory Controller Hub (rev 02)

0000:00:01.0 PCI bridge: Intel Corporation 82875P Processor to AGP Controller (rev 02)

0000:00:1d.0 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #1 (rev 02)

0000:00:1d.1 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #2 (rev 02)

0000:00:1d.2 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI #3 (rev 02)

0000:00:1d.3 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #4 (rev 02)

0000:00:1d.7 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB2 EHCI Controller (rev 02)

0000:00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev c2)

0000:00:1f.0 ISA bridge: Intel Corporation 82801EB/ER (ICH5/ICH5R) LPC Interface Bridge (rev 02)

0000:00:1f.2 IDE interface: Intel Corporation 82801EB (ICH5) SATA Controller (rev 02)

0000:00:1f.3 SMBus: Intel Corporation 82801EB/ER (ICH5/ICH5R) SMBus Controller (rev 02)

0000:00:1f.5 Multimedia audio controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller (rev 02)

0000:02:01.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5705 Gigabit Ethernet (rev 03)

0000:02:04.0 VGA compatible controller: nVidia Corporation NV4 [RIVA TNT] (rev 04)

0000:02:05.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

```

As you might suggest I use the Intel PIIXn driver for my chipset. And I am sure that is the right driver. I have also checked that DMA is turned on in my BIOS.

What am I doing wrong? I cannot figure this out. If it helps the motherboard is an EPoX 4PCA3+. One last thing, I get that WARNING message when I boot my system saying that my DMA is switched of and the system will run seriously slow.

----------

## boomslanger

What output does running the following give ?

```
/sbin/hdparm -d 1 /dev/hda
```

----------

## memborg

The hdparm output

```

/dev/hda:

 setting using_dma to 1 (on)

 HDIO_SET_DMA failed: Operation not permitted

 using_dma    =  0 (off)

```

----------

## boomslanger

 *memborg wrote:*   

> The hdparm output
> 
> ```
> 
> /dev/hda:
> ...

 

Ah, of course, you're running SATA drives. As far as I know hdparm has limited support for SATA drives at the moment, and the chances are that DMA is being used even though hdparm isn't reporting it properly.

I'm not sure where the error you're reporting is being generated but I suspect it's using the output from hdparm to determin whether DMA is active or not, and it's therefore reporting the error incorrectly.

----------

## memborg

Yeah I know, but my /dev/hda is not an S-ATA drive. Does one S-ATA affect dma on standard P-ATA?

Secondly, what error are you referring to?

----------

## boomslanger

Looking at your results from lspci you only have one IDE SATA controller.

```
0000:00:1f.2 IDE interface: Intel Corporation 82801EB (ICH5) SATA Controller (rev 02)
```

It's probably the controller rather than the drive which is miss handling the hdparm request to set/request the DMA of the drive.

 *memborg wrote:*   

> Secondly, what error are you referring to?

 

Sorry, should have said warning rather than error 

 *memborg wrote:*   

> One last thing, I get that WARNING message when I boot my system saying that my DMA is switched of and the system will run seriously slow.

 

----------

## memborg

Ooh... crap... What you are saying is that I cannot have DMA at all because of my IDE controller.

Yes the warning message is the like the on hdparm gives me. Stating that the DMA cannont be turned on.

----------

## boomslanger

Well it could be that SATA controller has switched DMA on for /dev/hda, but you can't get hdparm to tell you whether its on or off.  Is the performance of the drive less than expected?

The hdparm timing tests should still work, what are the outputs from the read tests?

```
/sbin/hdparm -tT /dev/hda
```

----------

## memborg

This is the rersult I get from hdparm

```

hdparm -tT /dev/hda

/dev/hda:

 Timing cached reads:   2740 MB in  2.00 seconds = 1369.52 MB/sec

 Timing buffered disk reads:   18 MB in  3.12 seconds =   5.77 MB/sec

```

The first number seems unrealistic to me.

----------

## irasnyd

When you ran:

```
/sbin/hdparm -d 1 /dev/hda
```

were you running as root? (just have to make sure)

----------

## memborg

Yes... shouldn't I?

It's ok to ask  :Smile: 

----------

## irasnyd

 *memborg wrote:*   

> Yes... shouldn't I?
> 
> It's ok to ask 

 

Yeah, you definitely should be doing it as root. I don't know why this would fail for a PATA drive, but I don't have a recent Intel chipset either. Sorry I can't be of any more help.

If I try setting DMA on my SATA drives (hooked up through a SiI3112 controller) I get:

```
/dev/sdb:

 setting using_dma to 1 (on)

 HDIO_SET_DMA failed: Inappropriate ioctl for device
```

Note that DMA is definitely working though. I can tell just from the hdparm -tT tests. I'm curious as to why it isn't working for you.

----------

## memborg

Well thanks anyway.

I get the same error as you if I try to set DMA on my /dev/sda which is my S-ATA drive.

----------

## razorback

Are you sure everything is set correctly in your kernel. This is what I have for the 2.6.12 kernel and an NF4 Ultra motherboard as far as IDE DMA is concerned:

nf4~x86 linux # cat .config | grep IDEDMA

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

----------

## bollucks

You have a BIOS issue. The SATA drivers don't like the PATA drivers being enabled. Try disabling PATA in the BIOS if you're using SATA or vice versa.

----------

## memborg

To razorback: Yes I Have. I have followed some of the other advises on this forum before posting myself.

 *Quote:*   

> 
> 
> You have a BIOS issue. The SATA drivers don't like the PATA drivers being enabled. Try disabling PATA in the BIOS if you're using SATA or vice versa.

 

OK... Hmm... that is not an option then, because I use the SATA drive as my home dir and the PATA as my /. Hmm maybe there is an BIOS upgrade that can solve this problem. I will get back to you when I have tried that.

----------

## razorback

Okay. I noticed in your lspci list that a PATA controller was not enumerated. It only shows the SATA controller. Is the ICH IDE controller enumerated on boot?

nf4~x86 me # dmesg | grep IDE

ACPI: PCI Interrupt Link [LIDE] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.

Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2

NFORCE-CK804: IDE controller at PCI slot 0000:00:06.0

Probing IDE interface ide0...

Probing IDE interface ide1...

Probing IDE interface ide1...

Probing IDE interface ide2...

Probing IDE interface ide3...

Probing IDE interface ide4...

Probing IDE interface ide5...

I would suspect either the kernel is using the generic PCI IDE driver or a BIOS issue.

----------

## schlummerkissen

I am runnig gentoo 2.6.11-r9 on my Acer Travelmate 4101 WLMi.

My hd is also very slow.

results of  "hdparm -tT /dev/hda":

cached reads

   2840 MB in 2 secs 

   1418,8 MB/s

buffered disk reads

   4 MB in 4 ,42 secs

  926,21KB/s

on dsl 1.01 ct version i got:

cached reads

  3548 MB in 2 secs

  1774MB/s

buffered disk reads

  80 MB in 3,04 secs

 26,32 MB/s

Thats very strange.

I know that my dma isnt working under gentoo but i cant enable it.

here my "lspci"

0000:00:00.0 Host bridge: Intel Corporation Mobile 915GM/PM/GMS/910GML Express Processor to DRAM Controller (rev 03)

0000:00:01.0 PCI bridge: Intel Corporation Mobile 915GM/PM Express PCI Express Root Port (rev 03)

0000:00:1c.0 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 1 (rev 04)

0000:00:1c.1 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 2 (rev 04)

0000:00:1c.2 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 3 (rev 04)

0000:00:1d.0 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #1 (rev 04)

0000:00:1d.1 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #2 (rev 04)

0000:00:1d.2 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #3 (rev 04)

0000:00:1d.3 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #4 (rev 04)

0000:00:1d.7 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB2 EHCI Controller (rev 04)

0000:00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev d4)

0000:00:1e.2 Multimedia audio controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller (rev 04)

0000:00:1e.3 Modem: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Modem Controller (rev 04)

0000:00:1f.0 ISA bridge: Intel Corporation 82801FBM (ICH6M) LPC Interface Bridge (rev 04)

0000:00:1f.1 IDE interface: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) IDE Controller (rev 04)

0000:00:1f.3 SMBus: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) SMBus Controller (rev 04)

0000:01:00.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility X700 (PCIE)

0000:06:01.0 CardBus bridge: Texas Instruments Texas Instruments PCIxx21/x515 Cardbus Controller

0000:06:01.2 FireWire (IEEE 1394): Texas Instruments Texas Instruments OHCI Compliant IEEE 1394 Host Controller

0000:06:01.3 Unknown mass storage controller: Texas Instruments Texas Instruments PCIxx21 Integrated FlashMedia Controller

0000:06:03.0 Network controller: Intel Corporation PRO/Wireless 2200BG (rev 05)

0000:06:08.0 Ethernet controller: Broadcom Corporation BCM4401 100Base-T (rev 01)

dont know what to do,

maybe a kernel-uptade would fix it?

----------

## schlummerkissen

I could increase the cached reads:

after 

"hdparm -m 16 /dev/hda"

i got the same result in cached reads as under dsl

----------

## schlummerkissen

i think it must be a problem in the kernel, maybe in your kernel config.i tested my pc with dsl 1.01,  windows and auditor security collection. the result is:

after acivating dma on auditor, worked without problems with hdparm, i got the same results in dsl and auditor:

buffered reads 26,6MB/s. In windows its nearly the same. Because Auditor and dsl are using another kernel and are based on knoppix, i think, they detected my devices correctly so that i could run dma.

I will chekc it in the next days with new kernel config.

----------

## mcmillan_43a

I'm having the same issue with my dvd/cdrom drive.  I have sata drives and they work perfect.  The problem occurs with >=2.6.10 kernel.  I can set the dma using 2.6.9. 

I've recompiled the kernel, verifying the ide devices drivers, switched drives, etc. but to no avail.  This normally would not be a problem for me on my other systems, however, not being able to set dma for the dvd/cd drive severely impacts my ability to play dvd.  I'm attempting to build a multimedia system and right now it's the only stumbling block.

I would stay at 2.6.9, but 2.6.12 has included modules for pchdtv card.

Is there a problem with the ide driver in >=2.6.10 kernel?

----------

## Nille

I'm having similar issues with my /dev/hda. hdparm -tT always 5.61MB/sec. Pure misery.

I have a Via vt82c686a chipset. I tried various kinds of kernel settings, only with the via driver, other drivers, no drivers at all. No luck. Funny thing is that with the livecd i get 41MB/sec, just like in Windows. Thus DMA is working...

System: PIII 1.0GHz ata66 support on mobo, maxtor 80GB, gentoo 2005.0, xorg 6.8, xfce4.2,...

Any ideas or pointers?

edit:

After some more investigating i discovered that on the livecd (dmesg command) there was VP_IDE in the listing

```

VP_IDE: IDE controller at PCI slot 0000:00:04.1

VP_IDE: chipset revision 16

VP_IDE: not 100% native mode: will probe irqs later

VP_IDE: VIA vt82c686a (rev 22) IDE UDMA66 controller on pci0000:00:04.1

    ide0: BM-DMA at 0xd800-0xd807, BIOS settings: hda:DMA, hdb:pio

    ide1: BM-DMA at 0xd808-0xd80f, BIOS settings: hdc:pio, hdd:DMA

```

on my system with own compiled kernel there was no VP_IDE in the dmesg command. So i guess there is the problem. Having dicovered that, i still haven't found a solution to 'enable' it on my system.

----------

## memborg

Well I have narrowed it down to be a BIOS problem for my motherboard.. I've tried the livecd and it gies me the same errors as ealier reported in this thread. Sorry for the late answer but I have been on holiday for a week.

----------

## memborg

 *razorback wrote:*   

> Okay. I noticed in your lspci list that a PATA controller was not enumerated. It only shows the SATA controller. Is the ICH IDE controller enumerated on boot?
> 
> nf4~x86 me # dmesg | grep IDE
> 
> ACPI: PCI Interrupt Link [LIDE] (IRQs 3 4 5 7 9 10 11 12 14 15) *0, disabled.
> ...

 

Yes it does enumerate the IDE controller.

----------

## StarDragon

thanks guys for your responses this problem was drving me nuts too!!!

i guess the system is fast enough, so im assuing i am on dma...   :Cool: 

----------

## keli

For me (and I have to suppose, for the TLP neither) it was not a BIOS bug, but only a misconfiguration.

My ASUS P4C800 mobo giving these errors had to be configured properly in the BIOS. 

Ide Configuration > Enhanced Mode > S-ATA worked for me. After this setting, it let me set dma, and the difference showed up just as expected (so no faulty dma reporting either)

I remember I had some problems with these configurations eariler (when the box was first installed, still with 2.4 kernel as far as I remember), but currently it booted without a problem to 2.6.14-hardened-r8, with all drives beeing in teheir "place" (the PATA is /dev/hda, the two SATA-s are /dev/sda & /dev/sdb and the CDROM is /dev/hdd). Might I add, before this setting the BIOS wouldn't even recognize the CD on secondary slave. (I just didn't noticed, as it wasn't used at all)

----------

