Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Michael Zhang" <zhangyi@everest-semi.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v0 2/7] ASoC: codecs: ES8389: Fix the issue about mclk_src
Date: Mon, 08 Jun 2026 08:52:40 +0000	[thread overview]
Message-ID: <20260608085240.F04621F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260608083540.12581-3-zhangyi@everest-semi.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Devicetree ABI Breakage and Hardware Leak in mclk_src Evaluation
--

commit 901f3e10a3b9643fed9b6bed617589331a04275d
Author: Zhang Yi <zhangyi@everest-semi.com>

ASoC: codecs: ES8389: Fix the issue about mclk_src

This commit addresses an issue with incorrect modifications to the mclk_src
configuration by updating the bitmask logic and hardware register definitions.

> diff --git a/sound/soc/codecs/es8389.c b/sound/soc/codecs/es8389.c
> index 9c816491648c7..638eb1f0462ea 100644
> --- a/sound/soc/codecs/es8389.c
> +++ b/sound/soc/codecs/es8389.c
> @@ -609,7 +609,7 @@ static int es8389_pcm_hw_params(struct snd_pcm_substream *substream,
>  
>  	if (es8389->mclk_src == ES8389_SCLK_PIN) {

[Severity: High]
Does this change break the devicetree ABI?

In es8389_probe(), the driver reads the "everest,mclk-src" devicetree property
directly into the es8389->mclk_src variable:

sound/soc/codecs/es8389.c:es8389_probe() {
    ...
    ret = device_property_read_u8(component->dev, "everest,mclk-src", 
                                  &es8389->mclk_src);
    ...
}

Since ES8389_SCLK_PIN is redefined below as (1 << 6), any existing device
trees using logical values like <0> or <1> will fail this equality check.
This will silently bypass the SCLK configuration and break audio functionality,
unless device tree authors now populate the property with the raw hardware
bitmask <64>.

>  		regmap_update_bits(es8389->regmap, ES8389_MASTER_CLK,
> -					ES8389_MCLK_SOURCE, es8389->mclk_src);
> +					ES8389_MCLK_MASK, es8389->mclk_src);
>  		es8389->sysclk = params_channels(params) * params_width(params) * params_rate(params);
>  	}

[ ... ]

> diff --git a/sound/soc/codecs/es8389.h b/sound/soc/codecs/es8389.h
> index d21e72f876a60..13ce241774dc8 100644
> --- a/sound/soc/codecs/es8389.h
> +++ b/sound/soc/codecs/es8389.h
> @@ -116,9 +116,10 @@
>  #define ES8389_TDM_SLOT               (0x70 << 0)
>  #define ES8389_TDM_SHIFT              4
>  
> -#define ES8389_MCLK_SOURCE            (1 << 6)
> -#define ES8389_MCLK_PIN               (1 << 6)
> -#define ES8389_SCLK_PIN               (0 << 6)
> +#define ES8389_MCLK_MASK              (3 << 6)
> +#define ES8389_MCLK_SOURCE            (0 << 6)
> +#define ES8389_MCLK_PIN               (0 << 6)
> +#define ES8389_SCLK_PIN               (1 << 6)

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260608083540.12581-1-zhangyi@everest-semi.com?part=2

  reply	other threads:[~2026-06-08  8:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08  8:35 [PATCH v0 0/7] ASoC: codecs: ES8389: Modify the ES8389 driver Michael Zhang
2026-06-08  8:35 ` [PATCH v0 1/7] ASoC: codecs: ES8389: Modify volatile_register Michael Zhang
2026-06-08  8:50   ` sashiko-bot
2026-06-08  8:35 ` [PATCH v0 2/7] ASoC: codecs: ES8389: Fix the issue about mclk_src Michael Zhang
2026-06-08  8:52   ` sashiko-bot [this message]
2026-06-08  8:35 ` [PATCH v0 3/7] ASoC: codecs: ES8389: Modify the clock table Michael Zhang
2026-06-08  8:51   ` sashiko-bot
2026-06-08  8:35 ` [PATCH v0 4/7] ASoC: codecs: ES8389: Modify the initial configuration Michael Zhang
2026-06-08  8:46   ` sashiko-bot
2026-06-08  8:35 ` [PATCH v0 5/7] ASoC: codecs: ES8389: Add private members related to HPF Michael Zhang
2026-06-08  8:49   ` sashiko-bot
2026-06-08  8:35 ` [PATCH v0 6/7] ASoC: codecs: ES8389: Add INPUTL MUX and INPUTR MUX Michael Zhang
2026-06-08  8:35 ` [PATCH v0 7/7] ASoC: dt-bindings: ES8389: Add members about HPF Michael Zhang

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=20260608085240.F04621F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=zhangyi@everest-semi.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