[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

DMA



Re: 2.4.7 kernel boot hangs with "cramfs: wrong magic"
 
> In one of your earlier messages, you mentioned
turning off DMA. I've
> done some searching with google, looked at
documentation for kernel and
> lilo, and I'm not quite sure how to do that. Would I
need to intall
> hwtools and hdparm and put put add an hdparm line
into
> /etc/init.d/whtools? Or is there a way to do this
passing parameters
> through lilo at boot?
 

I found a very good introduction to DMA (and how to
turn it off) on a
web site called exocore.com in India. Although the
discussion is about
DMA on a RedHat system, most everything probably
applies to Debian as
well (if anyone on the list thinks otherwise, please
let us know in
what ways Debian differs). Without further ado:


The DMA Issue in RedHat Linux 7.1

by Shanker Balan and Atul Chitnis 

RedHat ships a highly tuned version of the Linux
kernel which enables
DMA (Direct Memory Access) or even Ultra DMA on
selected IDE
controller chipsets.

DMA based transfers greatly reduce install time by
providing faster
file transfer speeds.  DMA also reduces CPU usage to a
large extent
for disk activity.

Because of the above mentioned benefits, DMA is a
highly desirable
feature and in most cases, the DMA enabled kernel
works like a charm.

(For more on the benefits of using DMA transfers see
http://www.linuxdoc.org/HOWTO/mini/Ultra-DMA.html) 

However, enabling DMA has its downside. It requires
that all the
components of your system are "healthy". If there is a
hardware
related problem in any one of the related system
components, DMA will
fail to function properly.

Slow and unreliable installs, CRC errors, file
corruptions and even
random system lockups are all symptoms of DMA related
problems.

The most common issues seen are 

the installer dies when booting, after issuing the
message "running:
/sbin/loader"

installation is extremely slow and often dies at a
particular point,
but never the same for different users/machines

installation suddenly stops complaining about a
missing/bad file

the CDROM is not accessible after installation

Q. Ok, so how can I fix the installation problem?

A. To fix the problem, boot off the CD, then, at the
boot prompt type 

linux ide=nodma 

This disables DMA access while installing. 

Q. Whew, I disabled DMA with "ide=nodma" and the
install
completed! But now I seem to be having problems while
running normally? Is this also DMA related?

A. Most probably yes as the "ide=nodma" option does
not disable DMA
permanently - it only disables DMA for the current
session.

Q. So how do I disable DMA permanently?

A. Depending on how the CDROM drive has been
physically connected to
your system, add one of these lines to
/etc/rc.d/rc.sysinit:

/sbin/hdparm -d0 /dev/hdb   # Add this if your CDROM
is on primary slave
/sbin/hdparm -d0 /dev/hdc   # Add this is your CDROM
is on secondary master
/sbin/hdparm -d0 /dev/hdd   # Add this if your CDROM
is on secondary slave

If you are unsure about the CDROM device id, the
"dmesg" output will
have it:

~# dmesg|grep CD
hdc: ATAPI 48X CDROM, ATAPI CD/DVD-ROM drive
hdc: ATAPI 48X CD-ROM drive, 128kB Cache, 
UDMA(33) Uniform CD-ROM driver Revision: 3.12

In this case, CDROM drive is /dev/hdc. 

Q.I disabled DMA for the CDROM drive. I still have
problems
while accessing files. Everything is too slow and the
hardisk
light remains on for a looong time

A. Looks like your harddisk also cannot handle DMA. 

To disable DMA for a hard drive, add this line to
/etc/rc.d/rc.sysinit. 

/sbin/hdparm -d0 /dev/hda 

This should cure most DMA related problems. 

Q. How can I fix DMA related problems so that I can
take
advantage of its benefits?

A. Some of the more common reasons for DMA problems
are: 

Bad or loose IDE connectors. Replacing or securing
them usually solves
the problem.

Broken BIOS. Check with your motherboard/PC
manufacturer for DMA
related problems with the BIOS. The early Asus P5A
motherboards for
example had problems in Linux if DMA was enabled.
Upgrading the BIOS
usually fixes the problem.

Broken IDE chipset. This is something which cannot be
cured without a
hardware change. There are many motherboards shipped
with broken
controllers which cause data corruption if DMA is
enabled. We have one
such board in our office. :(

See "Are those rumors about buggy interfaces true?" at
http://thef-nym.sci.kun.nl/cgi-pieterh/atazip/atafq-3.html#ss3.3

Old IDE devices (hard disks, CDROM drives) don't
respond well to DMA.

Some drive/controller combinations will work with DMA
but not
UDMA. You can test this out by playing around with
"hdparm" settings.

Q. Where can I find out more about Linux and (U)DMA?

A. See the The Linux Ultra-DMA Mini-Howto at
http://www.linuxdoc.org/HOWTO/mini/Ultra-DMA.html 




__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/



Reply to: