linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Johan Hovold <johan@kernel.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Revert "gpiolib: Split GPIO flags parsing and GPIO configuration"
Date: Tue, 5 Jul 2016 11:12:20 +0200	[thread overview]
Message-ID: <20160705091220.GC17168@localhost> (raw)
In-Reply-To: <CACRpkdZFUjFUApC-pZEjw7O54uCeivEvkjEBah_eq1x4nhnv+w@mail.gmail.com>

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@ideasonboard.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

  reply	other threads:[~2016-07-05  9:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-03 16:32 [PATCH] Revert "gpiolib: Split GPIO flags parsing and GPIO configuration" Johan Hovold
2016-07-04 13:16 ` Linus Walleij
2016-07-04 20:30   ` Laurent Pinchart
2016-07-05  6:52     ` Linus Walleij
2016-07-04 14:54 ` Linus Walleij
2016-07-04 20:33 ` Laurent Pinchart
2016-07-05  6:54   ` Linus Walleij
2016-07-05  9:12     ` Johan Hovold [this message]
2016-07-05 13:50       ` Linus Walleij
2016-07-05  8:56   ` Johan Hovold

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=20160705091220.GC17168@localhost \
    --to=johan@kernel.org \
    --cc=gnurou@gmail.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).