# DMA not working on one hard drive

## romvinot

I have recently acquire a new hard-drive to put in my computer. There seem to be aproblem with it with DMA. During kernel boot I've got those messages :

```

Mar 13 09:32:27 casteladon hda: 80293248 sectors (41110 MB) w/2048KiB Cache, CHS=65535/16/63, UDMA(133)

Mar 13 09:32:27 casteladon /dev/ide/host0/bus0/target0/lun0: p1 p2 p3 p4

Mar 13 09:32:27 casteladon hdb: max request size: 1024KiB

Mar 13 09:32:27 casteladon hdb: 160836480 sectors (82348 MB) w/1821KiB Cache, CHS=16383/255/63, UDMA(100)

Mar 13 09:32:27 casteladon /dev/ide/host0/bus0/target1/lun0:<4>hdb: dma_timer_expiry: dma status == 0x61

Mar 13 09:32:27 casteladon hdb: DMA timeout error

Mar 13 09:32:27 casteladon hdb: dma timeout error: status=0x58 { DriveReady SeekComplete DataRequest }

Mar 13 09:32:27 casteladon 

Mar 13 09:32:27 casteladon p1 p2 <<4>hdb: dma_timer_expiry: dma status == 0x61

Mar 13 09:32:27 casteladon hdb: DMA timeout error

Mar 13 09:32:27 casteladon hdb: dma timeout error: status=0x58 { DriveReady SeekComplete DataRequest }

Mar 13 09:32:27 casteladon 

Mar 13 09:32:27 casteladon p5<4>hdb: dma_timer_expiry: dma status == 0x61

Mar 13 09:32:27 casteladon hdb: DMA timeout error

Mar 13 09:32:27 casteladon hdb: dma timeout error: status=0x58 { DriveReady SeekComplete DataRequest }

Mar 13 09:32:27 casteladon 

Mar 13 09:32:27 casteladon p6 >

Mar 13 09:32:27 casteladon hdc: ATAPI 32X DVD-ROM DVD-R CD-R/RW drive, 2000kB Cache, UDMA(33)

```

in /var/log/messages. It tries to enable DMA during one or two minutes and finally time out.

The first drive (hda) is correctly set as well as the cdrom (hdc) but not the second drive (hdb).

```

casteladon root # hdparm /dev/hda

/dev/hda:

 multcount    = 16 (on)

 IO_support   =  0 (default 16-bit)

 unmaskirq    =  0 (off)

 using_dma    =  1 (on)

 keepsettings =  0 (off)

 readonly     =  0 (off)

 readahead    = 256 (on)

 geometry     = 65535/16/63, sectors = 80293248, start = 0

casteladon root # hdparm /dev/hdb

/dev/hdb:

 multcount    = 16 (on)

 IO_support   =  0 (default 16-bit)

 unmaskirq    =  0 (off)

 using_dma    =  0 (off)

 keepsettings =  0 (off)

 readonly     =  0 (off)

 readahead    = 256 (on)

 geometry     = 16383/255/63, sectors = 160836480, start = 0

casteladon root # hdparm /dev/hdc

/dev/hdc:

 HDIO_GET_MULTCOUNT failed: Invalid argument

 IO_support   =  0 (default 16-bit)

 unmaskirq    =  0 (off)

 using_dma    =  1 (on)

 keepsettings =  0 (off)

 readonly     =  1 (on)

 readahead    = 256 (on)

 HDIO_GETGEO failed: Invalid argument

```

Is there a jumper to set somewhere on the hard-drive before plugging it in the computer ? Is it a HD failure ? Or is it a badly configured kernel ? Or maybe because first HD is UDMA6 (133) but the second one only UDMA5 (100) ?

----------

## Insanity5902

there shouldn't be nothing on the harddrive to set, and the kernel is set up to for the motherboard correctly I guess b/c it is wokring on both your cdrom and hda.  

Um try setting it manualy with hdparm.

```
hdparm -d 1 /dev/hdb
```

see what kind of error that gives you.  and you can use 

```
hdparm -d /dev/hdb
```

 to see just the dma setting.

----------

## romvinot

```

casteladon root # hdparm -d 1 /dev/hdb

/dev/hdb:

 setting using_dma to 1 (on)

 using_dma    =  1 (on)

casteladon root # hdparm -d /dev/hdb

/dev/hdb:

 using_dma    =  1 (on)

```

Then after waiting one or two minutes, I have new messages in /var/log/messages:

```

Mar 13 17:58:36 casteladon hdb: dma_timer_expiry: dma status == 0x61

Mar 13 17:58:47 casteladon hdb: DMA timeout error

Mar 13 17:58:47 casteladon hdb: dma timeout error: status=0x58 { DriveReady SeekComplete DataRequest }

Mar 13 17:58:47 casteladon

Mar 13 17:58:47 casteladon hdb: status timeout: status=0xd0 { Busy }

Mar 13 17:58:47 casteladon

Mar 13 17:58:47 casteladon hdb: drive not ready for command

Mar 13 17:58:47 casteladon ide0: reset: success

```

and then the DMA is disabled again :

```

casteladon root # hdparm -d /dev/hdb

/dev/hdb:

 using_dma    =  0 (off)

```

----------

## Insanity5902

which drives do you have on each ide cable?  And are you sure the master/slave jumpers are set up correctly?

----------

## Robelix

Try to replace the IDE-cable!

Nothing seems to be simpler than a plain cable, but I've already seen a lot of bad ones   :Sad: 

Robelix

----------

## blujay

I have a Compaq Presario 1690 laptop (K6-2/400, 128MB RAM, 6GB Toshiba HDD).  On Windows, all is well.  *sigh*  I've been trying to install Mandrake 10 Community on it (I know it's not Gentoo; I thought I'd get my feet wet in Linux with Mandrake first, plus compiling Gentoo would likely take a very long time on this laptop), and I get these same dma_timer_expiry errors when I boot it up into Mandrake.

So, I don't think it's a hardware problem.  I mean, if it works in Windows...   :Sad: 

----------

## Gentree

I am having the same pb. What kernel do you have?

I have a new seagate 80GB (DMA100) drive on hdc and Fujitsu DMA33 on hda. 

Ther is nothing on hdb and a cdwr on hdd

This worked fine under 2.4.4 (at least I had no errors on boot so I never had reason to look at hdparm)

Under 2.6.4 kernel I get a warning about DMA not being set and hdparm shows DMA is off on both hard drives.

The fujitsu is all alone so this eleminates qu about different dma speeds on same cable.

Ideas?

----------

## romvinot

Maybe we should wait for kernel 2.6.5 as a big change has occured on the DMA API. Who knows, maybe that will do the trick (but I'm not very confident in that...)

I'm currently using 2.6.3-gentoo-r2.

Where is the information about HD DMA shown in Windows XP ? I can't find the info ! If DMA is enabled on Windows, that would mean a Linux configuration error. If it disabld, that would mean a hardware failure.

----------

## Gentree

Hi ,

I did resolve this and it was my fault. I had a kernel option turned off somewhere. Cant remember exactly but I did post so it si findable on a search (try gentree for threads that I have posted) or try VP_IDE , I think that was in there too.

If you want to know about DMA use dmesg just after boot login.

dmesg | grep DMA

XP: pff!

I have DMA on all my disks and CDWR as it should be . No pbs.  :Cool: 

----------

