LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
LinkBack Search this Thread
Old 04-20-2007, 11:53 PM   #1
JoeyAdams
Member
 
Registered: Jun 2006
Distribution: Kubuntu Hardy
Posts: 94

Rep: Reputation: 15
How do I enable DMA at boot time?


On my HP Pavilion 503n, I recently discovered how profound of a positive impact DMA had on my hard drive and CD/DVD drive performance. I can now burn DVDs at the advertised speed, and it works beautifully. However, the only way I know how to turn it on is by issuing the following root commands once my system has started up (the stuff after the #s is not what I put):

hdparm -d1 /dev/hda #20GB hard drive
hdparm -d1 /dev/hdb #40GB hard drive
hdparm -d1 /dev/hdc #CD reader/writer I never use
hdparm -d1 /dev/hdd #CD/DVD reader/writer

In Fedora, is there a kernel option or something that lets me enable DMA by default (preferably before the majority of the boot process, since it currently takes four minutes)?
 
Old 04-21-2007, 12:15 AM   #2
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 3,513

Rep: Reputation: 62
Quote:
Originally Posted by JoeyAdams
On my HP Pavilion 503n, I recently discovered how profound of a positive impact DMA had on my hard drive and CD/DVD drive performance. I can now burn DVDs at the advertised speed, and it works beautifully. However, the only way I know how to turn it on is by issuing the following root commands once my system has started up (the stuff after the #s is not what I put):

hdparm -d1 /dev/hda #20GB hard drive
hdparm -d1 /dev/hdb #40GB hard drive
hdparm -d1 /dev/hdc #CD reader/writer I never use
hdparm -d1 /dev/hdd #CD/DVD reader/writer

In Fedora, is there a kernel option or something that lets me enable DMA by default (preferably before the majority of the boot process, since it currently takes four minutes)?
Check to see if the options below are set in your kernel if not you need a kernel with them enabled.

Code:
grep -i dma /boot/config-2.6.20-ck1-core2duo
CONFIG_ZONE_DMA32=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_ISA_DMA_API=y
CONFIG_BLK_DEV_IDEDMA_PCI=y     <---------------
# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
CONFIG_IDEDMA_PCI_AUTO=y         <----------------
# CONFIG_IDEDMA_ONLYDISK is not set
CONFIG_BLK_DEV_IDEDMA=y          <------------
# CONFIG_IDEDMA_IVB is not set
CONFIG_IDEDMA_AUTO=y                   <---------
# CONFIG_PDC_ADMA is not set
# CONFIG_PATA_OPTIDMA is not set
# CONFIG_SOUND_DMAP is not set
# DMA Engine support
# CONFIG_DMA_ENGINE is not set
# DMA Clients
# DMA Devices
 
Old 04-21-2007, 08:50 AM   #3
JoeyAdams
Member
 
Registered: Jun 2006
Distribution: Kubuntu Hardy
Posts: 94

Original Poster
Rep: Reputation: 15
Thanks for the quick and thorough response!

Yes, all of those items are enabled in my /boot/config-2.6.20-1.2933.fc6 file. I'm wondering if I need a kernel option or something to keep it in control. I'm guessing the system could be starting with DMA enabled, but it gets turned off sometime during the boot process. I noticed that DMA gets turned off when I do things like fdisk /dev/hda (without even writing to it). I wonder if DMA is getting turned off by udev or by the remount to read/write process.

Whatever the case, my GRUB kernel boot commands are:

root (hd0,0)
kernel /vmlinuz-2.6.20-1.2933.fc6 ro root=/dev/VolGroup00/LogVol00 quiet apm=off acpi=on ide0=dma
initrd /initrd-2.6.20-1.2933.fc6.img

(The ide0=dma was something I tried to enable DMA, but it seemed to have no effect.)
 
Old 04-21-2007, 10:21 AM   #4
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 3,513

Rep: Reputation: 62
Quote:
Originally Posted by JoeyAdams
Thanks for the quick and thorough response!

Yes, all of those items are enabled in my /boot/config-2.6.20-1.2933.fc6 file. I'm wondering if I need a kernel option or something to keep it in control. I'm guessing the system could be starting with DMA enabled, but it gets turned off sometime during the boot process. I noticed that DMA gets turned off when I do things like fdisk /dev/hda (without even writing to it). I wonder if DMA is getting turned off by udev or by the remount to read/write process.

Whatever the case, my GRUB kernel boot commands are:

root (hd0,0)
kernel /vmlinuz-2.6.20-1.2933.fc6 ro root=/dev/VolGroup00/LogVol00 quiet apm=off acpi=on ide0=dma
initrd /initrd-2.6.20-1.2933.fc6.img

(The ide0=dma was something I tried to enable DMA, but it seemed to have no effect.)
There in the kernel as a =y not =m so that they are built into the kernel and have no choice but to be available? If so one thing to try would be to make CONFIG_BLK_DEV_IDEDMA_FORCED=y to force the use of DMA and to make sure that the chipset for your motherboard is set to =y.
 
Old 04-21-2007, 01:47 PM   #5
JoeyAdams
Member
 
Registered: Jun 2006
Distribution: Kubuntu Hardy
Posts: 94

Original Poster
Rep: Reputation: 15
I managed to work around it by sticking the DMA-enabling commands in my /etc/rc.sysinit after all the file systems had been mounted (putting it at the beginning allowed udev or something to reverse it). I timed my system's total boot time from computer startup to KDE loading with and without DMA. I got 5 minutes without DMA, 3 minutes with DMA.

I did notice that my CD and DVD drives (/dev/hdc and /dev/hdd) had DMA enabled by default in both cases.

For you Googlers out there, I'll post what I did here:

(This is a segment of /etc/rc.sysinit)

Original:

Code:
...
# Check to see if a full relabel is needed
if [ -n "$SELINUX_STATE" -a "$READONLY" != "yes" ]; then 
    if [ -f /.autorelabel ] || strstr "$cmdline" autorelabel ; then
	relabel_selinux
    fi
else
    if [ -d /etc/selinux -a "$READONLY" != "yes" ]; then
        [ -f /.autorelabel ] || touch /.autorelabel
    fi
fi

# Start the graphical boot, if necessary and not done yet.
if strstr "$cmdline" rhgb && ! strstr "$cmdline" early-login && [ "$RHGB_STARTED" -eq 0 -a "$BOOTUP" = "color" -a "$GRAPHICAL" = "yes" -a -x /usr/bin/rhgb ]; then
   ( . /etc/sysconfig/i18n 2>/dev/null ; /usr/bin/rhgb )
   RHGB_STARTED=1
fi
...
Modified:

Code:
...
# Check to see if a full relabel is needed
if [ -n "$SELINUX_STATE" -a "$READONLY" != "yes" ]; then 
    if [ -f /.autorelabel ] || strstr "$cmdline" autorelabel ; then
	relabel_selinux
    fi
else
    if [ -d /etc/selinux -a "$READONLY" != "yes" ]; then
        [ -f /.autorelabel ] || touch /.autorelabel
    fi
fi

#Enable DMA
echo "Enabling DMA..."
/sbin/hdparm -d1 /dev/hda
/sbin/hdparm -d1 /dev/hdb
/sbin/hdparm -d1 /dev/hdc
/sbin/hdparm -d1 /dev/hdd


# Start the graphical boot, if necessary and not done yet.
if strstr "$cmdline" rhgb && ! strstr "$cmdline" early-login && [ "$RHGB_STARTED" -eq 0 -a "$BOOTUP" = "color" -a "$GRAPHICAL" = "yes" -a -x /usr/bin/rhgb ]; then
   ( . /etc/sysconfig/i18n 2>/dev/null ; /usr/bin/rhgb )
   RHGB_STARTED=1
fi
...
I just added /sbin/hdparm commands, which enable DMA on the drives above. This may be slightly different for different people, depending on their configuration. If this does not work for other people, then read the second post in this thread
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I enable DMA? ouellettesr Slackware 5 03-01-2007 10:36 AM
Can`t enable DMA Sushy Slackware 14 07-09-2006 07:55 PM
activate DMA for disks at boot time mrosati Linux - Software 1 09-15-2005 07:04 AM
dma problems with the 2.6.6 at boot time rabbit171 Linux - Newbie 1 07-30-2004 10:40 AM
How to enable DMA at boot-up time reyemarr Debian 11 11-21-2003 12:38 PM


All times are GMT -5. The time now is 07:41 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration