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: <CAMuHMdWhWJfuMFoXdbubg3MuJXsFPAoEMCifLOiP-wJanmg1kQ@mail.gmail.com>
Date: Mon, 9 Dec 2024 15:09:02 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Claudiu <claudiu.beznea@...on.dev>
Cc: mturquette@...libre.com, sboyd@...nel.org, robh@...nel.org, 
	krzk+dt@...nel.org, conor+dt@...nel.org, biju.das.jz@...renesas.com, 
	prabhakar.mahadev-lad.rj@...renesas.com, lgirdwood@...il.com, 
	broonie@...nel.org, magnus.damm@...il.com, linus.walleij@...aro.org, 
	perex@...ex.cz, tiwai@...e.com, p.zabel@...gutronix.de, 
	linux-renesas-soc@...r.kernel.org, linux-clk@...r.kernel.org, 
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org, 
	linux-sound@...r.kernel.org, linux-gpio@...r.kernel.org, 
	Claudiu Beznea <claudiu.beznea.uj@...renesas.com>
Subject: Re: [PATCH v3 18/25] ASoC: renesas: rz-ssi: Issue software reset in
 hw_params API

On Wed, Nov 13, 2024 at 2:36 PM Claudiu <claudiu.beznea@...on.dev> wrote:
> From: Claudiu Beznea <claudiu.beznea.uj@...renesas.com>
>
> The code initially issued software reset on SNDRV_PCM_TRIGGER_START
> action only before starting the first stream. This can be easily moved to
> hw_params() as the action is similar to setting the clocks. Moreover,
> according to the hardware manual (Table 35.7 Bits Initialized by Software
> Reset of the SSIFCR.SSIRST Bit) the software reset action acts also on the
> clock dividers bits. Due to this issue the software reset in hw_params()
> before configuring the clock dividers. This also simplifies the code in
> trigger API.
>
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@...renesas.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>

> --- a/sound/soc/renesas/rz-ssi.c
> +++ b/sound/soc/renesas/rz-ssi.c
> @@ -388,6 +388,15 @@ static int rz_ssi_start(struct rz_ssi_priv *ssi, struct rz_ssi_stream *strm)
>         return 0;
>  }
>
> +static int rz_ssi_swreset(struct rz_ssi_priv *ssi)
> +{
> +       u32 tmp;
> +
> +       rz_ssi_reg_mask_setl(ssi, SSIFCR, SSIFCR_SSIRST, SSIFCR_SSIRST);

Nit: no need to clear SSIFCR_SSIRST first:

    rz_ssi_reg_mask_setl(ssi, SSIFCR, 0, SSIFCR_SSIRST);

cfr. what the original code did below.

> +       rz_ssi_reg_mask_setl(ssi, SSIFCR, SSIFCR_SSIRST, 0);
> +       return readl_poll_timeout_atomic(ssi->base + SSIFCR, tmp, !(tmp & SSIFCR_SSIRST), 1, 5);
> +}
> +
>  static int rz_ssi_stop(struct rz_ssi_priv *ssi, struct rz_ssi_stream *strm)
>  {
>         strm->running = 0;
> @@ -782,14 +791,6 @@ static int rz_ssi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
>
>         switch (cmd) {
>         case SNDRV_PCM_TRIGGER_START:
> -               /* Soft Reset */
> -               if (!rz_ssi_is_stream_running(&ssi->playback) &&
> -                   !rz_ssi_is_stream_running(&ssi->capture)) {
> -                       rz_ssi_reg_mask_setl(ssi, SSIFCR, 0, SSIFCR_SSIRST);
> -                       rz_ssi_reg_mask_setl(ssi, SSIFCR, SSIFCR_SSIRST, 0);
> -                       udelay(5);
> -               }
> -
>                 rz_ssi_stream_init(strm, substream);
>
>                 if (ssi->dma_rt) {

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