[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160705091220.GC17168@localhost>
Date: Tue, 5 Jul 2016 11:12:20 +0200
From: Johan Hovold <johan@...nel.org>
To: Linus Walleij <linus.walleij@...aro.org>
Cc: Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Johan Hovold <johan@...nel.org>,
Alexandre Courbot <gnurou@...il.com>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Revert "gpiolib: Split GPIO flags parsing and GPIO
configuration"
On Tue, Jul 05, 2016 at 08:54:36AM +0200, Linus Walleij wrote:
> On Mon, Jul 4, 2016 at 10:33 PM, Laurent Pinchart
> <laurent.pinchart@...asonboard.com> wrote:
>
> > As we're not dealing with a v4.7 regression that would need to be applied this
> > week, can't you propose a proper fix instead of a revert ?
>
> AFAICT the proper fix is to simply move the gpiod_request() sites earlier,
> I can propose something if that's all right?
How would that work?
You still need to claim the pin before touching the descriptor flags,
and that isn't done until gpiod_request(). Furthermore, it's that very
function that calls the gpio driver request() callback, which in turn
was supposed to do the sanity check.
So what you need to do is to pass the desired flags down the call stack,
and make sure not to apply them before claiming the pin.
This may work without modifying the request callback prototype (which I
mentioned in my reply to Laurent), but it could still get a bit
invasive and hence not suitable for stable (and we really need this to
be fixed in 4.[456] stable).
Your call. :)
Thanks,
Johan
Powered by blists - more mailing lists