LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 06-20-2009, 11:13 PM   #1
paulcsf
LQ Newbie
 
Registered: Jan 2009
Distribution: Ubuntu / LFS/BLFS/CLFS
Posts: 20

Rep: Reputation: 1
Compact flash DMA doesn't work, and I can't disable it.


First, I know this question has been asked before, but I haven't found an answer that works or makes sense for me, so I hope you all will pardon me for asking similar questions.

Now, the hardware:
AMD Geode SBC
5GB IDE harddrive - works
Compact flash cards:
1GB Toshiba "THNCF1G02QG 3.00" - works
1GB Kingston Tech "9930622-001.A00LF" - doesn't work
1GB Myflash A Data "20060703" - doesn't work
2GB Kingston Tech "CF CARD 2GB Ver2.19k" - doesn't work
The operating system:
It's a custom built system mostly following the LinuxFromScratch / CrossLinuxFromScratch instructions. I have used kernel 2.6.27.10 and 2.6.30. The system boots through grub, kernel, initramfs, and finally "joins" the initramfs with the disk file system to boot to X.

Here is the part I don't understand... I believe it's still in the kernel, before the initramfs and init script, when the kernel looks at the drives and throws the dma errors.

I get errors like this during the kernel boot:
Code:
[    2.559157] ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
[    2.566230] ide_generic: please use "probe_mask=0x3f" module parameter for probing all legacy ISA IDE ports
[    2.570273] ide-gd driver 1.18
[    2.574273] hda: max request size: 128KiB
[    2.645082] hda: 12685680 sectors (6495 MB) w/420KiB Cache, CHS=13424/15/63
[    2.649082] hda: cache flushes not supported
[    2.655160]  hda: hda1 hda2
[    2.702361] hdb: max request size: 128KiB
[    2.704632] hdb: 3940272 sectors (2017 MB) w/1KiB Cache, CHS=3909/16/63
[    2.715836]  hdb:<4>hdb: ide_dma_sff_timer_expiry: DMA status (0x61)
[   32.721891] hdb: DMA timeout error
[   32.721891] hdb: dma timeout error: status=0x58 { DriveReady SeekComplete DataRequest }
[   32.721891] hdb: possibly failed opcode: 0xc8
[   32.721891] hda: DMA disabled
[   32.721891] hdb: DMA disabled
[   32.769894] ide0: reset: success
[   32.788789]  hdb1
[   32.795829] Error: Driver 'pata_platform' is already registered, aborting...
Then after the kernel has transferred execution to INIT, I get these errors:
Code:
[   33.888690] Freeing unused kernel memory: 388k freed
I believe this is where it transfers from kernel to INIT, then to udev.
[   34.077949] usb 1-1: configuration #1 chosen from 1 choice
[   34.277961] usb 1-2: new low speed USB device using ohci_hcd and address 3
[   34.505975] usb 1-2: configuration #1 chosen from 1 choice
[   34.541977] input: Semtek  Semtek USB MSR as /devices/pci0000:00/0000:00:0f.4/usb1/1-2/1-2:1.0/input/input0
[   34.557977] generic-usb 0003:0C9D:0170.0001: input,hidraw0: USB HID v1.00 Keyboard [Semtek  Semtek USB MSR] on usb-0000:00:0f.4-2/input0
[   42.265342] udev: starting version 130
[   65.112259] hdb: ide_dma_sff_timer_expiry: DMA status (0x41)
[   75.112352] hdb: DMA timeout error
[   75.112352] hdb: dma timeout error: status=0x58 { DriveReady SeekComplete DataRequest }
[   75.112352] hdb: possibly failed opcode: 0xc8
[   75.112352] hdb: DMA disabled
[   75.160345] ide0: reset: success
[   75.776327] ieee80211: 802.11 data/management/control stack, git-1.1.13
[   75.781344] ieee80211: Copyright (C) 2004-2005 Intel Corporation <jketreno@linux.intel.com>
[   95.801529] hdb: ide_dma_sff_timer_expiry: DMA status (0x41)
[  105.802131] hdb: DMA timeout error
[  105.802131] hdb: dma timeout error: status=0x58 { DriveReady SeekComplete DataRequest }
[  105.802131] hdb: possibly failed opcode: 0xc8
[  105.802131] hdb: DMA disabled
[  105.850134] ide0: reset: success
[  126.368939] hdb: ide_dma_sff_timer_expiry: DMA status (0x41)
[  136.368404] hdb: DMA timeout error
[  136.368404] hdb: dma timeout error: status=0x58 { DriveReady SeekComplete DataRequest }
[  136.368404] hdb: possibly failed opcode: 0xc8
[  136.368404] hdb: DMA disabled
[  136.416398] ide0: reset: success
These errors came while running from hda which is the IDE harddrive, with the compact flash card as hdb, just preset. The errors are nominally the same when I boot from the compact flash, which is the intended behavior.

I have added the patch from LinuxFromScratch to the initramfs init script, which should allow ide=nodma as a boot option, but it doesn't change anything.

I see various kernel options in the .config file, but I can't find them in the configuration. I have tried manually editing them out, but the kernel scripts overwrite the changes.
CONFIG_GENERIC_ISA_DMA
CONFIG_ISA_DMA_API
CONFIG_BLK_DEV_IDEDMA_SFF
CONFIG_BLK_DEV_IDEDMA_PCI
CONFIG_BLK_DEV_IDEDMA
I tried changing them in the arch/x86/configs/i386_defconfig, but this also is overwritten somewhere along the way.

At this point, I would even turn off DMA for the entire system (I found mention of that once but can't find it...), though I would rather turn DMA off just for the compact flash.

Anybody have thoughts? Or even better a solution?

Thanks, Paulcsf.

Last edited by paulcsf; 06-21-2009 at 09:40 PM. Reason: formatting
 
Old 06-21-2009, 12:21 AM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Not sure if this will work whereas that is a CF type disk on USB subsystem, but since it identifies as hda, one never knows.. Have you tried the hdparm utility? `hdparm -d` allows you to get/set the 'using DMA or not' characteristic of a HDD.
(for your case, it would be `hdparm -d 0 /dev/hdb`)

There's a SCSI alternative, called sdparm, as well as a more complex but full-featured package called 'sg3-utils' also for SCSI-generic options.

The kernel config option you seek are (at least from what I can see here in my 2.6.30 kernel) enabled by default, and the options are hidden unless you click the OPTIONS tab atop Xconfig and select VIEW ALL OPTIONS which still does not let you adjust them, but atleast you can see where they are located.

I can't remember right off, but there *is* a way to manually change config options directly in the .config file, but in order for the changes to not be overwritten automatically, there needs to be some other option changed somewhere; but it has been a long time since I had to do this, and I cannot remember how it was done. Maybe Google can help?

Anyhow, if you have any success with hdparm or sdparm, you can set up some early-during-boot or early-during-init script entries to run the hdparm/sdparm commands you want.

Hope this at least gave you some ideas..... Though the utilities I mentioned, I'm not sure if you could execute them *early enough* to avoid/avert the error messages.

Sasha

Last edited by GrapefruiTgirl; 06-21-2009 at 12:28 AM. Reason: clarity.
 
Old 06-21-2009, 12:34 AM   #3
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
http://linux.derkeiler.com/Mailing-L.../msg03261.html

On further examination, and reading the links and messages at the link above, it seems some/many CF readers and CF adapters do not support DMA.

One option mentioned was to turn off DMA in the BIOS, but as mentioned also, it slows down disk access for the machine in general, unless the BIOS has DMA on/off options individually for each hardware system (PCI, IDE, etc..).

Good luck!

Sasha
 
Old 06-21-2009, 01:12 PM   #4
paulcsf
LQ Newbie
 
Registered: Jan 2009
Distribution: Ubuntu / LFS/BLFS/CLFS
Posts: 20

Original Poster
Rep: Reputation: 1
Thank you for the input.

I went back this morning to verify the bios settings which don't seem to have any affect.

I have these options:
IDE Primary Master UDMA
IDE Primary Slave UDMA
HDD S.M.A.R.T. Capability
I have disabled all three, and bios still shows
Pri Master Disk: LBA, DMA 2, 6495MB
Pri Slave Disk: LBA, DMA 2, 2017MB
The messages that I believe are the kernel now show:
Code:
[    1.895437] Uniform Multi-Platform E-IDE driver
[    1.902950] cs5535 0000:00:0f.2: IDE controller (0x100b:0x002d rev 0x00)
[    1.909877] cs5535 0000:00:0f.2: not 100% native mode: will probe irqs later
[    1.916914]     ide0: BM-DMA at 0xff00-0xff07
[    1.923776] Probing IDE interface ide0...
[    2.212429] hda: IBM-DBCA-206480, ATA DISK drive
[    2.552096] hdb: CF CARD 2GB, ATA DISK drive
[    2.559359] hda: host max PIO4 wanted PIO255(auto-tune) selected PIO4
[    2.559719] hda: UDMA/33 mode selected
[    2.566671] hdb: host max PIO4 wanted PIO255(auto-tune) selected PIO2
[    2.566744] hdb: host side 80-wire cable detection failed, limiting max speed to UDMA33
[    2.580462] hdb: UDMA/33 mode selected
[    2.587566] ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
[    2.596791] ide_generic: please use "probe_mask=0x3f" module parameter for probing all legacy ISA IDE ports
[    2.610671] ide-gd driver 1.18
[    2.617525] hda: max request size: 128KiB
[    2.681804] hda: 12685680 sectors (6495 MB) w/420KiB Cache, CHS=13424/15/63
[    2.688984] hda: cache flushes not supported
[    2.696287]  hda: hda1 hda2
[    2.731836] hdb: max request size: 128KiB
[    2.738827] hdb: 3940272 sectors (2017 MB) w/1KiB Cache, CHS=3909/16/63
[    2.746364]  hdb:<4>hdb: ide_dma_sff_timer_expiry: DMA status (0x61)
[   32.752062] hdb: DMA timeout error
[   32.756024] hdb: dma timeout error: status=0x58 { DriveReady SeekComplete DataRequest }
[   32.756024] hdb: possibly failed opcode: 0xc8
[   32.756024] hda: DMA disabled
[   32.756024] hdb: DMA disabled
[   32.848060] ide0: reset: success
[   32.867201]  hdb1
[   32.879252] Error: Driver 'pata_platform' is already registered, aborting...
These new messages are somewhat disappointing because now it's detecting the drives as UDMA/33, which I would think it shouldn't be given that I disabled UDMA in BIOS.

I don't see any other options related to DMA, and looked up S.M.A.R.T. as I was writing this and found out it should have nothing to do with DMA.

I will see if I can figure out how to change the kernel options manually, as those options sure look tempting.

Thanks, Paulcsf
 
Old 06-21-2009, 09:38 PM   #5
paulcsf
LQ Newbie
 
Registered: Jan 2009
Distribution: Ubuntu / LFS/BLFS/CLFS
Posts: 20

Original Poster
Rep: Reputation: 1
Just for completeness sake, I re-enabled the BIOS options:
IDE Primary Master UDMA = AUTO
IDE Primary Slave UDMA = AUTO
HDD S.M.A.R.T. Capability = Enabled
And BIOS shows:
Pri Master Disk: LBA, ATA 33, 6495MB
Pri Slave Disk: LBA, ATA 33, 2017MB
The BIOS settings do change some of the details of the messages, but don't change the behavior of the system.

Now, back to the task at hand. I setup the initramfs init script to "install" busybox's hdparm, and added hdparm -d0 /dev/hda and hdparm -d0 /dev/hdb. This removes the DMA errors above at 65 and 95 seconds. However, the DMA errors at 2-3 and ~30 seconds persist, further confirming to me that these are in the kernel before init scripts.

Just FYI: bintools hdparm will accept hdparm -d 0 /dev/hda. Busybox requires the -d and 0 to be concatenated.

So, any ideas on getting DMA turned off for the kernel?

Thanks, Paulcsf.

Last edited by paulcsf; 06-21-2009 at 09:39 PM. Reason: add detail of bios settings affects
 
Old 06-21-2009, 10:49 PM   #6
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Code:
	ide-core.nodma=	[HW] (E)IDE subsystem
			Format: =0.0 to prevent dma on hda, =0.1 hdb =1.0 hdc
			.vlb_clock .pci_clock .noflush .noprobe .nowerr .cdrom
			.chs .ignore_cable are additional options
			See Documentation/ide/ide.txt.


	libata.dma=	[LIBATA] DMA control
			libata.dma=0	  Disable all PATA and SATA DMA
			libata.dma=1	  PATA and SATA Disk DMA only
			libata.dma=2	  ATAPI (CDROM) DMA only
			libata.dma=4	  Compact Flash DMA only
			Combinations also work, so libata.dma=3 enables DMA
			for disks and CDROMs, but not CFs.


I find the above documentation very interesting, both because it looks like it could help YOU, AND because there are SO MANY neat options in this file that I did not know about.

The above are just two examples/sections of the file '/Documentation/kernel-parameters.txt' which you find in the kernel source (for me it's 2.6.30) and the second one looks like what you want. The options are for use in your lilo.conf or grub.menu or wherever it is you set your boot parameters (maybe in your initrd?)

I gave up trying to remember how to get manual .config configuration options to stick.

This file shows how to implement options both for pluggable kernel modules, and also for in-kernel modules and subsystems, such as the DMA functionality for during early boot, which I think is what you want.

Cheers,
Sasha

PS - Open the file and do a search for 'DMA' to see all occurrences.

Last edited by GrapefruiTgirl; 06-21-2009 at 10:52 PM. Reason: PS - ...
 
1 members found this post helpful.
Old 06-22-2009, 12:21 AM   #7
paulcsf
LQ Newbie
 
Registered: Jan 2009
Distribution: Ubuntu / LFS/BLFS/CLFS
Posts: 20

Original Poster
Rep: Reputation: 1
Thank you very much... That got it handled, no kernel time DMA errors.

ide-core.nodma=0.1 - worked, turned off kernel dma at boot for hdb.
libata.dma=0 - didn't work, I didn't detect any change in behavior.

So, let me recap for future reference.

In the kernel options (for me grub's menu.lst) I added ide-core.nodma=0.1. In init in my initramfs I added hdparm -d0 /dev/hdb.

With those changes the system boots without dma errors from the compact flash disk which previously gave dma errors and timeouts.

Thanks again, Paulcsf.
 
Old 02-01-2010, 11:13 AM   #8
csukid86
LQ Newbie
 
Registered: Feb 2010
Posts: 5

Rep: Reputation: 0
Im having trouble with this too

hey can someone help me...

im having the same issue :/
 
Old 02-01-2010, 12:09 PM   #9
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Quote:
Originally Posted by csukid86 View Post
hey can someone help me...

im having the same issue :/
Hi, Welcome to LQ!

You're better off starting a fresh thread for your topic, since this one has been inactive for some time.

Start a new thread, provide a link to reference THIS thread if you feel it will help, and describe your hardware involved, what exactly the problem is, and what you have done so far to try to fix it. Then we can try to help you figure it out

Sasha
 
Old 02-02-2010, 12:10 AM   #10
csukid86
LQ Newbie
 
Registered: Feb 2010
Posts: 5

Rep: Reputation: 0
still confused

thanks sasha,

how do i reference this post?

i have started a new thread topic HERE:

http://www.linuxquestions.org/questi...inkpad-786234/

this shows your how confused i am

thanks again

i really want this to work

thanks

michael
 
Old 09-08-2010, 01:15 AM   #11
souren.sinha
LQ Newbie
 
Registered: Sep 2010
Posts: 3

Rep: Reputation: 0
Same issue with DMA on a CF card

Hi,

I am having the same issue I believe...running tiny core from a 128MB CF card, for a box with Pentium 100, and 64 MB of RAM.

I have tried modifying the menu.lst as recommended by Sasha, but I am not sure how to change the initramfs bit...stumped!

Please help.

Regards,
Souren
 
Old 01-23-2011, 03:08 PM   #12
floppy_stuttgart
Senior Member
 
Registered: Nov 2010
Location: EU mainland
Distribution: Debian like
Posts: 1,153
Blog Entries: 5

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by paulcsf View Post
Thank you very much... That got it handled, no kernel time DMA errors.

ide-core.nodma=0.1 - worked, turned off kernel dma at boot for hdb.
libata.dma=0 - didn't work, I didn't detect any change in behavior.

So, let me recap for future reference.

In the kernel options (for me grub's menu.lst) I added ide-core.nodma=0.1. In init in my initramfs I added hdparm -d0 /dev/hdb.

With those changes the system boots without dma errors from the compact flash disk which previously gave dma errors and timeouts.

Thanks again, Paulcsf.
A question in regard to "Init" in the "Initramfs".
Where is the init file? (in order to include hdparm -d0 /dev/hdx in it). I have a similar issue with knoppix on 8GB SanDisk CF.
 
  


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
Can not get PATA to work for Compact Flash with 2.6.28 kernel lyao01 Linux - Kernel 4 07-19-2009 10:31 PM
How do you duplicate a 512 Meg Compact flash to a 1 GB compact flash using dd??? allen00860 Linux - Newbie 5 05-23-2009 08:48 PM
IBM Thinkpad x22 FC5 want builtin compact flash to work dehavik Linux - Laptop and Netbook 10 05-06-2006 07:17 PM
xilinx system ace driver for compact flash on a fpga based pci card doesnt work urwithsudheer Programming 0 03-22-2006 02:28 AM
Compact flash mngmd Linux - Hardware 2 11-18-2005 09:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 06:40 PM.

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