[prev in list] [next in list] [prev in thread] [next in thread] 

List:       uclinux-dev
Subject:    Re: [uClinux-dev] how to mount flash via jffs2 as dir /mnt ?
From:       David McCullough <david_mccullough () au ! securecomputing ! com>
Date:       2006-03-22 10:15:43
Message-ID: 20060322101543.GB18851 () beast
[Download RAW message or body]


Jivin Falk Brettschneider lays it down ...
> > --- Urspr?ngliche Nachricht ---
> > Von: David McCullough <david_mccullough@au.securecomputing.com>
> > Jivin Falk Brettschneider lays it down ...
> > > > Von: David McCullough <david_mccullough@au.securecomputing.com>
> > > > Jivin Falk Brettschneider lays it down ...
> > > > > > Von: David McCullough <david_mccullough@au.securecomputing.com>
> > > > > > Well, I committed it,  but it came in with the import of
> linux-2.4.21.
> > > > > > 
> > > > > > The commit log probably says something about the import of 2.4.21.
> > > > > > 
> > > > > > The comment in the code explains it IMO:
> > > > > > 
> > > > > >         /* In cfi_amdstd_write() we frob the protection stuff
> > > > > >           without paying any attention to the state machine.
> > > > > >           This upsets in-progress erases. So we turn this flag
> > > > > >           off for now till the code gets fixed. */
> > > > > I read it but wonder what it means. How can an erase be in-progress
> > > > during a
> > > > > write? Does it mean two accesses from different threads? Having it
> > > > > single-threaded, AFAIK one can poll a status bit for the completion
> > of a
> > > > > flash action, am I really right (?)...
> > > > 
> > > > Ok,  I could easily be wrong on this,  but it looks like the code is
> > > > unlocking the chip directly in the code instead of using the standard
> > > > MTD mechanisms for it.
> > > > 
> > > > And yes,  you can have processes writing to flash while others are
> > > > reading from it.  MTD deals with all this quite well via it's locking
> > > > mechanisms,  thus by passing it in any way would be bad,
> > >
> > > Since in my system only one user app uses the flash (in one single
> > thread).
> > > Is it OK to enable fast programming mode for this special case?
> > 
> > Do you have anything else running out of flash ?  Accessing flash in any
> > way ?  A filesystem ?  A config reader ?
>
> Just jffs2.

Then you can't enable it.  JFFS could easily be doing something when you
write to flash.

> > MTD does all it's flash work with interrupts enabled and other processes
> > are free to do as they please.  This includes trying to execute from
> > flash,  or just access it for something.
> > 
> > If all your filesystems are in RAM,  and no one other than the process
> > writing to flash even knows that flash exists you may be ok,  but I
> > won't promise that and personally would leave it as is ;-)
>
> The only thing I'm not sure of is if Linux has e.g. a background daemon
> doing flash synchronizations delayed, that could happen during the same time
> as my process wants to access the flash.

Absolutely does,  IIRC JFFS has a maintenance thread of some kind.

Cheers,
Davidm

-- 
David McCullough,  david_mccullough@securecomputing.com,   Ph:+61 734352815
Secure Computing - SnapGear  http://www.uCdot.org http://www.cyberguard.com
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic