From: David Brownell <david-b@pacbell.net>
To: "Leon Woestenberg" <leon.woestenberg@gmail.com>
Cc: LAK <linux-arm-kernel@lists.arm.linux.org.uk>,
"Linux Kernel list" <linux-kernel@vger.kernel.org>
Subject: Re: Locking in the (now generic) GPIO infrastructure?
Date: Fri, 6 Jun 2008 13:13:10 -0700 [thread overview]
Message-ID: <200806061313.11021.david-b@pacbell.net> (raw)
In-Reply-To: <c384c5ea0806061223k44a7db74hbdf2ed6f422442b2@mail.gmail.com>
On Friday 06 June 2008, Leon Woestenberg wrote:
> In fact, on the IXP4xx, gpio_set_value() is just gpio_line_set(),
OK, so the generic GPIO calls are inheriting a locking bug
from the older code. Calls to the older stuff should probably
start getting phased out.
> so I
> think it is valid to understand where the locking should occur (lowest
> level, higher level?)
>
> > most spinlocks to establish its atomicity guarantee; it's
> > described as "spinlock-safe", and in distinction to the
> > gpio_set_value_cansleep() call which could use a mutex or
> > other sleeping synch primitive.
> >
>
> So, the solution (for the upstream work on -rt) would be to add
> spinlock protection to gpio_line_set(), mutex protection for
> _cansleep() variants?
Given this is on -RT, yes it seems like a spinlock is needed
to protect against preemption (but not against concurrency,
which those XScale chips don't provide).
Though with that addition, the size of that function exceeds
what I'd call appropriate to inline.
- Dave
next prev parent reply other threads:[~2008-06-06 20:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-04 11:00 Leon Woestenberg
2008-06-06 8:52 ` Russell King - ARM Linux
2008-06-06 10:28 ` Ben Dooks
2008-06-06 12:53 ` David Brownell
2008-06-06 19:23 ` Leon Woestenberg
2008-06-06 20:13 ` David Brownell [this message]
2008-06-07 11:52 ` Mikael Pettersson
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=200806061313.11021.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=leon.woestenberg@gmail.com \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®