LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 10-17-2007, 08:21 PM   #1
BB_DaKraxor
LQ Newbie
 
Registered: Oct 2007
Location: Hungary, Budapest
Distribution: Gentoo
Posts: 17

Rep: Reputation: 0
Unhappy DMA problem with IDE hard disk


Hi,

I have Gentoo linux running fine. I used to use a SATA drive only but I had to attach an IDE one (80 GB Maxtor) recently and realized that it's very slow. I googled a lot and found out that I should have DMA enabled but I don't, so I tried to fix it, read dozens of posts with no luck yet.

Some additional info:

Code:
$ lspci | grep IDE
00:0f.0 IDE interface: VIA Technologies, Inc. VT8237A SATA 2-Port Controller (rev 80)
00:0f.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 07)
Code:
$ grep "_VIA" /usr/src/linux/.config
# CONFIG_VIA_FIR is not set
CONFIG_BLK_DEV_VIA82CXXX=y
CONFIG_SATA_VIA=y
# CONFIG_PATA_VIA is not set
CONFIG_HW_RANDOM_VIA=y
# CONFIG_AGP_VIA is not set
# CONFIG_I2C_VIA is not set
# CONFIG_I2C_VIAPRO is not set
# CONFIG_SENSORS_VIA686A is not set
CONFIG_SND_VIA82XX=m
CONFIG_SND_VIA82XX_MODEM=m
CONFIG_SOUND_VIA82CXXX=m
# CONFIG_MIDI_VIA82CXXX is not set
Code:
a$ grep "_IDE" /usr/src/linux/.config
CONFIG_IDE=y
CONFIG_BLK_DEV_IDE=y
# CONFIG_BLK_DEV_IDE_SATA is not set
# CONFIG_BLK_DEV_HD_IDE is not set
CONFIG_BLK_DEV_IDEDISK=y
CONFIG_IDEDISK_MULTI_MODE=y
CONFIG_BLK_DEV_IDECD=y
# CONFIG_BLK_DEV_IDETAPE is not set
# CONFIG_BLK_DEV_IDEFLOPPY is not set
# CONFIG_BLK_DEV_IDESCSI is not set
# CONFIG_BLK_DEV_IDEACPI is not set
# CONFIG_IDE_TASK_IOCTL is not set
CONFIG_IDE_GENERIC=y
# CONFIG_BLK_DEV_IDEPNP is not set
CONFIG_BLK_DEV_IDEPCI=y
CONFIG_IDEPCI_SHARE_IRQ=y
CONFIG_BLK_DEV_IDEDMA_PCI=y
# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
# CONFIG_IDEDMA_ONLYDISK is not set
# CONFIG_IDE_ARM is not set
CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_IDEDMA_IVB is not set
When I try to enable DMA using hdparm, i get the following error:

Code:
a$ hdparm -d1 /dev/hdb

/dev/hdb:
 setting using_dma to 1 (on)
 HDIO_SET_DMA failed: Operation not permitted
 using_dma     =  0 (off)
DMA and some other (possibly related) things are recognized and enabled in my BIOS, I've checked that. I must be missing something. Does anyone know what the problem might be?

Thanks in advance.
 
Old 10-18-2007, 06:23 AM   #2
BB_DaKraxor
LQ Newbie
 
Registered: Oct 2007
Location: Hungary, Budapest
Distribution: Gentoo
Posts: 17

Original Poster
Rep: Reputation: 0
... and nobody seems to have any idea.
 
Old 10-18-2007, 06:38 AM   #3
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
I have never had a need to alter a Pata disk's DMA from 1Gb to 500Gb hard disks.

80Gb Pata should be have either ATA100 Mode 5 or 133ATA speed and in Mode 6. This information should appear in the Bios screen at boot time. There may be setting that you can override the Bios and using a 80-wire instead of a 40-wire IDE cable helps too, especially for the higher speed.

For a series of UDMA modes see this thread.

If you get a buffer read speed around 50Mb/s I would say it is normal, by root console command
Code:
hdparm -tT /dev/hda
assuming you are testing disk hda.
 
Old 10-18-2007, 12:13 PM   #4
BB_DaKraxor
LQ Newbie
 
Registered: Oct 2007
Location: Hungary, Budapest
Distribution: Gentoo
Posts: 17

Original Poster
Rep: Reputation: 0
Question

Thank you for your reply. I ran the test, the results are not satisfying:

Code:
$ sudo hdparm -tT /dev/hdb

/dev/hdb:
 Timing cached reads:   900 MB in  2.00 seconds = 449.78 MB/sec
 Timing buffered disk reads:   10 MB in  3.06 seconds =   3.26 MB/sec
There has to be a way to improve this speed.
I also get a 100% CPU usage whenever I access my IDE disk /dev/hdb and my system gets really slow.
It's quite annoying.

In the BIOS setup I found something like "UDMA mode 6" on the hard disk info screen, I think that means it's supported, I just need to enable it in my OS.

Am I right? Any ideas how to do that?
 
Old 10-18-2007, 12:33 PM   #5
ghostdancer
Member
 
Registered: Apr 2002
Distribution: Slackware
Posts: 266

Rep: Reputation: 30
Are you sure you are using the PATA module? Please check your SATA configuration in the kernel, there should be an option for VIA PATA support in there, remember to enable it.
 
Old 10-18-2007, 12:44 PM   #6
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
You may need a hardware converter:

http://cooldrives.stores.yahoo.net/s...e-adapter.html

--------------------
Steve Stites
 
Old 10-18-2007, 12:58 PM   #7
BB_DaKraxor
LQ Newbie
 
Registered: Oct 2007
Location: Hungary, Budapest
Distribution: Gentoo
Posts: 17

Original Poster
Rep: Reputation: 0
Lightbulb Solved!

Thanks for your help, the problem was that I didn't know I should have used the PATA module, I thought the IDE chipset driver is enough. After recompiling my kernel with CONFIG_PATA_VIA=y I get amazing test results:

Code:
$ sudo hdparm -tT /dev/hdb

/dev/hdb:
 Timing cached reads:   1612 MB in  2.00 seconds = 805.94 MB/sec
 Timing buffered disk reads:  130 MB in  3.02 seconds =  43.05 MB/sec
Thank you again!
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
SATA Hard disk(Windows) MBR corrupted by IDE hard disk(Linux) Peter_APIIT Fedora 6 07-07-2007 12:20 AM
dma issue with hard disk gethemant Fedora 1 03-26-2006 10:58 AM
DMA in Hard Disk Gonto SUSE / openSUSE 1 05-26-2005 09:55 PM
Enabling DMA on an IDE Hard Disk paulo2k Slackware 7 09-09-2003 01:58 PM
Hard disk DMA varunk Linux - Hardware 7 06-07-2002 07:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 07:58 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration