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=1796304078; b=xW3/yjfpPWV5B7uMnhzjVdXUK4vSnEG8MceM+6nTCGEiVy2LHKGVXPCXc5EIHFPAmqOs vd/cJa5/HANT+5xYx/PcnfGg/wx99mPCMMzDxsJQ9qgm8zyRw5GG5E0cavSdwiRA4rVHR cIKmBV/WOjkCkgjStP7nQrRczbsvk0t0/5S91C8u8HEk3+mTJqi6cLAkhijgW2u2VfKBg 2Bh9gQJ2jQiDE++OD1DAxxacFgDNXWn4xiT+jHbLYWc9cRG2bbe9jlaexD5gRmGRUdbuN hvQQIA7Ejop5dS1vQG8rBQ3aQqH3C2j5NYbRPBMCbUbusXA42RSthONN92EfqL6KDtA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796304078; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=/k88s0WniedDN7hvA3gTZM62oudhnLTnMcF1GYZa5ko=; b=k6G3tZiuFwakCFRWU/T/QbOIyf9dsIo4MTy7ESG5ywQkle2Kj87VHTK9zEKoKsMuKj1Z JvyxnRS0eSvjrwsKzo+N8qV6E6bkl7vNXqrsXBEavGvgmsU4Xv+2laZ779p/bXCPMCpb4 7KfzpCbWVFDhP+cyddj35cH7ZV1fom82tMgcmEnqcQ6kc8f7MJfWyfvdIeKUOgt6Y/2CL eVnzgNHlgV11RZBTB0yBHq31zSNpikqVLcVSM0uTCrfvS2R5kEQ353RbBCaOqp5kCu4nN NjB5DFTWV8ruDuzNgs2f3Omfm9RwLqUneHk5aoMKSNFS4AvnP3JikelugnWsTDVkjqw== 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=CCKBIVUt; 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 CDE7C606A322; Thu, 3 Dec 2026 13:21:18 +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=CCKBIVUt Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37C621F000C1; Thu, 3 Dec 2026 13:21:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796304078; bh=/k88s0WniedDN7hvA3gTZM62oudhnLTnMcF1GYZa5ko=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=CCKBIVUt7bjL2Nql/MWQrB0Ls/a0Gz+Cjmn5kwldlSNGYs12sj+/73VVUxLUfnYZs pp/L6fwgLT0bg1vF4gkNxmK0XzLbUfNH6s5MZevF/r6uPykx74wsIoYpKeRntgaNj2 F+UfTdYNZVm2nOFPPKXbduelKYffwJrdgQR/WCpEV5qZdV4goO968THRgkOBomIccV H0If1xtkDoKEGpxr+0dJq8PSEGxF9GaITF78n6afi1UauVeBKSUxiwuSwumzta9wRh toMsJ9GW86+RIxJPowa2dNiR1fCg91KXboAH8V9EqJ9pLYGlsdHyetoD5oMyodZw3O qejTRiGFHnJQg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 7/7] ASoC: nau8810: add MCLK support Reply-To: sashiko-reviews@lists.linux.dev To: "Mehmet Fide" Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261203124733.2101884-8-mehmet.fide@gmail.com> References: <20261203124733.2101884-1-mehmet.fide@gmail.com> <20261203124733.2101884-8-mehmet.fide@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 13:21:17 +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 2 potential issues to consider: - [High] ASoC: nau8810: MCLK-to-PLL switch leaves PLL off during pmdown_time - [Medium] ASoC: nau8810: nau8810_set_pll() reprograms PLL while PLL_EN is active -- commit 6d8fbbb4bed0d01ffd7425872f563b6b8efcc0d3 Author: Mehmet Fide ASoC: nau8810: add MCLK support This commit adds optional MCLK clock handling to the nau8810 driver, enabling MCLK when the codec leaves standby and configuring the PLL in nau8810_set_sysclk() whenever the requested sysclk differs from the MCLK rate. > diff --git a/sound/soc/codecs/nau8810.c b/sound/soc/codecs/nau8810.c > index a27fa63a2887e..311dfa8eea74d 100644 > --- a/sound/soc/codecs/nau8810.c > +++ b/sound/soc/codecs/nau8810.c [ ... ] > @@ -608,11 +609,26 @@ static int nau8810_set_sysclk(struct snd_soc_dai *d= ai, > { > struct snd_soc_component *component =3D dai->component; > struct nau8810 *nau8810 =3D snd_soc_component_get_drvdata(component); > + unsigned long mclk_freq; > =20 > nau8810->clk_id =3D clk_id; > nau8810->sysclk =3D freq; > + > + if (nau8810->mclk) { > + mclk_freq =3D clk_get_rate(nau8810->mclk); > + if (mclk_freq !=3D freq) { > + int ret =3D nau8810_set_pll(dai, NAU8810_SCLK_MCLK, > + NAU8810_SCLK_MCLK, mclk_freq, freq); > + if (ret) { > + dev_err(component->dev, "Failed to set PLL\n"); > + return ret; > + } > + nau8810->clk_id =3D NAU8810_SCLK_PLL; > + } > + } > + > dev_dbg(nau8810->dev, "master sysclk %dHz, source %s\n", > - freq, clk_id =3D=3D NAU8810_SCLK_PLL ? "PLL" : "MCLK"); > + freq, nau8810->clk_id =3D=3D NAU8810_SCLK_PLL ? "PLL" : "MCLK"); > =20 > return 0; > } [Severity: High] Can switching from an MCLK-matched rate to a PLL-derived rate leave the PLL powered off during pmdown_time? Unlike nau8822_set_pll(), nau8810_set_pll() selects NAU8810_CLKM_PLL in NAU8810_REG_CLOCK without setting NAU8810_PLL_EN_SFT in NAU8810_REG_POWER1. Instead, NAU8810_PLL_EN_SFT is only driven by the "PLL" DAPM supply widget, gated on check_mclk_select_pll(). Because nau8810_component_driver sets .use_pmdown_time =3D 1, closing an MCLK-matched stream leaves Playback and DAC powered on with PLL off. If a PLL-rate stream starts within pmdown_time, dapm_power_one_widget() sees Playback already active and skips check_mclk_select_pll(). The codec master clock is then routed from a powered-off PLL, breaking playback with silent output or PCM write timeouts when the codec is clock provider. In the reverse direction (PLL to MCLK), the PLL remains powered on until pmdown_time expires. [Severity: Medium] Can nau8810_set_pll() reprogram the PLL registers while NAU8810_PLL_EN_SFT is still active? When back-to-back streams run at different PLL-derived rates within pmdown_time (such as 48 kHz then 44.1 kHz from a 25 MHz MCLK), the DAPM PLL widget keeps NAU8810_PLL_EN_SFT set. nau8810_set_pll() then writes NAU8810_REG_PLLN and NAU8810_REG_PLLK1..3 while the PLL is enabled. On the sibling NAU8822 with the same fractional-N PLL registers, commit aeca8a329502 ("ASoC: nau8822: Add operation for internal PLL off and on") found that the PLL fails to lock unless PLL_EN is cleared before programming the fractional parameters and re-enabled afterward. Should nau8810_set_pll() clear NAU8810_PLL_EN_SFT before updating the PLL registers and restore it afterward if it was enabled? --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203124733.2101= 884-1-mehmet.fide@gmail.com?part=3D7