All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Richard Acayan" <mailingradian@gmail.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v6 11/15] ASoC: qcom: sm8250: add support for LPI_MI2S_RX_0 and LPI_MI2S_TX_3
Date: Thu, 30 Jul 2026 18:02:58 +0000	[thread overview]
Message-ID: <20260730180258.92B911F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260730174353.108023-12-mailingradian@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The machine driver enables sysclk on startup for the new LPI_MI2S DAIs but fails to disable it on shutdown, resulting in a clock and power leak.
- [Medium] Ignored return values from hardware configuration functions `snd_soc_dai_set_sysclk` and `snd_soc_dai_set_fmt`.
--

--- Patch [11]: [PATCH v6 11/15] ASoC: qcom: sm8250: add support for LPI_MI2S_RX_0 and LPI_MI2S_TX_3 ---
commit ed124256581921c49604c5e5d63d1989a91f17c4
Author: Richard Acayan <mailingradian@gmail.com>

ASoC: qcom: sm8250: add support for LPI_MI2S_RX_0 and LPI_MI2S_TX_3

This commit adds support for the LPI_MI2S_RX_0 and LPI_MI2S_TX_3 ports
on SDM660. The new ports are connected to digital and analog WCD codecs
and are initialized using the same logic as the existing ports.

> diff --git a/sound/soc/qcom/sm8250.c b/sound/soc/qcom/sm8250.c
> --- a/sound/soc/qcom/sm8250.c
> +++ b/sound/soc/qcom/sm8250.c
[ ... ]
> @@ -112,6 +112,22 @@ static int sm8250_snd_startup(struct snd_pcm_substream *substream)
>  		snd_soc_dai_set_fmt(cpu_dai, fmt);
>  		snd_soc_dai_set_fmt(codec_dai, codec_dai_fmt);
>  		break;
> +	case LPI_MI2S_RX_0:
> +		codec_dai_fmt |= SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_I2S;
> +		snd_soc_dai_set_sysclk(cpu_dai,
> +			Q6AFE_LPASS_CLK_ID_INT0_MI2S_IBIT,
> +			MI2S_BCLK_RATE, SNDRV_PCM_STREAM_PLAYBACK);

[Severity: High]
Does this code leak the DSP clock reference? The sysclk is enabled for the
new LPI_MI2S DAIs on stream startup by passing a positive frequency, but
there does not appear to be a corresponding shutdown handler to set the
frequency back to 0. 

This might leave the clock running and prevent the SoC from entering deeper
sleep states.

> +		snd_soc_dai_set_fmt(cpu_dai, fmt);
> +		snd_soc_dai_set_fmt(codec_dai, codec_dai_fmt);

[Severity: Medium]
Should the return values of snd_soc_dai_set_sysclk() and
snd_soc_dai_set_fmt() be evaluated? 

Hardware initialization errors in sm8250_snd_startup() will be silently
ignored, which could cause cryptic audio playback or capture failures rather
than a clean initialization error.

> +		break;
> +	case LPI_MI2S_TX_3:
> +		codec_dai_fmt |= SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_I2S;
> +		snd_soc_dai_set_sysclk(cpu_dai,
> +			Q6AFE_LPASS_CLK_ID_INT3_MI2S_IBIT,
> +			MI2S_BCLK_RATE, SNDRV_PCM_STREAM_CAPTURE);
> +		snd_soc_dai_set_fmt(cpu_dai, fmt);
> +		snd_soc_dai_set_fmt(codec_dai, codec_dai_fmt);
> +		break;
>  	default:
>  		break;
>  	}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260730174353.108023-1-mailingradian@gmail.com?part=11

  reply	other threads:[~2026-07-30 18:02 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30 17:43 [PATCH v6 00/15] SDM660 sound card and internal MI2S support Richard Acayan
2026-07-30 17:43 ` [PATCH v6 01/15] ASoC: dt-bindings: qcom,sm8250: add compatible for sdm660 Richard Acayan
2026-07-30 17:43 ` [PATCH v6 02/15] ASoC: dt-bindings: qcom: q6dsp: add support for lpi mi2s ports 5-6 Richard Acayan
2026-07-30 17:43 ` [PATCH v6 03/15] ASoC: dt-bindings: pm8916-wcd-analog-codec: Document pm8950/pm8953 Richard Acayan
2026-07-30 17:43 ` [PATCH v6 04/15] ASoC: dt-bindings: pm8916-analog-codec: Add PM660L compatible Richard Acayan
2026-07-30 17:43 ` [PATCH v6 05/15] ASoC: dt-bindings: msm8916-digital-codec: Add SDM660 compatible Richard Acayan
2026-07-30 17:43 ` [PATCH v6 06/15] ASoC: qdsp6: q6dsp-lpass-ports: add support for lpi mi2s ports 5-6 Richard Acayan
2026-07-30 18:15   ` sashiko-bot
2026-07-30 22:49   ` Srinivas Kandagatla
2026-07-30 17:43 ` [PATCH v6 07/15] ASoC: qdsp6: q6afe: add internal mi2s support Richard Acayan
2026-07-30 18:21   ` sashiko-bot
2026-07-30 22:51   ` Srinivas Kandagatla
2026-07-30 17:43 ` [PATCH v6 08/15] ASoC: qdsp6: q6afe-dai: " Richard Acayan
2026-07-30 18:06   ` sashiko-bot
2026-07-30 22:55   ` Srinivas Kandagatla
2026-07-30 17:43 ` [PATCH v6 09/15] ASoC: qdsp6: q6routing: add lpi " Richard Acayan
2026-07-30 22:57   ` Srinivas Kandagatla
2026-07-30 17:43 ` [PATCH v6 10/15] ASoC: qdsp6: common: support headphone jacks connected to lpi mi2s Richard Acayan
2026-07-30 17:43 ` [PATCH v6 11/15] ASoC: qcom: sm8250: add support for LPI_MI2S_RX_0 and LPI_MI2S_TX_3 Richard Acayan
2026-07-30 18:02   ` sashiko-bot [this message]
2026-07-30 17:43 ` [PATCH v6 12/15] ASoC: qcom: sm8250: add SDM660 compatible Richard Acayan
2026-07-30 17:43 ` [PATCH v6 13/15] ASoC: msm8916-wcd-analog: add pm8950 codec Richard Acayan
2026-07-30 17:59   ` sashiko-bot
2026-07-30 17:43 ` [PATCH v6 14/15] ASoC: msm8916-wcd-analog: add pm8953 codec Richard Acayan
2026-07-30 18:03   ` sashiko-bot
2026-07-30 17:43 ` [PATCH v6 15/15] ASoC: msm8916-wcd-analog: add quirk for cajon 2.0 Richard Acayan
2026-07-30 18:03   ` sashiko-bot

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=20260730180258.92B911F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=mailingradian@gmail.com \
    --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.