From: akpm@linux-foundation.org (Andrew Morton)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 1/4] drivers: hwspinlock: add framework
Date: Mon, 31 Jan 2011 22:38:59 -0800 [thread overview]
Message-ID: <20110131223859.27169db0.akpm@linux-foundation.org> (raw)
In-Reply-To: <AANLkTik-fgCF_W0-DBE6UVTpjqF6Jf=u7bQYkcweEegQ@mail.gmail.com>
On Tue, 1 Feb 2011 08:20:13 +0200 Ohad Ben-Cohen <ohad@wizery.com> wrote:
> On Tue, Feb 1, 2011 at 1:38 AM, Andrew Morton <akpm@linux-foundation.org> wrote:
> > It's a little irritating having two hwspinlock.h's.
> > hwspinlock_internal.h wold be a conventional approach. __But it's not a
> > big deal.
> ...
>
> >> +/**
> >> + * __hwspin_lock_timeout() - lock an hwspinlock with timeout limit
> >> + * @hwlock: the hwspinlock to be locked
> >> + * @timeout: timeout value in jiffies
> >
> > hm, why in jiffies?
> >
> > The problem here is that lazy programmers will use
> >
> > __ __ __ __hwspin_lock_timeout(lock, 10, ...)
> >
> > and their code will work happily with HZ=100 but will explode with HZ=1000.
> >
> > IOW, this interface *requires* that all callers perform a
> > seconds-to-jiffies conversion before calling hwspin_lock_timeout(). __So
> > why not reduce their effort and their ability to make mistakes by
> > defining the API to take seconds?
>
> I considered that, but then decided to use jiffies in order to be
> consistent with wait_event_timeout/schedule_timeout (although I don't
> return the remaining jiffies in case the lock is taken before the
> timeout elapses), and also to allow user-selected granularity.
>
> But I do kind of like the idea of not using jiffies. We can probably
> even move to msecs, since anyway this is an error condition, and
> people who needs a quick check should just use the trylock() version.
>
> I'll do a quick respin of the patches with that and the
> hwspinlock_internal.h comment above.
OK..
The patch series looks OK to me. But there isn't a lot of point in me
putting them into my tree. Maybe Tony or Russell or Greg can grab them
if they like the look of it all?
next prev parent reply other threads:[~2011-02-01 6:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-31 10:33 [PATCH v4 0/4] Introduce hardware spinlock framework Ohad Ben-Cohen
2011-01-31 10:33 ` [PATCH v4 1/4] drivers: hwspinlock: add framework Ohad Ben-Cohen
2011-01-31 23:38 ` Andrew Morton
2011-02-01 6:20 ` Ohad Ben-Cohen
2011-02-01 6:38 ` Andrew Morton [this message]
2011-02-01 7:36 ` Ohad Ben-Cohen
2011-02-01 7:40 ` Andrew Morton
2011-02-01 8:12 ` Ohad Ben-Cohen
2011-02-02 12:11 ` Russell King - ARM Linux
2011-02-04 1:47 ` Tony Lindgren
2011-02-01 14:17 ` Greg KH
2011-02-01 15:34 ` Arnd Bergmann
2011-01-31 10:33 ` [PATCH v4 2/4] drivers: hwspinlock: add OMAP implementation Ohad Ben-Cohen
2011-01-31 10:33 ` [PATCH v4 3/4] OMAP4: hwmod data: Add hwspinlock Ohad Ben-Cohen
2011-01-31 10:33 ` [PATCH v4 4/4] omap: add hwspinlock device Ohad Ben-Cohen
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=20110131223859.27169db0.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=linux-arm-kernel@lists.infradead.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 NNTP newsgroup(s).