[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdX9K+2mqAg+4JUX3oY-HmHTtkP5NTZoTXJX-Y=jSJEcMg@mail.gmail.com>
Date: Wed, 11 Dec 2024 13:35:45 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Claudiu <claudiu.beznea@...on.dev>
Cc: mturquette@...libre.com, sboyd@...nel.org, robh+dt@...nel.org,
lgirdwood@...il.com, broonie@...nel.org, magnus.damm@...il.com,
perex@...ex.cz, tiwai@...e.com, p.zabel@...gutronix.de,
biju.das.jz@...renesas.com, linux-renesas-soc@...r.kernel.org,
linux-clk@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, alsa-devel@...a-project.org,
Claudiu Beznea <claudiu.beznea.uj@...renesas.com>, stable@...r.kernel.org
Subject: Re: [PATCH v4 04/24] ASoC: renesas: rz-ssi: Terminate all the DMA transactions
On Tue, Dec 10, 2024 at 6:10 PM Claudiu <claudiu.beznea@...on.dev> wrote:
> From: Claudiu Beznea <claudiu.beznea.uj@...renesas.com>
>
> The stop trigger invokes rz_ssi_stop() and rz_ssi_stream_quit().
> - The purpose of rz_ssi_stop() is to disable TX/RX, terminate DMA
> transactions, and set the controller to idle.
> - The purpose of rz_ssi_stream_quit() is to reset the substream-specific
> software data by setting strm->running and strm->substream appropriately.
>
> The function rz_ssi_is_stream_running() checks if both strm->substream and
> strm->running are valid and returns true if so. Its implementation is as
> follows:
>
> static inline bool rz_ssi_is_stream_running(struct rz_ssi_stream *strm)
> {
> return strm->substream && strm->running;
> }
>
> When the controller is configured in full-duplex mode (with both playback
> and capture active), the rz_ssi_stop() function does not modify the
> controller settings when called for the first substream in the full-duplex
> setup. Instead, it simply sets strm->running = 0 and returns if the
> companion substream is still running. The following code illustrates this:
>
> static int rz_ssi_stop(struct rz_ssi_priv *ssi, struct rz_ssi_stream *strm)
> {
> strm->running = 0;
>
> if (rz_ssi_is_stream_running(&ssi->playback) ||
> rz_ssi_is_stream_running(&ssi->capture))
> return 0;
>
> // ...
> }
>
> The controller settings, along with the DMA termination (for the last
> stopped substream), are only applied when the last substream in the
> full-duplex setup is stopped.
>
> While applying the controller settings only when the last substream stops
> is not problematic, terminating the DMA operations for only one substream
> causes failures when starting and stopping full-duplex operations multiple
> times in a loop.
>
> To address this issue, call dmaengine_terminate_async() for both substreams
> involved in the full-duplex setup when the last substream in the setup is
> stopped.
>
> Fixes: 4f8cd05a4305 ("ASoC: sh: rz-ssi: Add full duplex support")
> Cc: stable@...r.kernel.org
> Reviewed-by: Biju Das <biju.das.jz@...renesas.com>
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@...renesas.com>
> ---
>
> Changes in v4:
> - updated patch description
Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>
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