# Why i canot enable the hard driver DMA ?

## figo

hi, i install gentoo 2008.0, now i want to         enable the hard driver DMA by "hdparm -d 1 /dev/hda" but:

```
localhost figo # hdparm -d 1 /dev/hda

/dev/hda:

 setting using_dma to 1 (on)

 HDIO_SET_DMA failed: Operation not permitted

 using_dma     =  0 (off)

```

why i canot enable DMA?

my hard driver information:

```
localhost figo # lspci | grep -i ide

00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Controller (rev 01)

localhost figo # hdparm -I /dev/hda

/dev/hda:

ATA device, with non-removable media

   Model Number:       Hitachi HTS541680J9SA00                 

   Serial Number:      SB2204SGDMG9VE

   Firmware Revision:  SB2OC7BP

Standards:

   Used: ATA/ATAPI-7 T13 1532D revision 1 

   Supported: 7 6 5 4 

Configuration:

   Logical      max   current

   cylinders   16383   16383

   heads      16   16

   sectors/track   63   63

   --

   CHS current addressable sectors:   16514064

   LBA    user addressable sectors:  156301488

   LBA48  user addressable sectors:  156301488

   device size with M = 1024*1024:       76319 MBytes

   device size with M = 1000*1000:       80026 MBytes (80 GB)

Capabilities:

   LBA, IORDY(can be disabled)

   Standby timer values: spec'd by Vendor, no device specific minimum

   R/W multiple sector transfer: Max = 16   Current = 16

   Advanced power management level: 128

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

----------

## notHerbert

You have dma enabled *Quote:*   

> *udma5

   :Very Happy: 

----------

## figo

no, it seem to using PIO mode:

```
localhost figo # hdparm -cuda /dev/hda

/dev/hda:

 IO_support    =  0 (default) 

 unmaskirq     =  0 (off)

 using_dma     =  0 (off)

 readahead     = 256 (on)
```

----------

## figo

and the speed is very slow:

```
localhost figo # hdparm -tT /dev/hda

/dev/hda:

 Timing cached reads:   866 MB in  2.00 seconds = 433.08 MB/sec

 Timing buffered disk reads:    6 MB in  3.23 seconds =   1.86 MB/sec

localhost figo # 

```

----------

## eccerr0r

Is this using the 2008.0 boot cd or a kernel you built?

I'd be surprised if the cd has the issue, so assuming the latter - did you enable DMA support for the ICH* IDE driver?

----------

## figo

YES,I install with 2008.0 minial Livecd, so i dont know how to config the hard driver, would you like to help me?

----------

## pappy_mcfae

You give very little info on which to go. Post the results of lspci -n cat /proc/cpuinfo and emerge --info, as well as your /etc/fstab file, and I'll see what I can see.

Blessed be!

Pappy

----------

## Sysa

 *figo wrote:*   

> no, it seem to using PIO mode:
> 
> ```
> localhost figo # hdparm -cuda /dev/hda
> 
> ...

 

Public 

```
hdparm -v /dev/hda

hdparm -i /dev/hda
```

and 

```
grep DMA <your kernel config>
```

----------

## NeddySeagoon

figo,

You are using the old IDE kernel branch for your IDE drives and have either an option missing or an option too many.

Either can prevent you setting DMA on.

Configure your kernel like this and move to the new libata kernel drivers.

Beware the changes to grub.conf and /etc/fstab

----------

## figo

hi all,

 i have reconfig the kernel and add scsi and sata driver for the kernel, and motify the grub.conf and fstab , "/dev/hda" to "/dev/sda", so it can run:

```
localhost figo # hdparm -tT /dev/sda

/dev/sda:

 Timing cached reads:   1776 MB in  2.00 seconds = 888.65 MB/sec

 Timing buffered disk reads:  146 MB in  3.03 seconds =  48.13 MB/sec

```

thank you

----------

