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: <CAMuHMdUdiczsrB8H57VjPbcaWWS22HmUvc_iU3rs84qHAsfB6A@mail.gmail.com>
Date: Thu, 13 Nov 2025 09:51:02 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Biju <biju.das.au@...il.com>
Cc: Biju Das <biju.das.jz@...renesas.com>, 
	Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>, 
	Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>, Liam Girdwood <lgirdwood@...il.com>, 
	Mark Brown <broonie@...nel.org>, Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>, 
	linux-sound@...r.kernel.org, linux-renesas-soc@...r.kernel.org, 
	linux-kernel@...r.kernel.org, Geert Uytterhoeven <geert+renesas@...der.be>, stable@...nel.org, 
	Tony Tang <tony.tang.ks@...esas.com>
Subject: Re: [PATCH v2 1/2] ASoC: renesas: rz-ssi: Fix channel swap issue in
 full duplex mode

Hi Biju,

On Thu, 13 Nov 2025 at 09:25, Biju <biju.das.au@...il.com> wrote:
> From: Biju Das <biju.das.jz@...renesas.com>
>
> The full duplex audio starts with half duplex mode and then switch to
> full duplex mode (another FIFO reset) when both playback/capture
> streams available leading to random audio left/right channel swap
> issue. Fix this channel swap issue by detecting the full duplex
> condition by populating struct dup variable in startup() callback
> and synchronize starting both the play and capture at the same time
> in rz_ssi_start().
>
> Cc: stable@...nel.org
> Fixes: 4f8cd05a4305 ("ASoC: sh: rz-ssi: Add full duplex support")
> Co-developed-by: Tony Tang <tony.tang.ks@...esas.com>
> Signed-off-by: Tony Tang <tony.tang.ks@...esas.com>
> Reviewed-by: Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
> Signed-off-by: Biju Das <biju.das.jz@...renesas.com>

Thanks for your patch!

> --- a/sound/soc/renesas/rz-ssi.c
> +++ b/sound/soc/renesas/rz-ssi.c
> @@ -374,12 +379,18 @@ static int rz_ssi_start(struct rz_ssi_priv *ssi, struct rz_ssi_stream *strm)
>                               SSISR_RUIRQ), 0);
>
>         strm->running = 1;
> -       if (is_full_duplex)
> -               ssicr |= SSICR_TEN | SSICR_REN;
> -       else
> +       if (is_full_duplex) {
> +               if (ssi->dup.one_stream_triggered) {
> +                       ssicr |= SSICR_TEN | SSICR_REN;
> +                       rz_ssi_reg_writel(ssi, SSICR, ssicr);
> +                       ssi->dup.one_stream_triggered = false;
> +               } else {
> +                       ssi->dup.one_stream_triggered = true;
> +               }
> +       } else {
>                 ssicr |= is_play ? SSICR_TEN : SSICR_REN;
> -
> -       rz_ssi_reg_writel(ssi, SSICR, ssicr);
> +               rz_ssi_reg_writel(ssi, SSICR, ssicr);
> +       }

You can reduce indentation by restructuring the tests:

    if (!is_full_duplex) {
            ...
    } else if (ssi->dup.one_stream_triggered) {
            ...
    } else {
            ...
   }

>
>         return 0;
>  }

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ