[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMRc=MfcyAxF6Q4XyCiJs-7jCDX5dyT5=1HPmcDGQGiJoXf5Sw@mail.gmail.com>
Date: Fri, 28 Feb 2025 11:47:13 +0100
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Linus Walleij <linus.walleij@...aro.org>
Cc: Mark Brown <broonie@...nel.org>, Florian Fainelli <florian.fainelli@...adcom.com>,
Ray Jui <rjui@...adcom.com>, Scott Branden <sbranden@...adcom.com>,
Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>, Stefan Wahren <wahrenst@....net>,
Liao Chen <liaochen4@...wei.com>, Chen-Yu Tsai <wens@...e.org>,
Marek Szyprowski <m.szyprowski@...sung.com>, linux-gpio@...r.kernel.org,
linux-rpi-kernel@...ts.infradead.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [RFC/RFT PATCH] pinctrl: bcm2835: don't -EINVAL on alternate
funcs from get_direction()
On Thu, Feb 27, 2025 at 11:53 PM Linus Walleij <linus.walleij@...aro.org> wrote:
>
> On Wed, Feb 19, 2025 at 3:30 PM Bartosz Golaszewski <brgl@...ev.pl> wrote:
> > On Wed, Feb 19, 2025 at 3:27 PM Mark Brown <broonie@...nel.org> wrote:
> > >
> > > On Wed, Feb 19, 2025 at 11:27:50AM +0100, Bartosz Golaszewski wrote:
> > > > From: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
> > > >
> > > > Since commit 9d846b1aebbe ("gpiolib: check the return value of
> > > > gpio_chip::get_direction()") we check the return value of the
> > > > get_direction() callback as per its API contract. This driver returns
> > > > -EINVAL if the pin in question is set to one of the alternative
> > > > (non-GPIO) functions. This isn't really an error that should be
> > > > communicated to GPIOLIB so default to returning the "safe" value of
> > > > INPUT in this case. The GPIO subsystem does not have the notion of
> > > > "unknown" direction.
> > >
> > > I see this was already tested for these specific boards. I've also
> > > found that Avenger96 is failing with bisect pointing to the same commit
> > > this is fixing:
> > >
> > > https://lava.sirena.org.uk/scheduler/job/1126314
> > >
> > > as is the Libretech Potato:
> > >
> > > https://lava.sirena.org.uk/scheduler/job/1126285
> > >
> > > neither of which produce any output before dying, they'll not be fixed
> > > by this change. Seems like an audit of the drivers might be in order?
> >
> > Right. I don't know if they return EINVAL or some other error so let
> > me prepare a change that will not bail-out but simply warn on
> > get_direction() errors in gpiochip_add_data() instead.
> >
> > This patch can still go upstream IMO.
>
> I'm fine to apply it, maybe as non-urgent fix at this point? (for -next)
>
Yes, the offending changes in gpiolib.c were dropped so this can go in
the non-urgent way.
> Do you want to send a non-RFC/RFT version or should I just apply it?
>
You can take it as is. It got tested and reviewed, so the tags served
their purpose. :)
Bart
Powered by blists - more mailing lists