linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: timur@kernel.org
Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>,
	Stephen Boyd <swboyd@chromium.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] gpiolib: Show correct direction from the beginning
Date: Fri, 21 Sep 2018 09:07:38 -0700	[thread overview]
Message-ID: <CACRpkdYV+A9rUZvYN_Vh3wD6Vb73qj8=SkHJCJ0ZiTWP5Ojw1A@mail.gmail.com> (raw)
In-Reply-To: <27c8e13a-44bf-18b5-083b-25b87d7b8605@kernel.org>

On Thu, Sep 20, 2018 at 7:05 PM Timur Tabi <timur@kernel.org> wrote:
> On 9/20/18 5:36 PM, Linus Walleij wrote:
> > What I mean is that $SUBJECT patch might not hurt Qualcomms
> > GPIOs (not crash the platform) if and only if it is augmented to not
> > try to get the initial direction from lines masked off in .valid_mask
> > if .need_valid_mask is true.
> >
> > Whether it makes sense semantically is a different debate, but it
> > seems possible to reintroduce calling .get_direction() without
> > hurting anyone.
>
> That means that all the logic for checking valid_mask needs to be added
> to the chip driver's .get_direction() function.  We can add that logic
> to msm_gpio_get_direction (at one point, I had a patch that did that,
> but it was rejected).

Nah, what is in patch v2 is better, just checking it when we need to.

> My concern is: what if a driver depends on a .request call being made
> (in order to configure muxes, for example) before touching the hardware?

Hm. That is a good question.

I wonder if we have that problem in practice. If this happens, maybe the
driver needs to keep track of stuff a bit. I think if we just loop request
over everything we could disturb other mux set-up.

> I wonder if this is something that really should be handled in the
> driver's .probe function.  The driver should collect that information
> and pass it to add_data.

I see the idea, but it seems complicated compared to just calling
the callbacks. Let's try the v2 patch approach first.

Yours,
Linus Walleij

      reply	other threads:[~2018-09-21 16:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-14  7:08 [RFC] gpiolib: Fix gpio_direction_* for single direction GPIOs Ricardo Ribalda Delgado
2018-09-14  7:08 ` [PATCH] gpiolib: Show correct direction from the beginning Ricardo Ribalda Delgado
2018-09-18 22:40   ` Linus Walleij
2018-09-19  4:04     ` Ricardo Ribalda Delgado
2018-09-19 11:50       ` Timur Tabi
2018-09-19 15:27         ` Ricardo Ribalda Delgado
2018-09-20 12:20           ` Timur Tabi
2018-09-20 14:14             ` Ricardo Ribalda Delgado
2018-09-20 22:43               ` Linus Walleij
2018-09-20 12:25           ` Timur Tabi
2018-09-20  5:23         ` Linus Walleij
2018-09-20 12:35           ` Timur Tabi
2018-09-20 22:36             ` Linus Walleij
2018-09-21  2:05               ` Timur Tabi
2018-09-21 16:07                 ` Linus Walleij [this message]

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='CACRpkdYV+A9rUZvYN_Vh3wD6Vb73qj8=SkHJCJ0ZiTWP5Ojw1A@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ricardo.ribalda@gmail.com \
    --cc=swboyd@chromium.org \
    --cc=timur@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).