WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Single DMA error after hotplugging a IDE (compact flash) drive  (Read 5617 times)

Offline ost

  • Newbie
  • *
  • Posts: 41
Single DMA error after hotplugging a IDE (compact flash) drive
« on: September 27, 2011, 03:42:10 AM »
When I unplug and replug my CF drive (/dev/sda) and try to access it with "fdisk /dev/sda" (boot drive is sdb),  I get an error first time only. Since I cant get stderr to redirect to a file, here is a typed copy of the msg:

ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
ata2.00: failed command: READ DMA
ata2.00: cmd c8/00:20:00:00:00/00:00:00:00:00/e0 tag 0 dma 16384 in
         res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
ata2.00 status : {DRDY}

It causes some timeout delay for me.
Not sure this is a bug, but maybe it can be prevented by reading some status before trying to bang the dma?

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Single DMA error after hotplugging a IDE (compact flash) drive
« Reply #1 on: September 27, 2011, 08:47:19 AM »
IDE drives are not hot pluggable.

Offline ost

  • Newbie
  • *
  • Posts: 41
Re: Single DMA error after hotplugging a IDE (compact flash) drive
« Reply #2 on: September 28, 2011, 12:46:38 AM »
Its the nature of compact flash (wich has a IDE interface) to be hotpluggable I guess, so maybe it should be considered.
Its sounds like it is possible in theory.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Single DMA error after hotplugging a IDE (compact flash) drive
« Reply #3 on: September 28, 2011, 12:48:29 AM »
Its the nature of compact flash (wich has a IDE interface) to be hotpluggable I guess, so maybe it should be considered.
Its sounds like it is possible in theory.

IDE interfész of PC itself is not hotpluggable by design, idependently of the drive. You are lucky it works.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11213
Re: Single DMA error after hotplugging a IDE (compact flash) drive
« Reply #4 on: September 28, 2011, 05:58:55 AM »
Hi ost
Do you at least unmount the drive before unplugging it?

Offline ost

  • Newbie
  • *
  • Posts: 41
Re: Single DMA error after hotplugging a IDE (compact flash) drive
« Reply #5 on: September 29, 2011, 01:00:14 AM »
I know the danger of extracting a drive that is not unmounted. This is while working at partition level and the drive isnt mounted. The same goes for usb drives.

I agree IDE isn't designed for hotplugging, but when it comes to the Compact Flash interface, it does support hotplug probably by some extra signals on the side.
I am not sure how the OS is supposed to differenciate a CF from a IDE, but Im sure it must have been taken care of in hardware.

Offline ost

  • Newbie
  • *
  • Posts: 41
Re: Single DMA error after hotplugging a IDE (compact flash) drive
« Reply #6 on: September 29, 2011, 06:21:09 AM »
Oh.. maybe this is important information.. This drive gets the name sda, not hda.. So something must have picket it up as hotpluggable?


Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Single DMA error after hotplugging a IDE (compact flash) drive
« Reply #7 on: September 29, 2011, 06:48:15 AM »
Oh.. maybe this is important information.. This drive gets the name sda, not hda.. So something must have picket it up as hotpluggable?

Just naming convention. Wether you like it or not, IDE is not hotpluggable. It is not BIOS, it is not Kernel, it is HW.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11213
Re: Single DMA error after hotplugging a IDE (compact flash) drive
« Reply #8 on: September 29, 2011, 07:21:22 AM »
Hi ost
Here's something you can try, NO guarantees that it will work
Install hdparms.tcz, then open a terminal and type
Code: [Select]
hdparm -b0 /dev/sdaUnplug and replug the CF card
Code: [Select]
hdparm -b1 /dev/sdaIf hdparm is truly turning off the bus to the CF card in the first command, the error should go away.

Offline ost

  • Newbie
  • *
  • Posts: 41
Re: Single DMA error after hotplugging a IDE (compact flash) drive
« Reply #9 on: September 30, 2011, 12:05:17 AM »
Just naming convention. Wether you like it or not, IDE is not hotpluggable. It is not BIOS, it is not Kernel, it is HW.

Ok, IDE is not hotpluggable. But CF is made to be hotpluggable. Maybe it is wrong to use the term "IDE" for it, but its somewhat IDE compatible through an adapter, except for the hotplugging.
Compactflash.org uses the words (...based on PATA), ref http://compactflash.org/product-types/cf-cards/
Maybe some hw systems aren't designed to handle the hotplugging, but rather use it as an IDE drive. That mostly goes for IDE to CF adapters, but I can see the possibility of that happen inside the computer as well.

Googling around, I find hot plug compatible CF adapters, ref http://ppa-usa.com/1134-cf-adapter-pcmcia.html
« Last Edit: September 30, 2011, 12:17:57 AM by ost »

Online curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10960
Re: Single DMA error after hotplugging a IDE (compact flash) drive
« Reply #10 on: September 30, 2011, 12:16:55 AM »
Hm, you have a direct CF slot? I thought this was through a cf-ide adapter. In that case consult your mobo manual on the hotpluggability.
The only barriers that can stop you are the ones you create yourself.

Offline ost

  • Newbie
  • *
  • Posts: 41
Re: Single DMA error after hotplugging a IDE (compact flash) drive
« Reply #11 on: September 30, 2011, 12:38:49 AM »
Hm, you have a direct CF slot? I thought this was through a cf-ide adapter. In that case consult your mobo manual on the hotpluggability.

Well, Im not really sure if I have a hotlpug (or hot swap as they seem to be using when talking aobut CF) compatible HW.
Found this interesting piece where the subject is mentioned.
http://www.analog.com/library/analogDialogue/archives/37-01/compact_flash.html
First quick read gives me the impression that OS should handle it, but HW needs to handle the electrical safety during POR.


Offline ost

  • Newbie
  • *
  • Posts: 41
Re: Single DMA error after hotplugging a IDE (compact flash) drive
« Reply #12 on: October 07, 2011, 04:57:30 AM »
I have new information on this case..
The file "/sys/block/sda/removable" contains "1"!
I guess that tells me the disk is detected as removable and that this case is still relevant?

Hmm.. I guess I have to check if the core detects when it gets removed.
« Last Edit: October 07, 2011, 05:05:19 AM by ost »