From: sashiko-bot@kernel.org
To: "Jonas Karlman" <jonas@kwiboo.se>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 4/8] ARM: dts: rockchip: Add Luckfox Lyra and Lyra Plus boards
Date: Fri, 20 Nov 2026 15:21:17 +0000 [thread overview]
Message-ID: <sashiko-outbox-225452@kernel.org> (raw)
In-Reply-To: <20261119152055.556266-5-jonas@kwiboo.se>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] ARM: dts: rockchip: NULL regmap dereference in pinctrl on
RK3506 banks 0 and 1
- [Medium] ARM: dts: rockchip: missing pinctrl configuration on enabled
fspi node
--
commit 4fbf9c971fb720e3dc9fb2b66cb41a8a5d9471ec
Author: Jonas Karlman <jonas@kwiboo.se>
ARM: dts: rockchip: Add Luckfox Lyra and Lyra Plus boards
This commit adds device trees for the Rockchip RK3506G2-based Luckfox
Lyra and Luckfox Lyra Plus boards.
Link: https://wiki.luckfox.com/Luckfox-Lyra/Luckfox-Lyra
Link: https://wiki.luckfox.com/Luckfox-Lyra/Luckfox-Lyra-Plus
> diff --git a/arch/arm/boot/dts/rockchip/rk3506-luckfox-lyra.dtsi b/arch/arm/boot/dts/rockchip/rk3506-luckfox-lyra.dtsi
> new file mode 100644
> index 0000000000000..d02d3a18b052f
> --- /dev/null
> +++ b/arch/arm/boot/dts/rockchip/rk3506-luckfox-lyra.dtsi
> @@ -0,0 +1,124 @@
[ ... ]
> + leds {
> + compatible = "gpio-leds";
> +
> + led-0 {
> + color = <LED_COLOR_ID_RED>;
> + default-state = "on";
> + function = LED_FUNCTION_HEARTBEAT;
> + gpios = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&led1>;
> + linux,default-trigger = "heartbeat";
> + };
> + };
[Severity: High]
Does probing led-0 (on bank 1) and uart0 (on bank 0) cause a NULL
pointer dereference in the pinctrl driver during boot?
In rk3506.dtsi, gpio0 and gpio1 specify per-bank rockchip,grf phandles
(populating bank->regmap_ioc), while the parent pinctrl node omits
rockchip,pmu and rockchip,ioc1 (leaving info->regmap_pmu and
info->regmap_ioc1 NULL). However, on RK3506 the pinctrl driver ignores
bank->regmap_ioc for banks 0 and 1 and uses info->regmap_pmu and
info->regmap_ioc1 instead:
drivers/pinctrl/pinctrl-rockchip.c:rockchip_set_mux() {
...
if (bank->regmap_ioc)
regmap = bank->regmap_ioc;
...
if (ctrl->type == RK3506) {
if (bank->bank_num == 1)
regmap = info->regmap_ioc1;
else if (bank->bank_num == 4)
return 0;
}
...
}
drivers/pinctrl/pinctrl-rockchip.c:rk3506_calc_pull_reg_and_bit() {
...
switch (bank->bank_num) {
case 0:
*regmap = info->regmap_pmu;
...
case 1:
*regmap = info->regmap_ioc1;
...
}
When led-0 applies &led1 on bank 1 or uart0 applies &uart0_xfer on
bank 0, rockchip_set_mux() and rockchip_set_pull() pass a NULL regmap
to regmap_update_bits().
[ ... ]
> +&fspi {
> + status = "okay";
> +
> + flash@0 {
> + compatible = "spi-nand";
> + reg = <0>;
> + bootph-pre-ram;
> + bootph-some-ram;
> + spi-max-frequency = <80000000>;
> + spi-rx-bus-width = <4>;
> + spi-tx-bus-width = <1>;
> + };
> +};
[Severity: Medium]
Should &fspi configure pinctrl-names and pinctrl-0 here?
Unlike other peripheral nodes in rk3506.dtsi, the base fspi node defines
no default pinctrl properties, and fspi_bus4, fspi_clk, and fspi_csn in
rk3506-pinctrl.dtsi are marked /omit-if-no-ref/. Without referencing
them on &fspi, dtc strips those pinmux nodes from the DTB and the
controller probes without muxing GPIO2_A0..GPIO2_A5 for 4-bit FSPI,
breaking SPI-NAND access whenever prior firmware has not already
configured the pins in 4-bit mode (such as when booting from SDMMC).
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261119152055.556266-1-jonas@kwiboo.se?part=4
next prev parent reply other threads:[~2026-11-20 15:21 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 15:20 [PATCH 0/8] ARM: dts: rockchip: Add Luckfox Lyra boards Jonas Karlman
2026-11-19 15:20 ` [PATCH 1/8] dt-bindings: soc: rockchip: grf: Add RK3506 compatibles Jonas Karlman
2026-11-19 15:20 ` [PATCH 2/8] ARM: dts: rockchip: Add support for RK3506 Jonas Karlman
2026-11-20 15:21 ` sashiko-bot
2026-11-19 15:20 ` [PATCH 3/8] dt-bindings: arm: rockchip: Add Luckfox Lyra and Lyra Plus Jonas Karlman
2026-11-19 15:20 ` [PATCH 4/8] ARM: dts: rockchip: Add Luckfox Lyra and Lyra Plus boards Jonas Karlman
2026-11-20 15:21 ` sashiko-bot [this message]
2026-11-19 15:20 ` [PATCH 5/8] dt-bindings: arm: rockchip: Add Luckfox Lyra Ultra Jonas Karlman
2026-11-19 15:20 ` [PATCH 6/8] ARM: dts: rockchip: Add Luckfox Lyra Ultra board Jonas Karlman
2026-11-19 15:20 ` [PATCH 7/8] dt-bindings: arm: rockchip: Add Luckfox Lyra Zero W Jonas Karlman
2026-11-19 15:20 ` [PATCH 8/8] ARM: dts: rockchip: Add Luckfox Lyra Zero W board Jonas Karlman
2026-11-20 15:21 ` sashiko-bot
2026-11-20 2:53 ` [PATCH 0/8] ARM: dts: rockchip: Add Luckfox Lyra boards Chaoyi Chen
2026-11-20 3:02 ` Chaoyi Chen
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-225452@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jonas@kwiboo.se \
--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