linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: alsa-devel@alsa-project.org, Arnd Bergmann <arnd@arndb.de>,
	vamos-dev@lists.cs.fau.de, Takashi Iwai <tiwai@suse.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, Jaroslav Kysela <perex@perex.cz>,
	David Howells <dhowells@redhat.com>,
	Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	Christian Dietrich
	<christian.dietrich@informatik.uni-erlangen.de>,
	linux-mtd@lists.infradead.org
Subject: Re: [PATCH] netwinder: nw_gpio_lock is a raw_spinlock_t
Date: Tue, 29 May 2012 13:24:47 +0300	[thread overview]
Message-ID: <1338287087.2536.7.camel@sauron.fi.intel.com> (raw)
In-Reply-To: <1338286268.11518.157.camel@shinybook.infradead.org>

[-- Attachment #1: Type: text/plain, Size: 1210 bytes --]

On Tue, 2012-05-29 at 11:11 +0100, David Woodhouse wrote:
> On Tue, 2012-05-29 at 12:06 +0200, Christian Dietrich wrote:
> > Since nw_gpio_lock is a raw_spinlock_t it should be used with the
> > raw_spinlock_* functions and not the spinlock_* variants. Functionally
> > this is equivalent at the moment, because the raw_spinlock_t is the
> > first field of spinlock_t, and therefore &nw_gpio_lock ==
> > &(nw_gpio_lock->rlock). But when other spinlock_t functions use other
> > field they read and write random memory.
> 
> Hm, why are we exposing a raw spinlock to drivers? 
> 
> Should we export a helper function (or macro, I suppose) which does the
> appropriate locking *and* the GPIO operation?

AFAIR, raw spinlock is the one that will not be turned into a
"preemptable" spinlock in the RT tree. E.g., this is needed when dealing
with interrupts. And what if not drivers should use them?

But this commit message did not explain still (although I requested)
_why_ it needs a raw spinlock, which problems it solves?

This URL may be useful for Christian:

http://who-t.blogspot.com/2009/12/on-commit-messages.html

I like that blog-post.

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-05-29 10:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-25  8:28 [PATCH] mtd: dc21285.c: handle nw_gpio_lock correctly Christian Dietrich
2012-05-26 13:54 ` Artem Bityutskiy
2012-05-29 10:06 ` [PATCH] netwinder: nw_gpio_lock is a raw_spinlock_t Christian Dietrich
2012-05-29 10:11   ` David Woodhouse
2012-05-29 10:24     ` Artem Bityutskiy [this message]
2012-05-31 10:15     ` [PATCH] netwinder: encapsulate CPLD hardware locking and access Christian Dietrich
2012-05-31 12:31       ` David Woodhouse
2012-05-29 10:52   ` [PATCH] netwinder: nw_gpio_lock is a raw_spinlock_t David Woodhouse
2012-05-29 10:06 ` [PATCH] mtd: dc21285.c: remove double check of CONFIG_ARCH_NETWINDER Christian Dietrich
2012-05-29 10:19   ` David Woodhouse

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=1338287087.2536.7.camel@sauron.fi.intel.com \
    --to=dedekind1@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=arnd@arndb.de \
    --cc=christian.dietrich@informatik.uni-erlangen.de \
    --cc=dbaryshkov@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=dwmw2@infradead.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    --cc=vamos-dev@lists.cs.fau.de \
    /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).