Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Zhengping Zhang" <zhengping.zhang@airoha.com>
Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 05/12] pinctrl: airoha: an7581: select force GPIO mode on GPIO requests
Date: Tue, 10 Nov 2026 10:00:38 +0000	[thread overview]
Message-ID: <sashiko-outbox-206823@kernel.org> (raw)
In-Reply-To: <20261110094339.749110-6-zhengping.zhang@airoha.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] pinctrl: airoha: an7581: mux conflict between hsuart and
  hsuart_cts_rts
--

commit b98ded648dd882fe63d659f1c2bdcde0ac118345
Author: Zhengping Zhang <zhengping.zhang@airoha.com>

pinctrl: airoha: an7581: select force GPIO mode on GPIO requests

This commit extends the AN7581 pinctrl driver to support GPIO mux groups for
GPIO0-49 using per-pad force GPIO overrides, clears force GPIO bits when
selecting peripheral functions, and enables shared mux conflict checks.

> diff --git a/drivers/pinctrl/airoha/pinctrl-an7581.c b/drivers/pinctrl/airoha/pinctrl-an7581.c
> index 3cbdfc31e97e5..b266cc8bc65f4 100644
> --- a/drivers/pinctrl/airoha/pinctrl-an7581.c
> +++ b/drivers/pinctrl/airoha/pinctrl-an7581.c

[ ... ]

> @@ -721,7 +792,14 @@ static const struct airoha_pinctrl_func_group uart_func_group[] = {
>  			GPIO_HSUART_MODE_MASK | GPIO_HSUART_CTS_RTS_MODE_MASK,
>  			GPIO_HSUART_MODE_MASK
>  		},
> -		.regmap_size = 1,
> +		.regmap[1] = {
> +			AIROHA_FUNC_MUX,
> +			REG_FORCE_GPIO_EN,
> +			BIT(15) |
> +			BIT(16),
> +			0
> +		},
> +		.regmap_size = 2,
>  	},
>  	{
>  		.name = "hsuart_cts_rts",
> @@ -731,7 +809,14 @@ static const struct airoha_pinctrl_func_group uart_func_group[] = {
>  			GPIO_HSUART_MODE_MASK | GPIO_HSUART_CTS_RTS_MODE_MASK,
>  			GPIO_HSUART_MODE_MASK | GPIO_HSUART_CTS_RTS_MODE_MASK
>  		},
> -		.regmap_size = 1,
> +		.regmap[1] = {
> +			AIROHA_FUNC_MUX,
> +			REG_FORCE_GPIO_EN,
> +			BIT(13) |
> +			BIT(14),
> +			0
> +		},
> +		.regmap_size = 2,
>  	}, {

[ ... ]

> @@ -1432,6 +1834,7 @@ static const struct airoha_pinctrl_conf pinctrl_pcie_rst_od_conf[] = {
>  };
>  
>  static const struct airoha_pinctrl_match_data pinctrl_match_data = {
> +	.check_mux_conflicts = true,
>  	.chip_scu_compatible = "airoha,en7581-chip-scu",
>  	.pinctrl_name = KBUILD_MODNAME,
>  	.pinctrl_owner = THIS_MODULE,

[Severity: Medium]
Does enabling check_mux_conflicts prevent hsuart and hsuart_cts_rts from
being selected together?

hsuart_pins covers only the TX/RX pins (gpio15, gpio16) and clears
BIT(15) | BIT(16) in REG_FORCE_GPIO_EN, while hsuart_cts_rts_pins covers
only the CTS/RTS pins (gpio13, gpio14) and clears BIT(13) | BIT(14).
Configuring 4-wire HSUART with flow control therefore requires selecting
both groups, just like uart2 and uart2_cts_rts.

However, unlike uart2 (whose mask in REG_GPIO_PON_MODE is only
GPIO_UART2_MODE_MASK), hsuart includes GPIO_HSUART_CTS_RTS_MODE_MASK in
its mask with val = GPIO_HSUART_MODE_MASK, requiring the CTS/RTS bit to be
0, while hsuart_cts_rts requires that bit to be 1.  With
check_mux_conflicts enabled, airoha_pinmux_set_mux() ->
airoha_pinmux_check_conflicts() rejects selecting both groups with -EBUSY,
and selecting hsuart_cts_rts alone leaves the TX/RX pins unclaimed and
their force-GPIO bits uncleared.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261110094339.749110-1-zhengping.zhang@airoha.com?part=5

  reply	other threads:[~2026-11-10 10:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10  9:43 [PATCH 00/12] pinctrl: airoha: configure GPIO muxes explicitly and fix pad mappings Zhengping Zhang
2026-11-10  9:43 ` [PATCH 01/12] pinctrl: airoha: fix setting of GPIO direction Zhengping Zhang
2026-11-10  9:53   ` sashiko-bot
2026-11-10  9:43 ` [PATCH 02/12] pinctrl: airoha: configure pin muxes on GPIO requests Zhengping Zhang
2026-11-10 10:14   ` sashiko-bot
2026-11-10  9:43 ` [PATCH 03/12] dt-bindings: pinctrl: airoha: describe all EN7581 GPIO mux groups Zhengping Zhang
2026-11-10  9:43 ` [PATCH 04/12] pinctrl: airoha: an7581: fix PHY LED GPIO group assignments Zhengping Zhang
2026-11-10  9:43 ` [PATCH 05/12] pinctrl: airoha: an7581: select force GPIO mode on GPIO requests Zhengping Zhang
2026-11-10 10:00   ` sashiko-bot [this message]
2026-11-10  9:43 ` [PATCH 06/12] dt-bindings: pinctrl: airoha: describe all AN7583 GPIO mux groups Zhengping Zhang
2026-11-10  9:43 ` [PATCH 07/12] pinctrl: airoha: an7583: fix SPI pin mux config Zhengping Zhang
2026-11-10  9:43 ` [PATCH 08/12] pinctrl: airoha: an7583: fix eMMC " Zhengping Zhang
2026-11-10  9:43 ` [PATCH 09/12] pinctrl: airoha: an7583: use force GPIO mode for GPIO requests Zhengping Zhang
2026-11-10  9:56   ` sashiko-bot
2026-11-10  9:43 ` [PATCH 10/12] dt-bindings: pinctrl: airoha: describe all EN7523 GPIO mux groups Zhengping Zhang
2026-11-10  9:43 ` [PATCH 11/12] pinctrl: airoha: en7523: use force GPIO mode for GPIO requests Zhengping Zhang
2026-11-10  9:43 ` [PATCH 12/12] MAINTAINERS: add myself as Airoha pinctrl co-maintainer Zhengping Zhang

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-206823@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=zhengping.zhang@airoha.com \
    /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