public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH next] ASoC: rt1320: Fix retry checking in rt1320_rae_load()
@ 2025-12-20  8:45 Dan Carpenter
  2025-12-22  1:54 ` Shuming [范書銘]
  2025-12-22 17:50 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2025-12-20  8:45 UTC (permalink / raw)
  To: Shuming Fan
  Cc: Oder Chiou, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, linux-sound, linux-kernel, kernel-janitors

This loop iterates 200 times and then gives up.  The problem is that
currently the loop exits with "retry" set to -1 on the failure path but
the check for failure expects it to be 0.  Change from a post-op to a
pre-op so that it exits with "retry" set to 0.

Fixes: 22937af75abb ("ASoC: rt1320: support RAE parameters loading")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
Technically now the loop only tries 199 times after my change, however
I am okay with that.

 sound/soc/codecs/rt1320-sdw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/rt1320-sdw.c b/sound/soc/codecs/rt1320-sdw.c
index 9447e742c672..c0acb6ac462d 100644
--- a/sound/soc/codecs/rt1320-sdw.c
+++ b/sound/soc/codecs/rt1320-sdw.c
@@ -1480,7 +1480,7 @@ static int rt1320_rae_load(struct rt1320_sdw_priv *rt1320)
 		/* RAE stop & CRC disable */
 		regmap_update_bits(rt1320->regmap, 0xe803, 0xbc, 0x00);
 
-		while (retry--) {
+		while (--retry) {
 			regmap_read(rt1320->regmap, 0xe83f, &value);
 			if (value & 0x40)
 				break;
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH next] ASoC: rt1320: Fix retry checking in rt1320_rae_load()
  2025-12-20  8:45 [PATCH next] ASoC: rt1320: Fix retry checking in rt1320_rae_load() Dan Carpenter
@ 2025-12-22  1:54 ` Shuming [范書銘]
  2025-12-22 17:50 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Shuming [范書銘] @ 2025-12-22  1:54 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Oder Chiou, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, linux-sound@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org

> This loop iterates 200 times and then gives up.  The problem is that currently
> the loop exits with "retry" set to -1 on the failure path but the check for failure
> expects it to be 0.  Change from a post-op to a pre-op so that it exits with
> "retry" set to 0.
> 
> Fixes: 22937af75abb ("ASoC: rt1320: support RAE parameters loading")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> Technically now the loop only tries 199 times after my change, however I am
> okay with that.
> 
>  sound/soc/codecs/rt1320-sdw.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/soc/codecs/rt1320-sdw.c b/sound/soc/codecs/rt1320-sdw.c
> index 9447e742c672..c0acb6ac462d 100644
> --- a/sound/soc/codecs/rt1320-sdw.c
> +++ b/sound/soc/codecs/rt1320-sdw.c
> @@ -1480,7 +1480,7 @@ static int rt1320_rae_load(struct rt1320_sdw_priv
> *rt1320)
>                 /* RAE stop & CRC disable */
>                 regmap_update_bits(rt1320->regmap, 0xe803, 0xbc,
> 0x00);
> 
> -               while (retry--) {
> +               while (--retry) {
>                         regmap_read(rt1320->regmap, 0xe83f, &value);
>                         if (value & 0x40)
>                                 break;
> --

Acked-by: Shuming Fan <shumingf@realtek.com>

Thanks for this patch.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH next] ASoC: rt1320: Fix retry checking in rt1320_rae_load()
  2025-12-20  8:45 [PATCH next] ASoC: rt1320: Fix retry checking in rt1320_rae_load() Dan Carpenter
  2025-12-22  1:54 ` Shuming [范書銘]
@ 2025-12-22 17:50 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2025-12-22 17:50 UTC (permalink / raw)
  To: Shuming Fan, Dan Carpenter
  Cc: Oder Chiou, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	linux-sound, linux-kernel, kernel-janitors

On Sat, 20 Dec 2025 11:45:40 +0300, Dan Carpenter wrote:
> This loop iterates 200 times and then gives up.  The problem is that
> currently the loop exits with "retry" set to -1 on the failure path but
> the check for failure expects it to be 0.  Change from a post-op to a
> pre-op so that it exits with "retry" set to 0.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: rt1320: Fix retry checking in rt1320_rae_load()
      commit: c6bca73d699cfe00d3419566fdb2a45e112f44b0

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-12-22 17:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-20  8:45 [PATCH next] ASoC: rt1320: Fix retry checking in rt1320_rae_load() Dan Carpenter
2025-12-22  1:54 ` Shuming [范書銘]
2025-12-22 17:50 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox