# [SOLVED] dma appears off even if I turn it on

## queen

I installed a new kernel 2.6.24-gentoo-r3 and since then when it boots it tells me that "dma is turned off and i should turn it on". I turned it on and in the next boot I get the same error. 

```
hdparm -cuda /dev/hda

/dev/hda:

 IO_support    =  0 (default)

16-bit)

 unmaskirq     =  0 (off)

 using_dma     =  0 (off)

 readahead     = 256 (on)

```

```
hdparm -i /dev/hda

/dev/hda:

 Model=FUJITSU MHV2060AT, FwRev=000000A0, SerialNo=NSC6T6B27DJV

 Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }

 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=0

 BuffType=DualPortCache, BuffSize=8192kB, MaxMultSect=16, MultSect=16

 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=117210240

 IORDY=yes, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}

 PIO modes:  pio0 pio1 pio2 pio3 pio4

 DMA modes:  mdma0 mdma1 mdma2

 UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5

 AdvancedPM=yes: mode=0x80 (128) WriteCache=enabled

 Drive conforms to: unknown:  ATA/ATAPI-2,3,4,5,6,7

 * signifies the current active mode

```

Where should I look in the kernel? 

I use 

```
d 1 -A 1 -m 16 -u 1 -a 64
```

 as per handbook instructions. but the problem is that after next boot the dma is turned off. I never had such problems before. I never added hdparm at boot run level. 

```
lspci |grep -i ide

00:1f.1 IDE interface: Intel Corporation 82801DBM (ICH4-M) IDE Controller (rev 03)

carin ~ # grep -i ich /usr/src/linux/.config

CONFIG_X86_SPEEDSTEP_ICH=y

CONFIG_CRYPTO_MICHAEL_MIC=y

```

Thanks in advance,

QueenLast edited by queen on Sat Apr 12, 2008 3:10 pm; edited 1 time in total

----------

## NeddySeagoon

queen,

The new way is to set your kernel up like this

Your drive will become /dev/sda, so be sure to fix grub.conf and /etc/fstab. 

The old way is this which has more settings to get right.

The old IDE kernel branch will be dropped one day, so it will no longer be an option. Its some way of yet as not all the PATA drivers are have been ported to libata.

Choose one or the other - not both

----------

## queen

 *NeddySeagoon wrote:*   

> queen,
> 
> The new way is to set your kernel up like this
> 
> Your drive will become /dev/sda, so be sure to fix grub.conf and /etc/fstab. 
> ...

 

Thanks, but according to the first method isn't it a little bit odd to say that the hd is sata instead of ide? After all the hd is ide. I am not an expert in hardware.

----------

## Koda

 *NeddySeagoon wrote:*   

> queen,
> 
> The new way is to set your kernel up like this
> 
> Your drive will become /dev/sda, so be sure to fix grub.conf and /etc/fstab. 
> ...

 

sorry for the ot, buf after following the first guide, should we still run hdparm at boot?

thanks

bye

Koda

----------

## NeddySeagoon

queen,

The reason for the /dev/sda name for IDE drives under the new method is that the kernel disk handlers are split into layers.

There are two main top level ones. IDE and SCSI. 

The IDE top level layer names things /dev/hd...

The SCSI top level layer names things /dev/sd...

Under each top level layer is long list chip set specific modules. For your ICH4 chipset, there is chip set specific modiule for each high level layer.

The kernel is structured this way to make it easy to add chip set drivers without having to add the high level drive every time.

As you will be moving your drive to be controlled by the SCSI top level layer, it will get a SCSI name, even though it will use a IDE low level chip set driver.

----------

## queen

 *Koda wrote:*   

>  *NeddySeagoon wrote:*   queen,
> 
> The new way is to set your kernel up like this
> 
> Your drive will become /dev/sda, so be sure to fix grub.conf and /etc/fstab. 
> ...

 

The answer is definitely no. I never used it at boot/default and the dma was on. I saw on a thread of linux questions that someone advised to add it.  Now, I upgraded the kernel and missed a setting in the kernel. 

I followed the guide NeddySeygon gave and now it works. Meanwhile, I selected the old setting that he advised. 

Thanks Neddy.   :Very Happy: 

----------

## NeddySeagoon

Koda,

hdparm should never be needed at boot with a properly configured kernel.

Some of its options will cause errors if the drive is under the SCSI layer.

e.g. setting DMA on/off is not a legal thing to do. SCSI demands that DMA be on and the low level drivers all know this.

Thats why all the DMA options in the IDE kernel branch are missing in the SCSI branch. They are not needed.

----------

## queen

 *NeddySeagoon wrote:*   

> Koda,
> 
> Thats why all the DMA options in the IDE kernel branch are missing in the SCSI branch. They are not needed.

 

In the older kernel 2.6.19 I had the dma option in scsi branch. Now in 2.6.24 it doesn't appear anymore. Now I understand why.

----------

## queen

 *NeddySeagoon wrote:*   

> queen,
> 
> The reason for the /dev/sda name for IDE drives under the new method is that the kernel disk handlers are split into layers.
> 
> There are two main top level ones. IDE and SCSI. 
> ...

 

Makes sense. I understand better now. Thanks.  :Wink: 

----------

## SeaTiger

queen,

You are correct that you are not using dma, but you are using udma, which mean ultra dma.

```
hdparm -i /dev/hda

/dev/hda:

 Model=FUJITSU MHV2060AT, FwRev=000000A0, SerialNo=NSC6T6B27DJV

 Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }

 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=0

 BuffType=DualPortCache, BuffSize=8192kB, MaxMultSect=16, MultSect=16

 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=117210240

 IORDY=yes, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}

 PIO modes:  pio0 pio1 pio2 pio3 pio4

 DMA modes:  mdma0 mdma1 mdma2

 UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5

 AdvancedPM=yes: mode=0x80 (128) WriteCache=enabled

 Drive conforms to: unknown:  ATA/ATAPI-2,3,4,5,6,7

 * signifies the current active mode
```

Look at the "UDMA" line:

```
UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5
```

Your hd is using udma5 mode.

To be sure your hd speed is reasonable, do the following:

```
hdparm -t /dev/hda
```

----------

## NeddySeagoon

junksiu,

The output of the 

```
hdparm -iI /dev/hda
```

 command is misleading.

Both show flags capabilities, not what is actually in use.

```
hdparm /dev/hda
```

shows if DMA mechanism is in use.

Other than the speed, DMA and UDMA use exactly the same mechanism. To achieve UDMA speeds the hardware must support it, including the use of 80 wire IDE ribbon cables, which suitable hardware can detect.

----------

## SeaTiger

 *NeddySeagoon wrote:*   

> The output of the 
> 
> ```
> hdparm -iI /dev/hda
> ```
> ...

 

But what about the line:

```
* signifies the current active mode
```

I thought that is showing what is currently used  :Shocked: 

----------

## NeddySeagoon

junksiu,

Thats why its misleading ... I thought that until it showed (U)DMA in use and and very poor (non DMA) hdparm -tT times.

----------

## queen

 *junksiu wrote:*   

> queen,
> 
> You are correct that you are not using dma, but you are using udma, which mean ultra dma.
> 
> ```
> ...

 

Neddy is right about -i misleading. From man hdparm 

```
    

 -i    [b] Display the identification info that was obtained from the drive at boot time,[/b] if  available.

              This  is a feature of modern IDE drives, and may not be supported by older devices.  The data

              returned may or may not be current, depending on activity since booting the system.  However,

              the  current  multiple sector mode count is always shown.  For a more detailed interpretation

              of the identification info, refer to AT Attachment Interface for Disk Drives (ANSI ASC X3T9.2

              working draft, revision 4a, April 19/93).

 
```

Neddy, I did 

```
hdparm -tT /dev/hda

/dev/hda:

 Timing cached reads:   1436 MB in  2.00 seconds = 717.74 MB/sec

 Timing buffered disk reads:   94 MB in  3.02 seconds =  31.15 MB/sec

```

The numbers are reasonable? Or it can perform much better?

----------

## NeddySeagoon

queen,

The  Timing cached reads:   1436 MB in  2.00 seconds = 717.74 MB/sec is ok. Thats the speed at which you can move data over the IDE interface from the cache RAM on the drive.

The Timing buffered disk reads:   94 MB in  3.02 seconds =  31.15 MB/sec is the speed at which tou can get data off the drive platter.

As you used /dev/hda, its testing at the outside of the drive. 31.15MB/sec shows that DMA is in use. With PIO, you would be lucky to get 1/10 of that speed.

I cannot say if 31.15MB/sec is good for your drive. It depends on the drive rotational speed, the drive diameter, and to some extent, the age of the drive, as newer drives use smaller magnetic domains on the platter, so everything else being equal, are faster.

You have DMA in use, provided you have 80 core IDE ribbon cables, thats as fast as your hardware can go.

----------

## queen

 *NeddySeagoon wrote:*   

> queen,
> 
> The  Timing cached reads:   1436 MB in  2.00 seconds = 717.74 MB/sec is ok. Thats the speed at which you can move data over the IDE interface from the cache RAM on the drive.
> 
> The Timing buffered disk reads:   94 MB in  3.02 seconds =  31.15 MB/sec is the speed at which tou can get data off the drive platter.
> ...

 

The hd is fujitsu siemens 60gb 4200 rpm 2.5 inch for a laptop. It's about 2 years old. Here are more details about the hd: http://www.fujitsu.com/us/services/computing/storage/hdd/mobile/mhv2120at.html#Tab0/tab3

----------

## NeddySeagoon

queen,

30Mb/sec is OK for a drive like that.

----------

## queen

 *NeddySeagoon wrote:*   

> queen,
> 
> 30Mb/sec is OK for a drive like that.

 

Thank you.   :Cool: 

----------

