From: Chris Holgate <chris@zynaptic.com>
To: Nick Garnett <nickg@ecoscentric.com>
Cc: ecos-devel@ecos.sourceware.org
Subject: Re: STM32 - I/O pullup and EXTI issues, plus new SPI driver.
Date: Sat, 22 Nov 2008 12:53:00 -0000 [thread overview]
Message-ID: <1227358709.19034.11.camel@hercules.zynaptic.com> (raw)
In-Reply-To: <m3d4gp2dao.fsf@xl5.calivar.com>
On Fri, 2008-11-21 at 17:34 +0000, Nick Garnett wrote:
> Chris Holgate <chris@zynaptic.com> writes:
>
> >
> > Polled operation works, but I'm going to have to sprinkle a few
> > preprocessor directives in there to get rid of my calls to the kernel
> > flags API. Is there any reason why flags support didn't make it into
> > the standard driver API? I find that it's much more elegant than using
> > condition variables in a lot of cases.
>
> The driver API is meant to be simple and reflect how drivers should
> be used. Each driver is responsible for managing its own concurrency
> so it needs to use mutexes anyway. When a thread in the driver must
> wait for an interrupt it must release the mutex, a condition variable
> provides exactly the necessary functionality.
>
> Flags are too complicated to be used at driver level, and too prone to
> errors and race conditions.
Ok - I can see the point about keeping the driver API as simple as
possible, especially given that the flags functionality can easily be
emulated using the existing driver primitives. Flags now expunged.
> I suggest you take a look at the AT91 driver for an example of how an
> SPI driver should work.
I think it's fair to say that there are already quite a few similarities
between the two drivers!
Chris.
prev parent reply other threads:[~2008-11-22 12:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-21 15:06 Chris Holgate
2008-11-21 15:15 ` Simon Kallweit
2008-11-21 15:52 ` Jonathan Larmour
2008-11-21 15:53 ` Nick Garnett
2008-11-21 17:08 ` Chris Holgate
2008-11-21 17:35 ` Nick Garnett
2008-11-22 12:53 ` Chris Holgate [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=1227358709.19034.11.camel@hercules.zynaptic.com \
--to=chris@zynaptic.com \
--cc=ecos-devel@ecos.sourceware.org \
--cc=nickg@ecoscentric.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).