public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: gleixner@autronix.de
Cc: jffs-dev@axis.com
Subject: Re: JFFS2 on NAND flash
Date: Thu, 31 Jan 2002 14:30:14 +0000	[thread overview]
Message-ID: <17713.1012487414@redhat.com> (raw)
In-Reply-To: <02013113260208.00763@thomas>

( moved to jffs-dev list )

gleixner@autronix.de said:
> I know that and i was trying to put a workaround for the write cycle
> problem  into the nand driver. I think thats the correct location for
> this. Are there  other chips dealing with the same problem or is it
> related to NAND only ? 

Some new ST chips have similar problems, I think. You can only write once 
to any given 8-byte region before erasing it.

> My current solutiun would be: In nand.c the
> write functions checks the write attempts to a page. If there  were
> three writes already to this page, the function reads back the block
> data, erases the block and writes the block data back to the chip. 

You can't do it like that. What if you lose power while the block is erased,
but before you have written the data back again? You lose all the
information from the remainder of that erase block.

See http://mhonarc.axis.se/jffs-dev/msg01140.html

>  Is this also a problem for jffs1 ? I run jffs1 for a couple of weeks
> on my  board and had not one problem at all.  

I think you get away with it on JFFS1. You don't have nodes small enough 
that you'll fit ten of them in a page, and you can go for a couple of weeks 
without the lack of ECC biting you.

gleixner@autronix.de said:
> > Also note that the locking in jffs2_garbage_collect_deletion_dirent()
> > is broken. We need to lock the erase_completion_lock while we go through
> > the list, and drop the lock when we read the nodes. 

> I'm not deep enough inside this to see the neccecary change. Could you 
> please  explain more detailed ?

On completion of a block erase, we walk through all the node lists, and we 
remove and free all nodes in the block which has just been erased. Anything 
which walks the node lists (as this function does) must hold the
erase_completion_lock, so that the erase can't happen simultaneously.

So we must hold the erase_completion_lock while walking the lists, and 
because it's a spinlock we must unlock it before calling the flash read 
function. Then when we get it again the node we were looking at and the 
next node in the list may both have gone and been freed - we have to start 
again from the beginning.


--
dwmw2

      parent reply	other threads:[~2002-01-31 14:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-01  9:51 JFFS2 on NAND flash/DiskOnChip David Woodhouse
2002-01-31 10:04 ` JFFS2 on NAND flash Thomas Gleixner
2002-01-31 10:22   ` David Woodhouse
2002-01-31 12:26     ` Thomas Gleixner
2002-01-31 14:29       ` Thomas Gleixner
2002-01-31 14:30       ` David Woodhouse [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17713.1012487414@redhat.com \
    --to=dwmw2@infradead.org \
    --cc=gleixner@autronix.de \
    --cc=jffs-dev@axis.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox