All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Chancel Liu" <chancel.liu@oss.nxp.com>
Cc: devicetree@vger.kernel.org, imx@lists.linux.dev, robh@kernel.org,
	conor+dt@kernel.org, Frank.Li@kernel.org
Subject: Re: [PATCH v3 02/17] arm64: dts: imx91-11x11-evk: Add board muxes to select between PDM and MQS1
Date: Mon, 24 Aug 2026 02:35:12 +0000	[thread overview]
Message-ID: <20260824023512.D55361F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260824022020.2812810-3-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 calls to `mux_pinmux_dt_node_to_map` during probe deferral of the consumer cause unbounded memory leaks on the `pinctrl-multiplexer` provider device.
--

--- Patch [2]: [PATCH v3 02/17] arm64: dts: imx91-11x11-evk: Add board muxes to select between PDM and MQS1 ---
commit defaefa605b7135d708e20b9a9bb866edaa4e6a1
Author: Chancel Liu <chancel.liu@nxp.com>

arm64: dts: imx91-11x11-evk: Add board muxes to select between PDM and MQS1

This patch adds GPIO-controlled board muxes to route shared signals
between PDM and MQS1, resolving a pin conflict. It introduces the
pdm_mqs1_mux and pinctrl-gpiomux nodes, and updates the micfil pinctrl.

> diff --git a/arch/arm64/boot/dts/freescale/imx91-11x11-evk.dts b/arch/arm64/boot/dts/freescale/imx91-11x11-evk.dts
> index 5716febb5a50f..4d1ada6a3942b 100644
> --- a/arch/arm64/boot/dts/freescale/imx91-11x11-evk.dts
> +++ b/arch/arm64/boot/dts/freescale/imx91-11x11-evk.dts

[ ... ]

> @@ -484,7 +503,7 @@ bluetooth {
>  
>  &micfil {
>  	pinctrl-names = "default", "sleep";
> -	pinctrl-0 = <&pinctrl_pdm>;
> +	pinctrl-0 = <&pinctrl_pdm>, <&pdm_fun>;

[Severity: High]
This isn't a bug introduced by this patch, but adding this multiplexer to
the consumer could expose a devres leak in the provider if the consumer
defers probe.

When the micfil consumer evaluates its pinctrl-0 properties, it triggers
mux_pinmux_dt_node_to_map() in drivers/pinctrl/pinctrl-generic-mux.c.
This function allocates resources bound to the provider device rather than
the consumer:

drivers/pinctrl/pinctrl-generic-mux.c:mux_pinmux_dt_node_to_map() {
    ...
    function = devm_kzalloc(pctldev->dev, sizeof(*function), GFP_KERNEL);
    ...
    group_names = devm_kcalloc(pctldev->dev, 1, sizeof(*group_names), GFP_KERNEL);
    ...
    function->mux_state = devm_mux_state_get_from_np(pctldev->dev, NULL, np_config);
    ...
}

Because these devm_* allocations are bound to pctldev->dev (the provider
device), they are not freed if the micfil consumer defers probe.

Could this result in an unbounded memory and mux state leak on the provider
device for every probe retry?

>  	pinctrl-1 = <&pinctrl_pdm_sleep>;
>  	assigned-clocks = <&clk IMX93_CLK_PDM>;
>  	assigned-clock-parents = <&clk IMX93_CLK_AUDIO_PLL>;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260824022020.2812810-1-chancel.liu@oss.nxp.com?part=2

  reply	other threads:[~2026-08-24  2:35 UTC|newest]

Thread overview: 24+ 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 [this message]
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
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
2026-09-03 19:31 ` [PATCH v3 00/17] arm64: dts: Add MQS1 sound card support for i.MX9 EVK platforms Frank.Li

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=20260824023512.D55361F000E9@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.