lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <58756837-9be7-4027-b951-401ceeb69e4c@sirena.org.uk>
Date: Wed, 8 Oct 2025 14:40:29 +0100
From: Mark Brown <broonie@...nel.org>
To: Sune Brian <briansune@...il.com>
Cc: Charles Keepax <ckeepax@...nsource.cirrus.com>,
	Liam Girdwood <lgirdwood@...il.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>,
	linux-sound@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] ASoC: wm8978: add missing BCLK divider setup

On Wed, Oct 08, 2025 at 09:26:16PM +0800, Sune Brian wrote:
> Mark Brown <broonie@...nel.org> 於 2025年10月8日 週三 下午8:12寫道:

> > Consider the case where the BCLK needed is 100 and SYSCLK is 198.
> > Dividing by 1 will result in an absolute difference of 98 and a BCLK of
> > 198 while dividing by 2 will result in an absolute difference 1 and a
> > BCLK of 99 which is lower than the required BCLK.
> 
> for (i = 0; i < ARRAY_SIZE(bclk_divs); i++) {
> bclk = wm8978->f_256fs / bclk_divs[i];
> if (abs(bclk - target_bclk) < min_diff) {
> min_diff = abs(bclk - target_bclk);
> bclkdiv = i;
> }
> }

Your mail client has made this extremely hard to read.

> Cycle 0: min_diff=0xffff_ffff
> bclk = 198/bclk_divs[0] = 198/1=198
> bclk-target_bclk = 198-100 = 98
> 98 < 0xffff_ffff
> min_diff = 98
> bclkdiv=0

This is OK, BCLK is 198.

> Cycle 1: min_diff = 98
> bclk = 198/bclk_divs[1] = 198/2=99
> bclk-target_bclk = 99-100 = 1
> 1 < 98
> min_diff = 1
> bclk_div=1

This is not OK, BCLK is 99 which is less than 100 so there are not
enough BCLK cycles to clock the samples.

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ