This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MPC8260 cache patch


On Sun, 2003-03-30 at 14:52, Jonathan Larmour wrote:
> Gary Thomas wrote:
> > 
> > Technically, this should not matter.  The only time this would make any
> > difference would be if the FLASH functions modified data that was already
> > within the data cache.  If the lines were left valid and then the cache
> > disabled, when the cache was re-enabled, the lines in the cache could
> > override the changes in memory, leading to an inconsistent state.  So,
> > for safety's sake, we should leave the invalidate calls in there.  BTW,
> > as far as I can see the only time this could cause a problem would be
> > on the "inquire" function - the one that computes the size and shape of
> > the FLASH.  If that data were already in the cache, then things could
> > go awry.  The only other routines only write to the FLASH and should not
> > be touching memory anyway.
> 
> I think this only applies to the simplest of operations. It only takes a 
>   read/write/read operation to risk problems. You could provoke this by 
> just cksumming an area of flash before doing a write to it, and then 
> cksumming it again, for example[1]. Unlikely, but, users given a CLI can 
> do whatever they want :-).
> 

Of course - it's easy to imagine scenarios which lead to invalid data.
As I said, the safest course is to leave the invalidates in place.  That
way, when the cache comes back on, there are no assumptions about what's
in it.

> More troublesome would be flash file systems of course, and they rely on 
> the underlying drivers doing the right thing.
> 
> Jifl
> [1] Talking of which, I'm I the only one still showing a mismatch between 
> RedBoot cksum and Linux cksum? I thought all these issues were worked out 
> not all that long ago.

Is this something that you've reported [or complained about]?  It always
seemed to work correctly for me.

-- 
------------------------------------------------------------
Gary Thomas                 |
MLB Associates              |  Consulting for the
+1 (970) 229-1963           |    Embedded world
http://www.mlbassoc.com/    |
email: <gary at mlbassoc dot com>  |
gpg: http://www.chez-thomas.org/gary/gpg_key.asc
------------------------------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]