From: "Shuming [范書銘]" <shumingf@realtek.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Oder Chiou <oder_chiou@realtek.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
"Takashi Iwai" <tiwai@suse.com>,
"linux-sound@vger.kernel.org" <linux-sound@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kernel-janitors@vger.kernel.org"
<kernel-janitors@vger.kernel.org>
Subject: RE: [PATCH next] ASoC: rt1320: Fix retry checking in rt1320_rae_load()
Date: Mon, 22 Dec 2025 01:54:12 +0000 [thread overview]
Message-ID: <98f9d4af7fd245358d49081fd3632bf9@realtek.com> (raw)
In-Reply-To: <aUZiNJ7pzuahXFYE@stanley.mountain>
> 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.
next prev parent reply other threads:[~2025-12-22 1:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-20 8:45 [PATCH next] ASoC: rt1320: Fix retry checking in rt1320_rae_load() Dan Carpenter
2025-12-22 1:54 ` Shuming [范書銘] [this message]
2025-12-22 17:50 ` Mark Brown
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=98f9d4af7fd245358d49081fd3632bf9@realtek.com \
--to=shumingf@realtek.com \
--cc=broonie@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=oder_chiou@realtek.com \
--cc=perex@perex.cz \
--cc=tiwai@suse.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