Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Chen-Yu Tsai" <wens@kernel.org>
Cc: linux-sunxi@lists.linux.dev, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 5/9] arm64: dts: allwinner: h6: orangepi: Move LED pinctrl to common dtsi
Date: Fri, 04 Dec 2026 17:26:34 +0000	[thread overview]
Message-ID: <sashiko-outbox-250311@kernel.org> (raw)
In-Reply-To: <20261204171319.745792-6-wens@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] arm64: dts: allwinner: LED pinctrl conflicts with strict
  r_pio pinmux mode
--

commit e782921751eec9fe8545aae8ed5aadf0e48f0137
Author: Chen-Yu Tsai <wens@kernel.org>

arm64: dts: allwinner: h6: orangepi: Move LED pinctrl to common dtsi

This commit moves the per-LED pinctrl states and r_pio pin nodes for the
power and status LEDs from sun50i-h6-orangepi-3-lts.dts into the shared
sun50i-h6-orangepi.dtsi.

> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi
> index f1ce38fb3e044..fbf881ccaadc0 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi
> @@ -46,12 +46,16 @@ leds {
>  
>  		led-0 {
>  			label = "orangepi:red:power";
> +			pinctrl-names = "default";
> +			pinctrl-0 = <&led_red_pin>;
>  			gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
>  			default-state = "on";
>  		};
>  
>  		led-1 {
>  			label = "orangepi:green:status";
> +			pinctrl-names = "default";
> +			pinctrl-0 = <&led_green_pin>;
>  			gpios = <&r_pio 0 7 GPIO_ACTIVE_HIGH>; /* PL7 */
>  		};
>  	};
> @@ -244,6 +248,18 @@ &r_ir {
>  
>  &r_pio {
>  	vcc-pm-supply = <&reg_bldo3>;
> +
> +	led_green_pin: led-green-pin {
> +		pins = "PL7";
> +		function = "gpio_out";
> +		drive-strength = <10>;
> +	};
> +
> +	led_red_pin: led-red-pin {
> +		pins = "PL4";
> +		function = "gpio_out";
> +		drive-strength = <10>;
> +	};
>  };
>  
>  &rtc {

[Severity: Medium]
Does combining gpios with per-LED pinctrl-0 (function = "gpio_out") on
PL4 and PL7 conflict with r_pio's strict pinmux mode?

Allwinner H6 r_pio leaves disable_strict_mode unset, so sunxi_pmx_ops
runs with strict = true and no function_is_gpio callback, while
sunxi_pctrl_dt_node_to_map() always emits a mux setting for each
pinctrl node.

During gpio_led_probe(), gpio_leds_create() requests PL4 and PL7 as
GPIOs via devm_fwnode_gpiod_get(), setting desc->gpio_owner.
create_gpio_led() then calls devm_pinctrl_get_select_default() ->
pinmux_enable_setting() -> pin_request() on the same pins.

On Linux 6.5 through 6.17 (including 6.6 and 6.12 LTS), before commit
11aa02d6a9c2 ("pinctrl: allow to mark pin functions as requestable
GPIOs"), pin_request() rejects this with -EINVAL and aborts
gpio_led_probe(), leaving both LEDs broken on One Plus, Lite 2, and 3.

On current mainline, probe only succeeds because that commit sets
gpio_ok = true when desc->mux_setting is NULL, accidentally bypassing
strict-mode rejection during pinmux_enable_setting().

If that bypass is fixed or pinctrl is applied before GPIO acquisition,
gpio_led_probe() will fail with -EINVAL on all four boards unless
pinctrl-sunxi.c implements pinmux_ops.function_is_gpio for gpio_in and
gpio_out.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204171319.745792-1-wens@kernel.org?part=5

  reply	other threads:[~2026-12-04 17:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 17:12 [PATCH 0/9] arm64: dts: allwinner: h6: orangepi: Common dtsi cleanups Chen-Yu Tsai
2026-12-04 17:12 ` [PATCH 1/9] arm64: dts: allwinner: h6: orangepi-3: Use common sun50i-h6-orangepi.dtsi Chen-Yu Tsai
2026-12-04 17:12 ` [PATCH 2/9] arm64: dts: allwinner: h6: orangepi: Move CLDO2/CLDO3 to Lite 2 Chen-Yu Tsai
2026-12-04 17:12 ` [PATCH 3/9] arm64: dts: allwinner: h6: orangepi: Fix VCC-PG supply in common dtsi Chen-Yu Tsai
2026-12-04 17:20   ` sashiko-bot
2026-12-04 17:12 ` [PATCH 4/9] arm64: dts: allwinner: h6: orangepi: Move HDMI hvcc-supply to " Chen-Yu Tsai
2026-12-04 17:12 ` [PATCH 5/9] arm64: dts: allwinner: h6: orangepi: Move LED pinctrl " Chen-Yu Tsai
2026-12-04 17:26   ` sashiko-bot [this message]
2026-12-04 17:12 ` [PATCH 6/9] arm64: dts: allwinner: h6: orangepi: Add cpu-supply to all CPU cores Chen-Yu Tsai
2026-12-04 17:12 ` [PATCH 7/9] arm64: dts: allwinner: h6: orangepi: Drop unused usb0_id_det-gpios Chen-Yu Tsai
2026-12-04 17:12 ` [PATCH 8/9] arm64: dts: allwinner: h6: orangepi: Drop board model and compatible from dtsi Chen-Yu Tsai
2026-12-04 17:12 ` [PATCH 9/9] arm64: dts: allwinner: h6: orangepi: Move ALDO3 to Orange Pi 3 and 3 LTS Chen-Yu Tsai

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-250311@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=wens@kernel.org \
    /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