Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Simon Glass" <sjg@chromium.org>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 04/12] pinctrl: rockchip: Add RV1106 pinctrl support
Date: Mon, 06 Jul 2026 20:14:05 +0000	[thread overview]
Message-ID: <20260706201405.E72031F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260706195818.3906949-5-sjg@chromium.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The `rv1106_pin_banks` array defines `gpio0` and `gpio2` with 32 pins, which exceeds actual hardware capacity and causes overlapping/aliased register accesses.
--

commit fbf0d23655e7fe240a1a8b92b59254646172a530
Author: Simon Glass <sjg@chromium.org>

pinctrl: rockchip: Add RV1106 pinctrl support

This commit adds pinctrl support for the Rockchip RV1106 SoC, ported from
the vendor kernel. It defines the pin controller banks and offsets for
drive, pull, and schmitt registers, and adds matching compatible strings.

Link: https://github.com/LuckfoxTECH/luckfox-pico

> diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
> index 7e0fcd45fd265..f9cbcb955853c 100644
> --- a/drivers/pinctrl/pinctrl-rockchip.c
> +++ b/drivers/pinctrl/pinctrl-rockchip.c

[ ... ]

> @@ -4623,6 +4787,48 @@ static struct rockchip_pin_ctrl rv1103b_pin_ctrl __maybe_unused = {
>  	.schmitt_calc_reg	= rv1103b_calc_schmitt_reg_and_bit,
>  };
>  
> +static struct rockchip_pin_bank rv1106_pin_banks[] = {
> +	PIN_BANK_IOMUX_FLAGS(0, 32, "gpio0",
> +			     IOMUX_WIDTH_4BIT | IOMUX_SOURCE_PMU,
> +			     IOMUX_WIDTH_4BIT | IOMUX_SOURCE_PMU,
> +			     IOMUX_WIDTH_4BIT | IOMUX_SOURCE_PMU,
> +			     IOMUX_WIDTH_4BIT | IOMUX_SOURCE_PMU),

[Severity: High]
Does setting nr_pins to 32 for gpio0 cause register overlap?

If gpio0 has 32 pins, configuring drive strength for pins >= 20 would require
16 registers (offsets 0x10 to 0x4F, since there are 2 pins per register).

This range directly overlaps with the bank's PULL (0x38) and SMT (0x40)
offsets. If a device tree requests these higher pins, would it silently
overwrite the pull and schmitt configuration registers?

> +	PIN_BANK_IOMUX_FLAGS_OFFSET(1, 32, "gpio1",
> +				    IOMUX_WIDTH_4BIT,
> +				    IOMUX_WIDTH_4BIT,
> +				    IOMUX_WIDTH_4BIT,
> +				    IOMUX_WIDTH_4BIT,
> +				    0, 0x08, 0x10, 0x18),
> +	PIN_BANK_IOMUX_FLAGS_OFFSET(2, 32, "gpio2",
> +				    IOMUX_WIDTH_4BIT,
> +				    IOMUX_WIDTH_4BIT,
> +				    IOMUX_WIDTH_4BIT,
> +				    IOMUX_WIDTH_4BIT,
> +				    0x10020, 0x10028, 0, 0),

[Severity: High]
Could this IOMUX offset configuration cause unintended register aliasing?

The gpio2 bank is defined with 32 pins, but offsets for pins 16-31 are
explicitly set to 0.

If a device tree configures multiplexing for these upper pins, wouldn't it
read an offset of 0x0 and write to regmap_base offset 0, which is the IOMUX
register for gpio1? Could we reduce the pin count for this bank to match
the actual hardware capacity and prevent this?

> +	PIN_BANK_IOMUX_FLAGS_OFFSET(3, 32, "gpio3",
> +				    IOMUX_WIDTH_4BIT,
> +				    IOMUX_WIDTH_4BIT,

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260706195818.3906949-1-sjg@chromium.org?part=4

  reply	other threads:[~2026-07-06 20:14 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-06 19:57 [PATCH 00/12] Add support for the Rockchip RV1106 and RV1103 Simon Glass
2026-07-06 19:57 ` [PATCH 01/12] dt-bindings: clock: rockchip: Add RV1106 CRU support Simon Glass
2026-07-06 19:57 ` [PATCH 02/12] clk: rockchip: Add clock controller for the RV1106 Simon Glass
2026-07-06 20:15   ` sashiko-bot
2026-07-06 19:57 ` [PATCH 03/12] dt-bindings: pinctrl: rockchip: Add RV1106 compatible Simon Glass
2026-07-06 19:58 ` [PATCH 04/12] pinctrl: rockchip: Add RV1106 pinctrl support Simon Glass
2026-07-06 20:14   ` sashiko-bot [this message]
2026-07-06 19:58 ` [PATCH 05/12] dt-bindings: soc: rockchip: grf: Add RV1106 compatibles Simon Glass
2026-07-06 19:58 ` [PATCH 06/12] dt-bindings: serial: snps-dw-apb-uart: Add RV1106 compatible Simon Glass
2026-07-06 20:16   ` sashiko-bot
2026-07-06 19:58 ` [PATCH 07/12] dt-bindings: mmc: rockchip-dw-mshc: " Simon Glass
2026-07-06 19:58 ` [PATCH 08/12] dt-bindings: watchdog: snps,dw-wdt: " Simon Glass
2026-07-06 19:58 ` [PATCH 09/12] dt-bindings: iio: adc: rockchip-saradc: " Simon Glass
2026-07-07  2:09   ` Jonathan Cameron
2026-07-06 19:58 ` [PATCH 10/12] ARM: dts: rockchip: Add support for RV1106 and RV1103 Simon Glass
2026-07-06 20:17   ` sashiko-bot
2026-07-06 19:58 ` [PATCH 11/12] dt-bindings: arm: rockchip: Add Luckfox Pico Mini B Simon Glass
2026-07-06 20:18   ` sashiko-bot
2026-07-06 19:58 ` [PATCH 12/12] ARM: dts: " Simon Glass
2026-07-06 22:54 ` [PATCH 00/12] Add support for the Rockchip RV1106 and RV1103 Fabio Estevam
2026-07-07  7:41   ` Heiko Stübner

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=20260706201405.E72031F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=sjg@chromium.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