"Read-only file system" error while writing

Jörn Engel joern at wohnheim.fh-wedel.de
Wed Jul 31 07:53:33 EDT 2002


On Tue, 30 July 2002 23:25:26 +0100, David Woodhouse wrote:
> gromit1463 at mailworks.org said:
> > When I write to the chips using either cat, dd, stdout redirection, or
> > cp, the CFI driver complains of attempting to write to a "Read-only
> > file system", even after unlocking all blocks in the partition and
> > erasing the partition.  I can mount /dev/mtdblock*, but mount
> > complains and I still can't put anything into the mounted partition.
> > do_write_buffer() in cfi_cmdset_0001.c is returning the error (EROFS).
> 
> The only case in which do_write_buffer() should return -EROFS is if the 
> status bit is set which means that the block in question was locked. Try 
> using the MEMUNLOCK ioctl to unlock it?

We have had a similar problem with the ECC chips. When doing two
writes to the same page, the second write causes an error, leaving the
status word with 0x90. The word is not cleared until an explicit clear
status register command (0x50) is given.
The command set 0001 doesn't know about all this and behaves quite
strange. From user space, the _third_ write to flash causes an error
condition. The second already failed, but this is unnoticed.

At first glance, your chips doesn't appear to have ecc though. Can you
please verify, Stephen?

Jörn

-- 
You can't tell where a program is going to spend its time. Bottlenecks
occur in surprising places, so don't try to second guess and put in a
speed hack until you've proven that's where the bottleneck is.
-- Rob Pike




More information about the linux-mtd mailing list