Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Mikhail Kshevetskiy" <mikhail.kshevetskiy@iopsys.eu>
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, robh@kernel.org
Subject: Re: [PATCH v6 17/17] pinctrl: airoha: add support of an7563 SoC
Date: Sun, 28 Jun 2026 14:55:36 +0000	[thread overview]
Message-ID: <20260628145536.EFD5E1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260628143733.273651-18-mikhail.kshevetskiy@iopsys.eu>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The `hsuart_cts_rts` pin group introduces a pin claiming gap and an order-dependent hardware routing bug that can silently disable UART CTS/RTS.
- [Low] The `i2c` and `spi` pin groups are defined and registered but are completely unreachable, resulting in dead code.
--

commit 80f4c6428d6088ebf03f569dea1ce788b34979a5
Author: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>

pinctrl: airoha: add support of an7563 SoC

This patch adds support of Airoha an7563 SoC pin controller.
Also it adds corresponding device tree binding schema.

> diff --git a/drivers/pinctrl/airoha/pinctrl-an7563.c b/drivers/pinctrl/airoha/pinctrl-an7563.c
> index 0000000000000..40cbbe90cc464 100644
> --- /dev/null
> +++ b/drivers/pinctrl/airoha/pinctrl-an7563.c
> @@ -0,0 +1,1115 @@
[ ... ]
> +static const int hsuart_cts_rts_pins[] = { 14, 15 };
> +static const int i2c_pins[] = { 30, 31 };
> +static const int jtag_udi_pins[] = { 7, 8, 9, 10, 11 };
> +static const int jtag_dfd_pins[] = { 7, 8, 9, 10, 11 };
> +static const int pcm1_pins[] = { 22, 23, 24, 25 };
> +static const int pcm2_pins[] = { 1, 2, 3, 4 };
> +static const int spi_pins[] = { 32, 33, 34, 35 };

[Severity: Medium]
Are pins 16 and 17 missing from hsuart_cts_rts_pins[]?

The hsuart_cts_rts function (defined later in uart_func_group) configures the
hardware routing for all 4 UART pins, but this array only claims pins 14
and 15.

Could this leave pins 16 and 17 vulnerable to being concurrently claimed as
GPIOs while still being forcefully routed to UART in hardware?

[Severity: Low]
Are the i2c_pins and spi_pins groups actually reachable?

These groups are defined in pinctrl_groups but do not appear to be included in
any function's group array (such as i2c_groups or spi_groups). This means they
cannot be selected via a function mux.

Additionally, the device tree schema strictly forbids the use of the 'groups'
property in 'conf' nodes, preventing direct configuration. This seems to leave
them as unused dead code.

[ ... ]
> +static const struct airoha_pinctrl_func_group uart_func_group[] = {
> +	{
> +		.name = "hsuart",
> +		.regmap[0] = {
> +			AIROHA_FUNC_MUX,
> +			REG_GPIO_PON_MODE,
> +			GPIO_HSUART_MODE_MASK | GPIO_HSUART_CTS_RTS_MODE_MASK,
> +			GPIO_HSUART_MODE_MASK
> +		},
> +		.regmap_size = 1,
> +	},
> +	{
> +		.name = "hsuart_cts_rts",
> +		.regmap[0] = {
> +			AIROHA_FUNC_MUX,
> +			REG_GPIO_PON_MODE,
> +			GPIO_HSUART_MODE_MASK | GPIO_HSUART_CTS_RTS_MODE_MASK,
> +			GPIO_HSUART_MODE_MASK | GPIO_HSUART_CTS_RTS_MODE_MASK
> +		},
> +		.regmap_size = 1,
> +	},
> +};

[Severity: Medium]
Could the hsuart function unintentionally disable CTS/RTS hardware routing?

If a device tree requests both "hsuart" and "hsuart_cts_rts" (as shown in the
dt-binding example) but they are applied such that hsuart goes last, it will
actively clear the CTS/RTS bit set by hsuart_cts_rts.

This happens because the hsuart mask explicitly includes
GPIO_HSUART_CTS_RTS_MODE_MASK but the value only sets GPIO_HSUART_MODE_MASK.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260628143733.273651-1-mikhail.kshevetskiy@iopsys.eu?part=17

  reply	other threads:[~2026-06-28 14:55 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-28 14:37 [PATCH v6 00/17] pinctrl: airoha: split on shared and SoC drivers, add more SoCs Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 01/17] dt-bindings: pinctrl: airoha: update/fix device tree binding schemas Mikhail Kshevetskiy
2026-06-28 19:15   ` Conor Dooley
2026-06-28 14:37 ` [PATCH v6 02/17] pinctrl: airoha: an7581: fix misprint in bitfield name Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 03/17] pinctrl: airoha: an7583: fix I2C0_SDA_PD register bit order Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 04/17] pinctrl: airoha: an7583: there is no mux to enable the second i2c bus Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 05/17] pinctrl: airoha: an7581: fix mux/conf of pcie_reset pins Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 06/17] pinctrl: airoha: an7583: fix muxing of non-gpio default pins Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 07/17] pinctrl: airoha: move common definitions to the separate header Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 08/17] pinctrl: airoha: split driver on shared code and SoC specific drivers Mikhail Kshevetskiy
2026-06-28 14:57   ` sashiko-bot
2026-06-28 14:37 ` [PATCH v6 09/17] pinctrl: airoha: an7581: remove en7581 prefix from variable names Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 10/17] pinctrl: airoha: an7583: remove an7583 prefix from variable names and definitions Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 11/17] pinctrl: airoha: an7583: rename registers to match its an7583 names Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 12/17] pinctrl: airoha: an7583: add support for npu_uart pinmux Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 13/17] pinctrl: airoha: an7583: add support for pon_alt pinmux Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 14/17] pinctrl: airoha: an7583: add support for olt pinmux Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 15/17] pinctrl: airoha: add support of en7523 SoC Mikhail Kshevetskiy
2026-06-28 14:57   ` sashiko-bot
2026-06-28 20:51   ` Rob Herring (Arm)
2026-06-28 14:37 ` [PATCH v6 16/17] pinctrl: airoha: try to find chip scu node by phandle first Mikhail Kshevetskiy
2026-06-28 14:54   ` sashiko-bot
2026-06-28 14:37 ` [PATCH v6 17/17] pinctrl: airoha: add support of an7563 SoC Mikhail Kshevetskiy
2026-06-28 14:55   ` sashiko-bot [this message]
2026-06-28 20:51   ` Rob Herring (Arm)

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=20260628145536.EFD5E1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=mikhail.kshevetskiy@iopsys.eu \
    --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