From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796373892; b=HDIFyxJz6hahpCAftLMHvMjNY4YI9P4wXowYZF/11KupC2prSRe1F/PZj8i11e3ME27S Ye21yAqIyM4gTWV4eJ3UCb+dTHEQ8Bd9qjPFxrRuh8jeL0dCSMKO3fb8lacj5HSbb+Qsf 6UwICFXmGxfo3LF0iEXMK0aayvyuMESy1ayC7hWNSmKtOSqPiabez5kTVqD/yo8bNXj8J ROAq5vGjhQxZB5Rtrd+NwlrVx560fVMIzeyX8/etsWB6Pl2gegX5clXkfXhXvV/2mh8bs /dREe4/IJ0yxuu1xozV0dSD0so9HfP8at2lk+h26iEfljUjm75gXF5zPSOQ/sZYwv4w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796373892; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=3pHzXuVNKNyk2cg6+x3VK5ULPzsW0FYKwak0NGvHYec=; b=GvjyCHfR9UysxL2xlySTEMFiLpashwp2BbxHGhehOBqf1G6daDmXxfmR403Fu1gFRlnX 8sIlmPufTTQB4p7nzndrdv2Bl9fPWs0oVH2rO2ObPrznE7uOXJvSX3QlyFOwyAQu+67+o p6x963VXL+u4f4G4VhcKhSq6fzqpwuJ6TqkXn4pGOcnHbNY7WhJcBFMaP7Y6YZuHYn1pR ycV6atVz4muRe/jGutM6xjAVH/b8GDE9KCVCaKF3nyBuqxiU+TNqwabAw37VcEDMQClz7 5M+5mZY4jceJte6ura/5TPXxsXLWmfAhUSZNZBjFltp5K2YrgtJIri2ZipEuLkZnhuA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nA+kCe8+; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E973606A681 for ; Fri, 4 Dec 2026 08:44:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nA+kCe8+ Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5B3F1F000C2; Fri, 4 Dec 2026 08:44:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796373891; bh=3pHzXuVNKNyk2cg6+x3VK5ULPzsW0FYKwak0NGvHYec=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=nA+kCe8+SWl+b5N+io3hlbVXW2oJFsRXY6Z/mRp0U+aRXH8Qb8hTaHMCRDSQQ6LaD XihWYOFQIM7BR0hcmQS8uKWxjfz4AwLjjz9xWGDJC6X6g2eawHy3QDf4yPCfAqiMGR 4ovoLS96AaprXgyoiY9SJXieAn5sSrH3qB7R/DaZtnzvEnhNsX1GQ2B9os235MTzEp lE6pAxUuZ2pCkDfWyLOxDQiaCTDOiOmX9iuYq2eoXa1XJr+4tFtS5obGMZ1ZZ3MmlH 1QxG6hlXdBA7ZBzzLIL1DOhQMxsN7bDC9dBHZz9NDFD1dJYnyq+8jp6fWIZcm/XA8n HFLaEp/n6nxkQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] ASoC: codecs: ES8389: Modify the startup configuration Reply-To: sashiko-reviews@lists.linux.dev To: "Zhang Yi" , linux-sound@vger.kernel.org In-Reply-To: <20261204082056.4430-1-zhangyi@everest-semi.com> References: <20261204082056.4430-1-zhangyi@everest-semi.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 08:44:51 +0000 X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 4 potential issues to consider: - [High] ASoC: es8389: split wakeup in es8389_set_bias_level() and es8389_mute() - [Medium] ASoC: es8389: es8389_mute() can hold active DAC in reset on capture unmute - [Medium] ASoC: es8389: es8389_mute() wakeup writes race with es8389_standby() - [Low] ASoC: es8389: commit message omits root cause and sequencing rationale -- commit b420db27eff9e9ee2261ee4c28eaded8c91efc65 Author: Zhang Yi > ASoC: codecs: ES8389: Modify the startup configuration > > There is an occasional issue where the audio is silent during playback; > modify the startup configuration to resolve this issue. > > Signed-off-by: Zhang Yi [Severity: Low] Could the commit message explain the root cause of the occasional silent playback and why these register sequencing changes are needed? The patch moves wakeup writes out of es8389_set_bias_level(), drops ES8389_HPSW and ES8389_ANA_CTL1 from es8389_mute(), and adds an ES8389_DAC_RESET write. > diff --git a/sound/soc/codecs/es8389.c b/sound/soc/codecs/es8389.c > index 1a8e56506fe3a..040ee141318a1 100644 > --- a/sound/soc/codecs/es8389.c > +++ b/sound/soc/codecs/es8389.c > @@ -840,10 +840,6 @@ static int es8389_set_bias_level(struct snd_soc_comp= onent *component, > =20 > regmap_update_bits(es8389->regmap, ES8389_HPSW, 0x20, 0x20); > regmap_write(es8389->regmap, ES8389_ANA_CTL1, 0xD9); > - regmap_write(es8389->regmap, ES8389_ADC_EN, 0x8F); > - regmap_write(es8389->regmap, ES8389_CSM_JUMP, 0xE4); > - regmap_write(es8389->regmap, ES8389_RESET, 0x01); > - regmap_write(es8389->regmap, ES8389_CLK_OFF1, 0xC3); > break; > case SND_SOC_BIAS_PREPARE: > break; [Severity: High] Does removing these four writes from SND_SOC_BIAS_ON leave the codec stuck in standby/reset on wakeup paths that do not call es8389_mute(0)? es8389_standby() puts those four volatile registers into standby/reset, so regcache_sync() never restores them. When an active capture stream resumes from system suspend, snd_soc_card_resume_deferred() restores bias via DAPM and only unmutes playback streams, leaving capture stuck in standby/reset. Separately, dropping ES8389_HPSW and ES8389_ANA_CTL1 from es8389_mute() while writing the wakeup registers unconditionally breaks codec-to-codec playback links, where dapm_power_widgets() calls es8389_mute(0) before SND_SOC_BIAS_ON, enabling digital blocks while mclk and analog bias are off. > @@ -876,13 +872,12 @@ static int es8389_mute(struct snd_soc_dai *dai, int= mute, int direction) > } else { > regmap_read(es8389->regmap, ES8389_CSM_STATE1, ®v); > if (regv !=3D ES8389_STATE_ON) { > - regmap_update_bits(es8389->regmap, ES8389_HPSW, 0x20, 0x20); > - regmap_write(es8389->regmap, ES8389_ANA_CTL1, 0xD9); > - regmap_write(es8389->regmap, ES8389_ADC_EN, 0x8F); > - regmap_write(es8389->regmap, ES8389_CSM_JUMP, 0xE4); > - regmap_write(es8389->regmap, ES8389_RESET, 0x01); > - regmap_write(es8389->regmap, ES8389_CLK_OFF1, 0xC3); > + regmap_write(es8389->regmap, ES8389_DAC_RESET, 0X02); > } [Severity: Medium] Can unmuting a capture stream hold an active playback DAC in reset? es8389_mute() writes ES8389_DAC_RESET =3D 0x02 before checking direction, b= ut only clears it back to 0x00 on the playback branch when !es8389->version. At 88.2 or 96 kHz, es8389_pcm_hw_params() writes 0xC0 into bits [7:6] of ES8389_CSM_STATE1, so an unmasked check on capture unmute silences playback. > + regmap_write(es8389->regmap, ES8389_CSM_JUMP, 0xE4); > + regmap_write(es8389->regmap, ES8389_RESET, 0x01); > + regmap_write(es8389->regmap, ES8389_CLK_OFF1, 0xC3); > + regmap_write(es8389->regmap, ES8389_ADC_EN, 0x8F); [Severity: Medium] Can these wakeup writes in es8389_mute() race with es8389_standby()? Previously these writes ran in es8389_set_bias_level(SND_SOC_BIAS_ON) under card->dapm_mutex. Now __soc_pcm_prepare() calls es8389_mute(0) under card->pcm_mutex after snd_soc_dapm_stream_event() releases dapm_mutex, racing with a concurrent snd_soc_dapm_sync() entering es8389_standby(): CPU0 CPU1 soc_pcm_prepare() snd_soc_dapm_sync() lock(card->pcm_mutex) lock(card->dapm_mutex) snd_soc_dapm_stream_event() ... /* acquires & releases dapm_mutex */ es8389_standby() es8389_mute(0) write ES8389_CSM_JUMP =3D 0xD4 write ES8389_CSM_JUMP =3D 0xE4 usleep_range(70000, 72000) write ES8389_RESET =3D 0x01 write ES8389_CLK_OFF1 =3D 0xC3 write ES8389_ADC_EN =3D 0x8F write ES8389_ANA_CTL1 =3D 0x59 write ES8389_ADC_EN =3D 0x00 write ES8389_CLK_OFF1 =3D 0x00 write ES8389_RESET =3D 0x3E clk_disable_unprepare(mclk) <-- active stream left in reset In the reverse order, es8389_mute() re-enables CSM, clocks, digital core, and ADC after es8389_standby() and clk_disable_unprepare() have powered down analog bias and mclk. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204082056.4430= -1-zhangyi@everest-semi.com?part=3D1