Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Andrey Derkach" <gabin278@gmail.com>
Cc: linux-gpio@vger.kernel.org
Subject: Re: [PATCH v2] pinctrl: qcom: lpass-lpi: Don't touch reserved pins
Date: Sat, 05 Dec 2026 14:19:14 +0000	[thread overview]
Message-ID: <sashiko-outbox-251619@kernel.org> (raw)
In-Reply-To: <20261205140200.1120850-1-gabin278@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] pinctrl: qcom: lpass-lpi: missing Fixes trailer on bug-fix
  commit
--

commit c0ed20312d35bb1df93f12cd27f62883c1dcc84d
Author: Andrey Derkach <gabin278@gmail.com>

> pinctrl: qcom: lpass-lpi: Don't touch reserved pins
>
> Since commit a22d2598a563 ("dt-bindings: qcom: lpass-lpi-common: add
> reserved GPIOs property") an LPI pin controller can have
> gpio-reserved-ranges. On SDM670 phones such as the Pixel 3a these are
> the sensor pins, which the firmware protects: reading their registers
> hangs the bus and freezes the SoC. gpiolib leaves reserved lines alone,
> but the LPI driver still reads them from the GPIO debugfs dump and from
> the pinconf-groups debugfs file, and pinmux does not refuse to mux
> them.
>
> Do what pinctrl-msm does since commit 691bf5d5a7bf ("pinctrl: qcom:
> Don't allow protected pins to be requested") and
> commit 27030ff78772 ("pinctrl: qcom: fail to retrieve configuration
> from invalid pin groups"): refuse pinmux requests for reserved pins,
> fail pinconf reads of them and leave them out of the GPIO debugfs dump.
>
> Unlike pinctrl-msm, keep the reserved pins in a bitmap of the driver's
> own, filled from gpio-reserved-ranges before the pin controller is
> registered. The pin controller is registered before the GPIO chip is
> added and unregistered after it is removed. Before the GPIO chip is
> added, gpiochip_line_is_valid() treats every pin as valid, and after it
> is removed it uses the freed GPIO device.
>
> Tested on the Xiaomi Mi 9 SE (SDM712), which reserves <0 18>, <26 6>:
> without this change reading /sys/kernel/debug/gpio freezes the SoC;
> with it the dump lists only GPIOs 18-25, and pinconf-groups shows the
> reserved groups without configs.
>
> Signed-off-by: Andrey Derkach <gabin278@gmail.com>

[Severity: Low]
This fixes a bus hang when accessing firmware-protected LPASS LPI pins.
Should this include a Fixes tag for the commit that introduced the driver?

  Fixes: 6e261d1090d6 ("pinctrl: qcom: Add sm8250 lpass lpi pinctrl driver")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261205140200.1120850-1-gabin278@gmail.com?part=1

      reply	other threads:[~2026-12-05 14:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-05 14:02 [PATCH v2] pinctrl: qcom: lpass-lpi: Don't touch reserved pins Andrey Derkach
2026-12-05 14:19 ` sashiko-bot [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=sashiko-outbox-251619@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=gabin278@gmail.com \
    --cc=linux-gpio@vger.kernel.org \
    --cc=sashiko-reviews@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox