All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	brgl@bgdev.pl, Paul Menzel <pmenzel@molgen.mpg.de>,
	linux-gpio@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	linux-pci@vger.kernel.org, regressions@lists.linux.dev
Subject: Re: Linux logs new warning `gpio gpiochip0: gpiochip_add_data_with_key: get_direction failed: -22`
Date: Wed, 26 Feb 2025 16:22:06 +0200	[thread overview]
Message-ID: <Z78jjr8LMa165CZP@smile.fi.intel.com> (raw)
In-Reply-To: <CACMJSevxA8pC2NTQq3jcKCog+o02Y07gVgQydo19YjC9+5Gs6Q@mail.gmail.com>

On Wed, Feb 26, 2025 at 03:14:24PM +0100, Bartosz Golaszewski wrote:
> On Wed, 26 Feb 2025 at 14:47, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > On Wed, Feb 26, 2025 at 03:37:47PM +0200, Andy Shevchenko wrote:
> > > On Tue, Feb 25, 2025 at 10:25:00PM +0100, Linus Walleij wrote:
> > > > On Mon, Feb 24, 2025 at 9:51 AM <brgl@bgdev.pl> wrote:
> > > >
> > > > > In any case: Linus: what should be our policy here? There are some pinctrl
> > > > > drivers which return EINVAL if the pin in question is not in GPIO mode. I don't
> > > > > think this is an error. Returning errors should be reserved for read failures
> > > > > and so on. Are you fine with changing the logic here to explicitly default to
> > > > > INPUT as until recently all errors would be interpreted as such anyway?
> > > >
> > > > Oh hm I guess. There was no defined semantic until now anyway. Maybe
> > > > Andy has something to say about it though, it's very much his pin controller.
> > >
> > > Driver is doing correct things. If you want to be pedantic, we need to return
> > > all possible pin states (which are currently absent from GPIO get_direction()
> > > perspective) and even though it's not possible to tell from the pin muxer
> > > p.o.v. If function is I2C, it's open-drain, if some other, it may be completely
> > > different, but pin muxer might only guesstimate the state of the particular
> > > function is and I do not think guesstimation is a right approach.
> > >
> > > We may use the specific error code, though. and document that semantics.
> >
> > Brief looking at the error descriptions and the practical use the best (and
> > unique enough) choice may be EBADSLT.
> 
> In any case, I proposed to revert to the previous behavior in
> gpiochip_add_data() in my follow-up series so the issue should soon go
> away.

Yes, I noted. The above is a material to discuss. We can make that semantics
documented and strict and then one may filter out those errors if/when
required.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2025-02-26 14:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-21 20:40 Linux logs new warning `gpio gpiochip0: gpiochip_add_data_with_key: get_direction failed: -22` Paul Menzel
2025-02-21 20:53 ` Bartosz Golaszewski
2025-02-21 21:02   ` Paul Menzel
2025-02-23 20:54     ` Bartosz Golaszewski
2025-02-23 22:04       ` Paul Menzel
2025-02-24  8:51         ` brgl
2025-02-25 20:43           ` Paul Menzel
2025-02-25 21:25           ` Linus Walleij
2025-02-26 13:37             ` Andy Shevchenko
2025-02-26 13:46               ` Andy Shevchenko
2025-02-26 14:14                 ` Bartosz Golaszewski
2025-02-26 14:22                   ` Andy Shevchenko [this message]
2025-03-14 11:54                     ` Paul Menzel
2025-03-14 12:19                       ` Bartosz Golaszewski
2025-03-14 12:25                         ` Paul Menzel

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=Z78jjr8LMa165CZP@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=brgl@bgdev.pl \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=pmenzel@molgen.mpg.de \
    --cc=regressions@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.