From: sashiko-bot@kernel.org
To: "Chancel Liu" <chancel.liu@oss.nxp.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org,
imx@lists.linux.dev, Frank.Li@kernel.org
Subject: Re: [PATCH v3 15/17] arm64: dts: imx952-evk: Add board muxes to select between CAN1/PDM
Date: Mon, 24 Aug 2026 02:40:40 +0000 [thread overview]
Message-ID: <20260824024041.1A2391F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260824022020.2812810-16-chancel.liu@oss.nxp.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but repeated probe deferrals of devices consuming `pinctrl-multiplexer` states will cause a memory leak in the `pinctrl-generic-mux` driver.
--
--- Patch [15]: [PATCH v3 15/17] arm64: dts: imx952-evk: Add board muxes to select between CAN1/PDM ---
commit 8303ed37e9ec3be6828aa6ff3d2b548e65c73826
Author: Chancel Liu <chancel.liu@nxp.com>
arm64: dts: imx952-evk: Add board muxes to select between CAN1/PDM
This commit replaces static gpio-hog settings with GPIO-controlled board
muxes. It uses the pinctrl-multiplexer framework so that conflicting
functions between CAN1 and PDM can be selected at runtime.
> diff --git a/arch/arm64/boot/dts/freescale/imx952-evk.dts b/arch/arm64/boot/dts/freescale/imx952-evk.dts
> index 2224b90aafe93..e9d735dc2a51b 100644
> --- a/arch/arm64/boot/dts/freescale/imx952-evk.dts
> +++ b/arch/arm64/boot/dts/freescale/imx952-evk.dts
> @@ -52,6 +52,40 @@ chosen {
> stdout-path = &lpuart1;
> };
>
> + can1_pdm_mux: mux-controller-0 {
> + compatible = "gpio-mux";
> + #mux-control-cells = <0>;
> + #mux-state-cells = <1>;
> + mux-gpios = <&pcal6416 10 GPIO_ACTIVE_HIGH>;
> + };
> +
> + mqs1_en_mux: mux-controller-1 {
> + compatible = "gpio-mux";
> + #mux-control-cells = <0>;
> + #mux-state-cells = <1>;
> + mux-gpios = <&pcal6416 15 GPIO_ACTIVE_HIGH>;
> + };
> +
> + pinctrl-gpiomux {
> + compatible = "pinctrl-multiplexer";
[Severity: High]
This isn't a bug introduced by this patch, but adding this multiplexer
reveals a pre-existing memory leak in the pinctrl-generic-mux driver.
When a consumer device (e.g., flexcan1) probes, the pinctrl core calls
mux_pinmux_dt_node_to_map() in drivers/pinctrl/pinctrl-generic-mux.c. That
function unconditionally allocates memory using devm_ APIs attached to the
provider's device:
drivers/pinctrl/pinctrl-generic-mux.c:mux_pinmux_dt_node_to_map() {
...
function = devm_kzalloc(pctldev->dev, sizeof(*function), GFP_KERNEL);
if (!function)
return -ENOMEM;
group_names = devm_kcalloc(pctldev->dev, 1, sizeof(*group_names), GFP_KERNEL);
...
}
If the consumer defers probe, these allocations are orphaned on the
provider's devres list and aren't freed during the consumer's cleanup
path. On subsequent probe attempts, new allocations are made, leaking
memory each time.
Is there a plan to fix this in drivers/pinctrl/pinctrl-generic-mux.c so
that repeated probe deferrals don't cause unbounded memory exhaustion on
the provider device?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260824022020.2812810-1-chancel.liu@oss.nxp.com?part=15
next prev parent reply other threads:[~2026-08-24 2:40 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-24 2:20 [PATCH v3 00/17] arm64: dts: Add MQS1 sound card support for i.MX9 EVK platforms Chancel Liu
2026-08-24 2:20 ` [PATCH v3 01/17] arm64: dts: imx91_93_common: Add clock and sound-dai-cells properties for MQS Chancel Liu
2026-08-24 2:20 ` [PATCH v3 02/17] arm64: dts: imx91-11x11-evk: Add board muxes to select between PDM and MQS1 Chancel Liu
2026-08-24 2:35 ` sashiko-bot
2026-08-24 2:20 ` [PATCH v3 03/17] arm64: dts: imx91-11x11-evk: Add MQS1 pinmux, clocks and mark conflicting devices Chancel Liu
2026-08-24 2:20 ` [PATCH v3 04/17] arm64: dts: imx93-11x11-evk: Add board muxes to select between PDM and MQS1 Chancel Liu
2026-08-24 2:20 ` [PATCH v3 05/17] arm64: dts: imx93-11x11-evk: Add MQS1 pinmux, clocks and mark conflicting devices Chancel Liu
2026-08-24 2:20 ` [PATCH v3 06/17] arm64: dts: imx93-14x14-evk: Add board muxes to select between FlexCAN1 and MQS1 Chancel Liu
2026-08-24 2:20 ` [PATCH v3 07/17] arm64: dts: imx93-14x14-evk: Add MQS1 pinmux, clocks and mark conflicting devices Chancel Liu
2026-08-24 2:20 ` [PATCH v3 08/17] arm64: dts: imx94: Add clock and sound-dai-cells properties for MQS1 Chancel Liu
2026-08-24 2:20 ` [PATCH v3 09/17] arm64: dts: imx943-evk: Add board muxes to select between CAN1/PDM and MQS1/MIC Chancel Liu
2026-08-24 2:34 ` sashiko-bot
2026-08-24 2:20 ` [PATCH v3 10/17] arm64: dts: imx943-evk: Add MQS1 pinmux, clocks and mark conflicting devices Chancel Liu
2026-08-24 2:20 ` [PATCH v3 11/17] arm64: dts: imx95: Add clock and sound-dai-cells properties for MQS1 Chancel Liu
2026-08-24 2:20 ` [PATCH v3 12/17] arm64: dts: imx95-15x15-evk: Add board muxes to select between PDM and MQS1 Chancel Liu
2026-08-24 2:20 ` [PATCH v3 13/17] arm64: dts: imx95-15x15-evk: Add MQS1 pinmux, clocks and mark conflicting devices Chancel Liu
2026-08-24 2:20 ` [PATCH v3 14/17] arm64: dts: imx952: Add AONMIX MQS device node Chancel Liu
2026-08-24 2:20 ` [PATCH v3 15/17] arm64: dts: imx952-evk: Add board muxes to select between CAN1/PDM Chancel Liu
2026-08-24 2:40 ` sashiko-bot [this message]
2026-08-24 2:20 ` [PATCH v3 16/17] arm64: dts: imx952-evk: Add MQS1 pinmux, clocks and mark conflicting devices Chancel Liu
2026-08-24 2:20 ` [PATCH v3 17/17] arm64: dts: fsl: Add DT overlay to build MQS1 sound cards on i.MX9 platforms Chancel Liu
2026-08-24 2:42 ` sashiko-bot
2026-08-25 2:58 ` Chancel Liu
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=20260824024041.1A2391F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=chancel.liu@oss.nxp.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=imx@lists.linux.dev \
--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