From: Olivier MOYSAN <olivier.moysan@foss.st.com>
To: Avi Weiss <thnkslprpt@gmail.com>, Mark Brown <broonie@kernel.org>
Cc: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>,
Liam Girdwood <lgirdwood@gmail.com>,
<linux-sound@vger.kernel.org>,
<linux-stm32@st-md-mailman.stormreply.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ASoC: stm32: spdifrx: fix synchronization state check
Date: Mon, 12 Oct 2026 17:59:35 +0200 [thread overview]
Message-ID: <ecd02e00-f635-4638-9a72-c11b8f57eebc@foss.st.com> (raw)
In-Reply-To: <20261011035459.2289403-1-thnkslprpt@gmail.com>
Hi Avi,
On 10/11/26 05:54, Avi Weiss wrote:
> The interrupt handler uses a logical AND to check whether SPDIFRX
> was in the SYNC state before clearing errors. Since both SYNC (1)
> and ENABLE (3) are nonzero, this also treats ENABLE as SYNC (and
> any other non-zero value that might be added).
>
> The logical && basically just converts this to check for != 0.
>
> So errors occurring while SPDIFRX is enabled cause the driver
> to retry synch instead of disconnecting the PCM stream.
>
> Fix is to change the logical && to equality (==) and only retry
> when exactly in sync state.
>
> Fixes: 0c93c291321f2 ("ASoC: stm32: spdifrx: retry synchronization in sync state")
> Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
> ---
> sound/soc/stm/stm32_spdifrx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/soc/stm/stm32_spdifrx.c b/sound/soc/stm/stm32_spdifrx.c
> index 0ece547407739..88863dbd05d9b 100644
> --- a/sound/soc/stm/stm32_spdifrx.c
> +++ b/sound/soc/stm/stm32_spdifrx.c
> @@ -720,7 +720,7 @@ static irqreturn_t stm32_spdifrx_isr(int irq, void *devid)
>
> if (err) {
> regmap_read(spdifrx->regmap, STM32_SPDIFRX_CR, &cr);
> - sync_state = FIELD_GET(SPDIFRX_CR_SPDIFEN_MASK, cr) &&
> + sync_state = FIELD_GET(SPDIFRX_CR_SPDIFEN_MASK, cr) ==
> SPDIFRX_SPDIFEN_SYNC;
>
> /* SPDIFRX is in STATE_STOP. Disable SPDIFRX to clear errors */
>
> base-commit: 611680f6050a66b84e5cc0af33862a83d1f7a200
Reviewed-by: Olivier Moysan <olivier.moysan@foss.st.com>
Thanks
Olivier
next prev parent reply other threads:[~2026-10-12 15:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-11 3:54 Avi Weiss
2026-10-12 15:59 ` Olivier MOYSAN [this message]
2026-10-12 18:23 ` 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=ecd02e00-f635-4638-9a72-c11b8f57eebc@foss.st.com \
--to=olivier.moysan@foss.st.com \
--cc=arnaud.pouliquen@foss.st.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=thnkslprpt@gmail.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
all inboxes | Powered by JetHome®