public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Vincent Catros <Vincent.Catros@elios-informatique.fr>
Cc: 'Andrew Lunn' <andrew@lunn.ch>, ecos-discuss@sources.redhat.com
Subject: [ECOS] Re: RE : RE : [ECOS] Multiple partitions on a FLASH device.
Date: Tue, 25 Nov 2003 12:18:00 -0000	[thread overview]
Message-ID: <20031125121812.GI21161@lunn.ch> (raw)
In-Reply-To: <006701c3b343$26f420e0$7407a8c0@figuier>

On Tue, Nov 25, 2003 at 11:59:09AM +0100, Vincent Catros wrote:
> Andrew,
> 
> Sorry for my late answer but, as a newbye with eCos, I preferred to
> "dive" a little bit more into source code before saying something
> obviously wrong.

Thats good. Well thought out questions will get better answers.

> > > OK, this will work on a "Linux Synthetic Target" because that way we
> > > create a totaly separated FLASH device.
> > 
> > How are they seperate. I don't understand what you mean.
> 
> OK, my sentence was not clear.
> I was thinking that you asked me to create 2 "Synthetic FLASH Device"
> emulated by 2 different files. That was the meening of "totaly separated
> FLASH devices".
> 
> I think that using 1 "Synthetic FLASH device" with 2 partitions will
> work.
> But this is a particular case.
> 
> With "Synthetic FLASH Driver", the "FLASH" device is emulated by a file.
> Mutual access to different regions of a file (different FLASH
> partitions) using different file handles are safe.
> 
> For "real FLASH device" driver I think it's different.
> 
> > > I think this is not possible without modifying the FLASH driver.
> > 
> > What do you think is wrong with the FLASH driver. Why cannot it do
> > this?
> 
> Some FLASH registers are accessed for read/write/erase operations.
> Mutual accesses to tis registers don't seem to be safe. 
> I did'nt seen any critical ressource access protection.
> 
> So, mutual read/write/erase operations issued from 2 different JFFS2
> file-system will probably go wrong at FLASH device level.

This is the key point. And its not just 2 different JFFS2 FS's but its
any two general flash operations which need mutual exclusion. You
appear to be correct, i cannot find any mutex's in the current code. I
assumed there was when i replied. (Should of checked myself before
replying!)

OK. There are two obvious ways to solve this.

1) Modify the generic flash layer. Add calls to cyg_drv_mutex_(un)lock
   around the operations which call down into the hardware specific
   driver.

2) Modify the hardware specific drivers to perform the locking.

The first has the advantage its quick and easy to do and solves the
problem for all devices in one go. The second has the advantage that
when there are multiple flash devices in series, it would be possible
to apply mutex to each device, so allowing operations on different
devices to work in parallel.

I would go for 1) to start with. If anybody needs the extra
performance of 2), it would be easy to add it afterwards.

Do you feel up to coding this? If so, send us a patch, with ChangeLog,
and we will review it.

    Andrew

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

      reply	other threads:[~2003-11-25 12:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-19 10:00 Vincent Catros
2003-11-19 10:21 ` Andrew Lunn
2003-11-19 10:41   ` [ECOS] RE : " Vincent Catros
2003-11-19 10:57     ` [ECOS] " Andrew Lunn
2003-11-25 10:56       ` [ECOS] RE : " Vincent Catros
2003-11-25 12:18         ` Andrew Lunn [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=20031125121812.GI21161@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Vincent.Catros@elios-informatique.fr \
    --cc=ecos-discuss@sources.redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).