Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: shengjiu.wang@oss.nxp.com, linux-sound@vger.kernel.org,
	imx@lists.linux.dev
Cc: Frank.Li@kernel.org
Subject: Re: [PATCH v2] ASoC: SOF: imx8: Switch imx8ulp DSP control to reset framework
Date: Thu, 26 Nov 2026 10:33:09 +0000	[thread overview]
Message-ID: <sashiko-outbox-235295@kernel.org> (raw)
In-Reply-To: <20261126102528.1531824-1-shengjiu.wang@oss.nxp.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] ASoC: SOF: imx8: undocumented dbgreset and optional resets in
  imx8ulp_probe()
--

commit e612ef7d377466215d3164c95469326c85ff2571
Author: Shengjiu Wang <shengjiu.wang@nxp.com>

ASoC: SOF: imx8: Switch imx8ulp DSP control to reset framework

This commit replaces direct syscon regmap accesses in the i.MX8ULP SOF
DSP driver with the reset controller framework using named reset controls.

> diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c
> index 5cd3f44c90d2b..80326d2eb1fc0 100644
> --- a/sound/soc/sof/imx/imx8.c
> +++ b/sound/soc/sof/imx/imx8.c
[ ... ]
> @@ -202,42 +201,31 @@ static int imx8m_probe(struct snd_sof_dev *sdev)
>  
>  static int imx8ulp_run(struct snd_sof_dev *sdev)
>  {
> -	struct regmap *regmap = get_chip_pdata(sdev);
> +	struct imx8ulp_chip_data *chip = get_chip_pdata(sdev);
>  
> -	/* Controls the HiFi4 DSP Reset: 1 in reset, 0 out of reset */
> -	regmap_update_bits(regmap, SYSCTRL0, RESET_BIT, 0);
> +	reset_control_deassert(chip->soft_rst);
>  
> -	/* Reset HiFi4 DSP Debug logic: 1 debug reset, 0  out of reset*/
> -	regmap_update_bits(regmap, SYSCTRL0, DEBUG_LOGIC_BIT, 0);
> +	/* Release HiFi4 DSP Debug logic */
> +	reset_control_deassert(chip->dbg_rst);
>  
> -	/* Stall HIFI4 DSP Execution: 1 stall, 0 run */
> -	regmap_update_bits(regmap, SYSCTRL0, EXECUTE_BIT, 0);
> +	/* Run HIFI4 DSP Execution */
> +	reset_control_deassert(chip->run_stall);
>  
>  	return 0;
>  }
>  
>  static int imx8ulp_reset(struct snd_sof_dev *sdev)
>  {
> +	struct imx8ulp_chip_data *chip = get_chip_pdata(sdev);
>  	struct arm_smccc_res smc_res;
> -	struct regmap *regmap;
> -
> -	regmap = get_chip_pdata(sdev);
> -
> -	/* HiFi4 Platform Clock Enable: 1 enabled, 0 disabled */
> -	regmap_update_bits(regmap, SYSCTRL0, PLAT_CLK_BIT, PLAT_CLK_BIT);
>  
> -	/* HiFi4 PBCLK clock enable: 1 enabled, 0 disabled */
> -	regmap_update_bits(regmap, SYSCTRL0, PB_CLK_BIT, PB_CLK_BIT);
> -
> -	/* HiFi4 Clock Enable: 1 enabled, 0 disabled */
> -	regmap_update_bits(regmap, SYSCTRL0, HIFI4_CLK_BIT, HIFI4_CLK_BIT);
> -
> -	regmap_update_bits(regmap, SYSCTRL0, RESET_BIT, RESET_BIT);
> +	reset_control_assert(chip->soft_rst);
>  
>  	usleep_range(1, 2);
>  
> -	/* Stall HIFI4 DSP Execution: 1 stall, 0 not stall */
> -	regmap_update_bits(regmap, SYSCTRL0, EXECUTE_BIT, EXECUTE_BIT);
> +	/* Stall HIFI4 DSP Execution: */
> +	reset_control_assert(chip->run_stall);
> +
>  	usleep_range(1, 2);
>  
>  	arm_smccc_smc(FSL_SIP_HIFI_XRDC, 0, 0, 0, 0, 0, 0, 0, &smc_res);
> @@ -248,16 +236,30 @@ static int imx8ulp_reset(struct snd_sof_dev *sdev)
>  static int imx8ulp_probe(struct snd_sof_dev *sdev)
>  {
>  	struct imx_common_data *common;
> -	struct regmap *regmap;
> +	struct imx8ulp_chip_data *chip;
> +
> +	chip = devm_kzalloc(sdev->dev, sizeof(*chip), GFP_KERNEL);
> +	if (!chip)
> +		return -ENOMEM;
>  
>  	common = sdev->pdata->hw_pdata;
>  
> -	regmap = syscon_regmap_lookup_by_phandle(sdev->dev->of_node, "fsl,dsp-ctrl");
> -	if (IS_ERR(regmap))
> -		return dev_err_probe(sdev->dev, PTR_ERR(regmap),
> -				     "failed to fetch dsp ctrl regmap\n");
> +	chip->run_stall = devm_reset_control_get_exclusive(sdev->dev, "runstall");
> +	if (IS_ERR(chip->run_stall))
> +		return dev_err_probe(sdev->dev, PTR_ERR(chip->run_stall),
> +				     "failed to get dsp runstall reset control\n");
> +
> +	chip->soft_rst = devm_reset_control_get_optional_exclusive(sdev->dev, "softreset");
> +	if (IS_ERR(chip->soft_rst))
> +		return dev_err_probe(sdev->dev, PTR_ERR(chip->soft_rst),
> +				     "failed to get dsp softreset reset control\n");
>  
> -	common->chip_pdata = regmap;
> +	chip->dbg_rst = devm_reset_control_get_optional_exclusive(sdev->dev, "dbgreset");
> +	if (IS_ERR(chip->dbg_rst))
> +		return dev_err_probe(sdev->dev, PTR_ERR(chip->dbg_rst),
> +				     "failed to get dsp dbgreset reset control\n");
> +
> +	common->chip_pdata = chip;
>  
>  	return 0;
>  }

[Severity: Medium]
Does requesting "dbgreset" here match the fsl,dsp.yaml Devicetree binding,
and should chip->soft_rst and chip->dbg_rst be optional on i.MX8ULP?

Documentation/devicetree/bindings/dsp/fsl,dsp.yaml only allows "runstall"
and "softreset" in reset-names:

  reset-names:
    minItems: 1
    items:
      - const: runstall
      - const: softreset

A Devicetree conforming to that schema cannot specify "dbgreset" (and may
omit "softreset"), leaving chip->dbg_rst or chip->soft_rst NULL so
reset_control_assert() in imx8ulp_reset() and reset_control_deassert() in
imx8ulp_run() become no-ops instead of toggling the SIM_LPAV SYSCTRL0 DSP
reset and debug reset bits.  In addition, removing the fsl,dsp-ctrl
syscon lookup without a fallback breaks compatibility with existing DTBs
that still use fsl,dsp-ctrl, and leaves the linux/mfd/syscon.h include in
sound/soc/sof/imx/imx8.c unused.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261126102528.1531824-1-shengjiu.wang@oss.nxp.com?part=1

      reply	other threads:[~2026-11-26 10:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 10:25 [PATCH v2] ASoC: SOF: imx8: Switch imx8ulp DSP control to reset framework shengjiu.wang
2026-11-26 10:33 ` sashiko-bot [this message]

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-235295@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=linux-sound@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=shengjiu.wang@oss.nxp.com \
    /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