linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Compactflash (Sandisk 512) hangs on access
@ 2005-01-27 18:35 Prashant Viswanathan
  2005-01-27 21:07 ` Willy Tarreau
  0 siblings, 1 reply; 4+ messages in thread
From: Prashant Viswanathan @ 2005-01-27 18:35 UTC (permalink / raw)
  To: linux-kernel

I have been trying unsuccessfully over the last 2 weeks to get
compactflash working on my Linux system based on mini-ITX (Via CL
motherboard, pentium compatible).

I use a CF->IDE adapter to access it just like a IDE hard disk. My
compactflash is Sandisk SDCFH-512. Linux can detect it. I can even
mount it and do a fdisk on it. However, the moment I try to do
anything substantial like copy multiple files or copy 1000 blocks
using dd, I lose access to it. Linux loses access to it totally. I
can't even do a fdisk on it. I get an error like "Unable to open
/dev/hdc".

I have looked at newsgroups and tried the following things
* Used another CF (same brand) to make sure it wasn't due to a bad CF.
 Moreover I can access it perfectly well using a USB flash
reader/writer (shows up as a SCSI disk).
* Tried a compactflash from another manufacturer.
* Upgraded my Linux kernel from 2.4.26 to 2.6.7
* Disabled DMA on the IDE drive using hdparm
* Built and used kernels with and without devfs.
* Used compactflash as a slave on the IDE channel, as a master and on
both primary and secondary channels.

I get errors like (from dmesg)
"hdc: irq timeout: status=0xff { Busy }" (no dma)
or
"hdc: lost interrupt" (when i had dma enabled)

Is there some nasty race condition that I am hitting?

Also, now I can't seem to turn dma back on.

<snip>
everest root # hdparm -d1 /dev/hdc

/dev/hdc:
setting using_dma to 1 (on)
HDIO_SET_DMA failed: Operation not permitted
using_dma    =  0 (off)
</snip>


I would appreciate any help/suggestions/pointers.

Thanks a lot in advance for reading through this and any help.
Prashant


P.S Please CC me on the responses.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compactflash (Sandisk 512) hangs on access
  2005-01-27 18:35 Compactflash (Sandisk 512) hangs on access Prashant Viswanathan
@ 2005-01-27 21:07 ` Willy Tarreau
  2005-01-29  6:12   ` Prashant Viswanathan
  0 siblings, 1 reply; 4+ messages in thread
From: Willy Tarreau @ 2005-01-27 21:07 UTC (permalink / raw)
  To: Prashant Viswanathan; +Cc: linux-kernel

Have you checked that the power connector really provides 5V to the
IDE-CF adapter ? I had the exact same behaviour 5 years ago with a power
wire cut. Signal lines were powerful enough to bring power to the cheap
flash (16 MB), I could even read it, most times. The kernel almost always
booted from it, and when it turned to mount the ext2 fs R/W, it hanged. I
finally partially destroyed it this way, and it got several defects which 
could not be cleaned with a simple write or format.

Other than that, I have lots of CF cards on IDE adapters (some on motherboard,
some hand-made, some bought to serious makers), and never ran into such
problems since.

Willy

On Thu, Jan 27, 2005 at 10:35:28AM -0800, Prashant Viswanathan wrote:
> I have been trying unsuccessfully over the last 2 weeks to get
> compactflash working on my Linux system based on mini-ITX (Via CL
> motherboard, pentium compatible).
> 
> I use a CF->IDE adapter to access it just like a IDE hard disk. My
> compactflash is Sandisk SDCFH-512. Linux can detect it. I can even
> mount it and do a fdisk on it. However, the moment I try to do
> anything substantial like copy multiple files or copy 1000 blocks
> using dd, I lose access to it. Linux loses access to it totally. I
> can't even do a fdisk on it. I get an error like "Unable to open
> /dev/hdc".
> 
> I have looked at newsgroups and tried the following things
> * Used another CF (same brand) to make sure it wasn't due to a bad CF.
>  Moreover I can access it perfectly well using a USB flash
> reader/writer (shows up as a SCSI disk).
> * Tried a compactflash from another manufacturer.
> * Upgraded my Linux kernel from 2.4.26 to 2.6.7
> * Disabled DMA on the IDE drive using hdparm
> * Built and used kernels with and without devfs.
> * Used compactflash as a slave on the IDE channel, as a master and on
> both primary and secondary channels.
> 
> I get errors like (from dmesg)
> "hdc: irq timeout: status=0xff { Busy }" (no dma)
> or
> "hdc: lost interrupt" (when i had dma enabled)
> 
> Is there some nasty race condition that I am hitting?
> 
> Also, now I can't seem to turn dma back on.
> 
> <snip>
> everest root # hdparm -d1 /dev/hdc
> 
> /dev/hdc:
> setting using_dma to 1 (on)
> HDIO_SET_DMA failed: Operation not permitted
> using_dma    =  0 (off)
> </snip>
> 
> 
> I would appreciate any help/suggestions/pointers.
> 
> Thanks a lot in advance for reading through this and any help.
> Prashant
> 
> 
> P.S Please CC me on the responses.
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compactflash (Sandisk 512) hangs on access
  2005-01-27 21:07 ` Willy Tarreau
@ 2005-01-29  6:12   ` Prashant Viswanathan
  2005-02-03  8:23     ` Prashant Viswanathan
  0 siblings, 1 reply; 4+ messages in thread
From: Prashant Viswanathan @ 2005-01-29  6:12 UTC (permalink / raw)
  To: Willy Tarreau; +Cc: linux-kernel

> > I have been trying unsuccessfully over the last 2 weeks to get
> > compactflash working on my Linux system based on mini-ITX (Via CL
> > motherboard, pentium compatible).
> >
> > I use a CF->IDE adapter to access it just like a IDE hard disk. My
> > compactflash is Sandisk SDCFH-512. Linux can detect it. I can even
> > mount it and do a fdisk on it. However, the moment I try to do
> > anything substantial like copy multiple files or copy 1000 blocks
> > using dd, I lose access to it. Linux loses access to it totally. I
> > can't even do a fdisk on it. I get an error like "Unable to open
> > /dev/hdc".


On Thu, 27 Jan 2005 22:07:35 +0100, Willy Tarreau <willy@w.ods.org> wrote:
> Have you checked that the power connector really provides 5V to the
> IDE-CF adapter ? I had the exact same behaviour 5 years ago with a power
> wire cut. Signal lines were powerful enough to bring power to the cheap
> flash (16 MB), I could even read it, most times. The kernel almost always
> booted from it, and when it turned to mount the ext2 fs R/W, it hanged. I
> finally partially destroyed it this way, and it got several defects which
> could not be cleaned with a simple write or format.
> 
> Other than that, I have lots of CF cards on IDE adapters (some on motherboard,
> some hand-made, some bought to serious makers), and never ran into such
> problems since.
> 
> Willy

The power connector is fine.

I also disabled DMA (some suggestion on this newsgroup to a similar
error) and now I can't turn it back on.

<snip>
everest root # hdparm -d1 /dev/hdc

/dev/hdc:
setting using_dma to 1 (on)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Compactflash (Sandisk 512) hangs on access
  2005-01-29  6:12   ` Prashant Viswanathan
@ 2005-02-03  8:23     ` Prashant Viswanathan
  0 siblings, 0 replies; 4+ messages in thread
From: Prashant Viswanathan @ 2005-02-03  8:23 UTC (permalink / raw)
  To: linux-kernel

On Fri, 28 Jan 2005 22:12:04 -0800, Prashant Viswanathan
<vprashant@gmail.com> wrote:
> > > I have been trying unsuccessfully over the last 2 weeks to get
> > > compactflash working on my Linux system based on mini-ITX (Via CL
> > > motherboard, pentium compatible).
> > >
> > > I use a CF->IDE adapter to access it just like a IDE hard disk. My
> > > compactflash is Sandisk SDCFH-512. Linux can detect it. I can even
> > > mount it and do a fdisk on it. However, the moment I try to do
> > > anything substantial like copy multiple files or copy 1000 blocks
> > > using dd, I lose access to it. Linux loses access to it totally. I
> > > can't even do a fdisk on it. I get an error like "Unable to open
> > > /dev/hdc".
> 
> On Thu, 27 Jan 2005 22:07:35 +0100, Willy Tarreau <willy@w.ods.org> wrote:
> > Have you checked that the power connector really provides 5V to the
> > IDE-CF adapter ? I had the exact same behaviour 5 years ago with a power
> > wire cut. Signal lines were powerful enough to bring power to the cheap
> > flash (16 MB), I could even read it, most times. The kernel almost always
> > booted from it, and when it turned to mount the ext2 fs R/W, it hanged. I
> > finally partially destroyed it this way, and it got several defects which
> > could not be cleaned with a simple write or format.
> >
> > Other than that, I have lots of CF cards on IDE adapters (some on motherboard,
> > some hand-made, some bought to serious makers), and never ran into such
> > problems since.
> >
> > Willy
> 
> The power connector is fine.
> 
> I also disabled DMA (some suggestion on this newsgroup to a similar
> error) and now I can't turn it back on.
> 
> <snip>
> everest root # hdparm -d1 /dev/hdc
> 
> /dev/hdc:
> setting using_dma to 1 (on)
> 


Finally figured out the problem (or at least worked around it).
Everything seems to work perfectly after I switched to an older 40
conductor IDE cable!  Before that I was using the newer 80 conductor
IDE cable. I sitll dont understand why the newer ( and apparently
better) cables are problematic. Higher speeds causing race conditions perhaps?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-02-03  8:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-27 18:35 Compactflash (Sandisk 512) hangs on access Prashant Viswanathan
2005-01-27 21:07 ` Willy Tarreau
2005-01-29  6:12   ` Prashant Viswanathan
2005-02-03  8:23     ` Prashant Viswanathan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).