lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z78bUPN7kdSnbIjW@black.fi.intel.com>
Date: Wed, 26 Feb 2025 15:46:56 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Linus Walleij <linus.walleij@...aro.org>
Cc: brgl@...ev.pl, Paul Menzel <pmenzel@...gen.mpg.de>,
	Bartosz Golaszewski <bartosz.golaszewski@...aro.org>,
	linux-gpio@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
	linux-pci@...r.kernel.org, regressions@...ts.linux.dev
Subject: Re: Linux logs new warning `gpio gpiochip0:
 gpiochip_add_data_with_key: get_direction failed: -22`

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

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ