Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: misha.zavertkin@mail.ru
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, robh@kernel.org
Subject: Re: [PATCH v3 2/2] gpio: realtek-otto: add pinctrl support
Date: Thu, 20 Aug 2026 07:39:20 +0000	[thread overview]
Message-ID: <20260820073920.909F71F000E9@smtp.kernel.org> (raw)
In-Reply-To: <adce57b3797cae6f6a3486eb1d21c33be61f14dc.1787209558.git.misha.zavertkin@mail.ru>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

New issues:
- [Critical] Unconditionally enabling GPIO_GENERIC_PINCTRL_BACKEND breaks GPIO direction configuration on SoCs that do not yet have a pinctrl driver.

Pre-existing issues:
- [High] Silent failure when optional IRQ probe defers.
--

--- Patch [2]: [PATCH v3 2/2] gpio: realtek-otto: add pinctrl support ---
commit c33b7f5187bd7fe916fbf0c1df13da9be88e7f72
Author: misha.zavertkin@mail.ru <misha.zavertkin@mail.ru>

gpio: realtek-otto: add pinctrl support

This patch adds pinctrl backend support to the Realtek Otto GPIO driver.
It utilizes pinctrl to request pins for GPIO on the RTL9607C SoC.

> 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: Critical]
Does setting GPIO_GENERIC_PINCTRL_BACKEND unconditionally break GPIO
direction configuration on SoCs lacking a pinctrl driver?

Because pinctrl drivers for other SoCs are not yet implemented, setting
this flag forces gpio_mmio_dir_in() and gpio_mmio_dir_out() to route via
pinctrl_gpio_direction_*(). Since no pinctrl driver is registered for those
devices, won't this fail with -EPROBE_DEFER and completely break GPIO
output/input functionality?

>  	if (dev_flags & GPIO_PORTS_REVERSED) {
> -		gen_gc_flags = 0;

[ ... ]

[Severity: High]
This is a pre-existing issue, but does the optional irq check silently
discard probe deferrals?

drivers/gpio/gpio-realtek-otto.c:realtek_gpio_probe() {
	...
	irq = platform_get_irq_optional(pdev, 0);
	if (!(dev_flags & GPIO_INTERRUPTS_DISABLED) && irq > 0) {
		girq = &ctrl->chip.gc.irq;
	...
}

When platform_get_irq_optional() returns -EPROBE_DEFER because the parent
interrupt controller is not yet ready, the irq > 0 check silently discards
the error code. This can lead to the device permanently losing GPIO
interrupt support depending on boot timing.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1787209558.git.misha.zavertkin@mail.ru?part=2

  reply	other threads:[~2026-08-20  7:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-20  7:14 [PATCH v3 0/2] gpio: realtek-otto: add pinctrl support misha.zavertkin
2026-08-20  7:14 ` [PATCH v3 1/2] dt-bindings: gpio: otto-gpio: Add gpio-ranges misha.zavertkin
2026-08-20  7:14 ` [PATCH v3 2/2] gpio: realtek-otto: add pinctrl support misha.zavertkin
2026-08-20  7:39   ` sashiko-bot [this message]
2026-08-20 17:12     ` Linus Walleij

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=20260820073920.909F71F000E9@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