# dma timeout error with new drive

## thetroyv

im using gentoo kernel 2.6.9 i think... and i got a new hitachi deskstar HDS722512VLAT80...well when i start up my computer one of the first things that happens after i start booting gentoo is a dma timeout error of the main drive:

/dev/ide/host0/bus0/target0/lun0:<4>hda: dma_timer expiry: dma status == 0x61

hda: DMA timeout error

hda:dma timeout error: status = 0x58 { DriveReady SeekComplete DataRequest }

ide: failed opcode was: unknown

p1 p2 p3 p4 <<4> hda: dma_timer_expiry: dma status ==0x61

hda: DMA timout error

hda dma timeout error: status = 0x58 { DriveReady SeekComplete DataRequest }

ide: failed opcode was: unknown

p5<p4> hda: dma_timer_expiry: dma status ==0x61

there are several ponts where it waits some time... but after a while it finishes booting up fine with no other errors.

i also ran th drive fitness test provided by hitachi and it said the drive was ok

any help would be great.

thanks

troy

----------

## bollucks

Get rid of devfs and use a new kernel.

----------

## thetroyv

ive got this same problem (at least it boots VERY SLOWLY) when i boot up to windows so i think its the drive or something that is not operating system specific dont i have the latest kernel?

----------

## drescherjm

Do you have a promise controller?

----------

## thetroyv

windows says i have an intel(r) 82801AA bus master IDE controller

----------

## drescherjm

I asked because I have recently had very similar errors with two promise controllers in a smp server system with linux software raid 5 and the temporary fix was to disable dma and increase the multcount to 16. 

Could you post the output of 

```
hdparm /dev/hda
```

----------

## thetroyv

linux8# hdparm /dev/hda

/dev/hda:

 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 = 123522416640, start = 0

----------

## drescherjm

DMA is not enabled. This looks very much like my problem.

Try 

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

 and see if you get the same errors again. They may not happen instantly (they did not for me). Try to perform operations that stress the file system and make sure they are not with any thing that you can not afford to loose as this may cause a crash. It did not for me but I don't want to be responcible for loosing your important data...

----------

## thetroyv

ok.. same errors.... how do i stress the filesystem?

----------

## drescherjm

 *Quote:*   

> ok.. same errors....

 

Check if dma is disabled again.

```
 hdparm /dev/hda
```

 *Quote:*   

> how do i stress the filesystem?

 

Copy a large file (> 100MB) to the same disk then possibly a different disk

----------

## thetroyv

hmmm dma is off again...

and when i tried to boot up windows 2000 it wouldnt start itd just stay at the loading screen forever

ill put dma back on, then stress the fs, then reboot.

----------

## thetroyv

ok, i turned dma on, started a big copy, then maybe 30sec-1min into the copy it said dma was off! even when not copying, dma turns itself off after a while... is there any way i can make it stay on? or would this not fix the problem?

thanks for helping me so far

----------

## thetroyv

when you had the same problem did your dma turn itself off?

----------

## thetroyv

could this be a drive error? how would i check if it is?

----------

## drescherjm

 *Quote:*   

> when you had the same problem did your dma turn itself off?

 

Yes. dma becomes disabled when there is a problem. 

 *Quote:*   

> could this be a drive error?

 

I doubt that it is a drive problem. I believe this is a kernel bug, but I may be incorrect. There were many discussions of this on google. A couple links are here http://kerneltrap.org/node/3040 and here http://bugzilla.kernel.org/show_bug.cgi?id=2494

I know these are with promise controllers and not intel but your system exhibits the same symptoms...

I solved my problem by getting an 8 port highpoint controller card that replaced my two 4 port promise TX2 100 cards.

Since this was a server in my department I could not let this one go so while the highpoint card was bing shipped I was able to temporary fix the problem with my promise card by disabling dma using the following command:

```
hdparm  -c 1 -m 16 -d 0 -u 0 -k 1  /dev/hda
```

This will keep the settings on a soft reboot but not power off. You may want to put this line in one of your startup scripts possibly near the top of  /etc/init.d/checkfs

----------

## thetroyv

hmm seems i got a problem... followed this guide http://gentoo-wiki.com/HARDWARE_DMA_and_you

to get dma set up... in the kernel configuration i didnt change anything as i thought just recompiling the kernel might help... i followed the guide... exept replacing the 2.6.11 with 2.6.9 (i have an old kernel) now when i rebooted it gets stuck on scanning for ieee1394 or whatever (firewire)... hmm now that you mention it ill try a power off... oh and i even got the livecd booted up, chrooted to my main partition, and did the kernel config (make menuconfig) to disable ieee... hit save config rebooted and same prob... wait do you have to recompile for changes to take effect?

well thanks for taking the time to read this! and thanks for all your help so far.. very grateful!

----------

## drescherjm

 *Quote:*   

> wait do you have to recompile for changes to take effect? 

 

Since the guide you mentioned does not use genkernel I would say the following should work:

```
make && make modules_install
```

 *Quote:*   

> well thanks for taking the time to read this! and thanks for all your help so far.. very grateful!

 

 :Very Happy:  Your welcome. I kinda feel bad that I don't have a full solution at the moment that does not require disabling dma.

----------

## thetroyv

o ok i get it genkernel and make && make modules or whatever do the same thing...

ok i followed the gentoo "upgrading your kernel guide", using the livecd (couldnt boot, stuck at scanning for ieee1394) boots up now, still have the dma problem, but i feel better that my computer boots again   -  love that livecd!  :Very Happy: 

hmm ok i guess i will just disable dma for now... dont know how much longer ill have this comp... but still... its not the linux way to leave a problem unsolved like this!   :Wink: 

well my windows still desnt boot up... ill try disabling dma via menuconfig...

my disk came up with a clean filesystem... if it helps any when starting windows 2000 in safe mode, it does the text "starting windows" thing then freezes, when starting it normally freezes and the graphical starting screen, stays there for a while, then says something about boot device not readable...

hopefully we can tackle this last problem...

thanks

oh putting that command into the checkfs is too late in the boot... its after the 2 minutes of dma timeout stuff... which script should i put it into? or would i need to configure it using menuconfig?

----------

## hesperaux

Yeah man...I just bought four 80gb deskstars for my raid5 array. They are working, but only because I put them onto my mobo. Deskstars are known to be crappy. If you're using the same drives as me, they only have a 2mb cache. However, it is most likely kernel config and/or your motherboard controller, like they've said. Also, make sure you run hdparm on startup. If this has alreayd been said, I apologize. I sort of skimmed the posts.

Dave

----------

## thetroyv

ok.. so basically these hitachis arent very good and so its most likely just the drive with the controller combo? (i got an old optiplex gx110) could it be they are not backward compatable or something? darn itd be nice to have my windows booting again tho...

ok so what script do i put the hdparm in? checkfs is too late.. its like in runlevel 2

oh and theres no module for the intel busmaster 82801AA IDE controller, just intel IDE PIIXs or something...

there is one for basic bus master support i think though..

thanks for the help

troy

----------

## thetroyv

ok the indows error that comes up is INACCESSIBLE_BOOT_DEVICE and then a bunch of info that doesnt help after that.... like check for viruses and run disk check id like to know how since it doesnt boot! ahhh windows... great as always   :Rolling Eyes: 

so any ideas as how to fix this problem? is there a way to disable dma system wide instead of just for linux?

just curious: could this be something physical? such as an old ribbon cable, bad disk?

hmm ill pop in the recovery disk see what happens.

----------

## hesperaux

dude you havea GX110? Oh, those suck man. I use freebsd on that machine.  :Sad:  Yeah, it's probably just your pos hardware. No offense. I am cheap too. xD Some linux guru could probably get it going though. If not, send the drive back and buy a seagate or western digital. (Seagate pwns, and for sata go maxtor)

Dave

----------

## thetroyv

ya its pretty sucky... just a messaround linux box and a half life 1 machine... 

so do you think its worth it to get a better drive? how much faster would it be?

----------

## thetroyv

ok so i repaired windows with the recovery cd, still have all files.... one strange thing...

first of all, before when it was fine, the boot partition was visible... as drive e, but now its drive c, (the main one) and the main drive that WAS c is now d... is there any way to change names or wich ones the main drive? another strange thing: all shortcuts to programs have changed location to D:/pro... instead of C:/pro... i dont think its a big deal but its just weird so if anybody knows how to fix this would appreciate

----------

## drescherjm

What version of windows?

----------

## hesperaux

if it is windows XP, you are able to change drive letters, but you cannot change C:\ to anything else. I'm not totally sure i understand what's going on there...I don't know which boot partition you're referring to. If your old windows boot partition was E:\, that's pretty weird lolz. Windows always makes its boot partition C:\.

hesp

----------

