public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Jonathan Larmour <jifl@eCosCentric.com>
To: Daniel Helgason <dhelgason@shaw.ca>
Cc: Andrew Lunn <andrew@lunn.ch>,  ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] Non-contiguous flash with flashv2
Date: Wed, 10 Dec 2008 06:10:00 -0000	[thread overview]
Message-ID: <493F1A2E.10101@eCosCentric.com> (raw)
In-Reply-To: <1228759213.3047.50.camel@localhost.localdomain>

Daniel Helgason wrote:
> 
> It seems a bit of a pity to have to take two mutexs to perform a flash
> operation. Would it be worth considering making the locking strategy a
> configurable option in io/flash? Perhaps the choices could be none,
> common, or per-driver.

There's probably a better way to abstract this than making it an option -
it's an intrinsic property of the driver and should be set automatically.
After all, we want to support multiple different drivers in a system, with
completely different properties.

It imagine it could be expressed some way via some variant of the
CYG_FLASH_DRIVER macro. An initial thought is CYG_FLASH_DRIVER_NO_LOCK for
the case with no locks so the driver is responsible for locking if any is
required. Then you can also have CYG_FLASH_DRIVER_SHARED_LOCK  (better name
suggestions welcomed) to which you pass, along with the usual stuff,
another CYG_FLASH_DRIVER instance with which you share the same mutex lock.

The ability to selectively push locking into the driver would be worthwhile
- it would make it feasible to support operations like erasing of entire
planes. The above would make it possible I believe.

But in the most common case, we don't want to increase the porting effort
of individual drivers by requiring them to always do locking themselves,
IMHO. So anything which requires changing existing drivers should be
considered a no-no, especially since it should be after eCos 3.0.

Jifl
-- 
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["Si fractum non sit, noli id reficere"]------       Opinions==mine

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

  reply	other threads:[~2008-12-10  1:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-04  6:18 Daniel Helgason
2008-12-04 10:41 ` Andrew Lunn
2008-12-09  0:41   ` Daniel Helgason
2008-12-10  6:10     ` Jonathan Larmour [this message]
2008-12-10 10:26     ` Bart Veer

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=493F1A2E.10101@eCosCentric.com \
    --to=jifl@ecoscentric.com \
    --cc=andrew@lunn.ch \
    --cc=dhelgason@shaw.ca \
    --cc=ecos-discuss@ecos.sourceware.org \
    /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).