From: sashiko-bot@kernel.org
To: "Michael Zavertkin" <misha.zavertkin@mail.ru>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v4 2/2] gpio: realtek-otto: add pinctrl support
Date: Thu, 27 Aug 2026 14:54:48 +0000 [thread overview]
Message-ID: <20260827145449.250BF1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <adce57b3797cae6f6a3486eb1d21c33be61f14dc.1787830440.git.misha.zavertkin@mail.ru>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Unconditional use of GPIO_GENERIC_PINCTRL_BACKEND breaks GPIO requests and direction configuration on SoCs without a pinctrl driver.
--
commit e286232a1c082edc58e67d8d4c62156ff41a0294
Author: Michael Zavertkin <misha.zavertkin@mail.ru>
gpio: realtek-otto: add pinctrl support
This commit adds pinctrl backend support to the realtek-otto GPIO driver
so that RTL9607C can use pinctrl to request pins.
> diff --git a/drivers/gpio/gpio-realtek-otto.c b/drivers/gpio/gpio-realtek-otto.c
> index 37ef56f453187..b53c2a9a04c76 100644
> --- a/drivers/gpio/gpio-realtek-otto.c
> +++ b/drivers/gpio/gpio-realtek-otto.c
> @@ -394,13 +394,14 @@ static int realtek_gpio_probe(struct platform_device *pdev)
>
> raw_spin_lock_init(&ctrl->lock);
>
> + gen_gc_flags = GPIO_GENERIC_PINCTRL_BACKEND;
> +
[Severity: High]
Does unconditionally setting GPIO_GENERIC_PINCTRL_BACKEND break GPIO
functionality for SoCs that lack a pinctrl driver?
When a GPIO is requested or its direction is set on an SoC without a pinctrl
driver, gpio_generic_chip_init() routes the calls to pinctrl_gpio_request() and
pinctrl_gpio_direction().
Because pinctrl_gpio_direction() calls pinctrl_get_device_gpio_range(), it will
return -EPROBE_DEFER when no pinctrl device overlaps with the GPIO chip. This
would cause all GPIO requests and direction configurations to fail indefinitely,
rendering GPIO unusable and breaking dependent devices on hardware like RTL8380
or RTL9300, which the commit message acknowledges might have pinctrl drivers
implemented later.
Should this backend flag only be set conditionally, perhaps by checking for
gpio-ranges in the device tree?
> if (dev_flags & GPIO_PORTS_REVERSED) {
> - gen_gc_flags = 0;
> ctrl->bank_read = realtek_gpio_bank_read;
> ctrl->bank_write = realtek_gpio_bank_write;
> ctrl->line_imr_pos = realtek_gpio_line_imr_pos;
> } else {
> - gen_gc_flags = GPIO_GENERIC_BIG_ENDIAN_BYTE_ORDER;
> + gen_gc_flags |= GPIO_GENERIC_BIG_ENDIAN_BYTE_ORDER;
> ctrl->bank_read = realtek_gpio_bank_read_swapped;
> ctrl->bank_write = realtek_gpio_bank_write_swapped;
> ctrl->line_imr_pos = realtek_gpio_line_imr_pos_swapped;
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1787830440.git.misha.zavertkin@mail.ru?part=2
prev parent reply other threads:[~2026-08-27 14:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-27 14:29 [PATCH v4 0/2] gpio: realtek-otto: add pinctrl support Michael Zavertkin
2026-08-27 14:29 ` [PATCH v4 1/2] dt-bindings: gpio: otto-gpio: Add gpio-ranges Michael Zavertkin
2026-08-27 14:29 ` [PATCH v4 2/2] gpio: realtek-otto: add pinctrl support Michael Zavertkin
2026-08-27 14:54 ` 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=20260827145449.250BF1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=misha.zavertkin@mail.ru \
--cc=robh@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