linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>,
	Alexandre Courbot <gnurou@gmail.com>,
	Linux-OMAP <linux-omap@vger.kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	Sekhar Nori <nsekhar@ti.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Roger Quadros <rogerq@ti.com>
Subject: Re: [PATCH] gpiolib: irqchip: use different lockdep class for each gpio irqchip
Date: Mon, 17 Aug 2015 11:06:07 +0200	[thread overview]
Message-ID: <CACRpkdbsuxyD1p2miA+Zgern9Fr2pS5PzsUeikViGbfMiP6TgQ@mail.gmail.com> (raw)
In-Reply-To: <55CDE1BB.1060708@metafoo.de>

On Fri, Aug 14, 2015 at 2:40 PM, Lars-Peter Clausen <lars@metafoo.de> wrote:
> On 08/14/2015 02:34 PM, Linus Walleij wrote:
> [...]
>> Every chip will get their own lock class on the heap.
>>
>> But I think it is a bit kludgy.
>>
>> Is it not possible to have  the lock key in struct gpio_chip
>> be a real member instead of a pointer and get a per-chip
>> lock that way?
>>
>> (...)
>> struct lock_class_key lock_key;
>>
>> instead of:
>>
>> struct lock_class_key  *lock_key;
>>
>> -> problem solved, without kludgy header defines?
>
>
> Lock keys need to be in persistent memory since they have a unlimited life
> time. Once registered it is expected to exist until the system is reset.

Aha I see.

OK if we fix the documentation comment I guess we can go with this,
even if it makes the header file somewhat hard to read.

I have a bit of problem with it, because lockdep instrumentation is
supposed to make development easier, not harder, now it helps
in one end with lock validation and screws up in another end by creating
API headers that are hopeless to read :(

Linus

  parent reply	other threads:[~2015-08-17  9:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-13 14:58 [PATCH] gpiolib: irqchip: use different lockdep class for each gpio irqchip Grygorii Strashko
2015-08-14  9:00 ` Roger Quadros
2015-08-14 12:34 ` Linus Walleij
2015-08-14 12:40   ` Lars-Peter Clausen
2015-08-14 13:05     ` Grygorii Strashko
2015-08-17  9:06     ` Linus Walleij [this message]
2015-08-17  9:40   ` Grygorii Strashko

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=CACRpkdbsuxyD1p2miA+Zgern9Fr2pS5PzsUeikViGbfMiP6TgQ@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=geert@linux-m68k.org \
    --cc=gnurou@gmail.com \
    --cc=grygorii.strashko@ti.com \
    --cc=lars@metafoo.de \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=nsekhar@ti.com \
    --cc=rogerq@ti.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 NNTP newsgroup(s).