Patch "ASoC: renesas: rz-ssi: Terminate all the DMA transactions" has been added to the 6.12-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ASoC: renesas: rz-ssi: Terminate all the DMA transactions

to the 6.12-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     asoc-renesas-rz-ssi-terminate-all-the-dma-transactio.patch
and it can be found in the queue-6.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 29a934ba17354e10bb925baa97ff0d3a6d09acd0
Author: Claudiu Beznea <claudiu.beznea.uj@xxxxxxxxxxxxxx>
Date:   Tue Dec 10 19:09:33 2024 +0200

    ASoC: renesas: rz-ssi: Terminate all the DMA transactions
    
    [ Upstream commit 541011dc2d7c4c82523706f726f422a5e23cc86f ]
    
    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@xxxxxxxxxxxxxxx
    Reviewed-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
    Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@xxxxxxxxxxxxxx>
    Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
    Link: https://patch.msgid.link/20241210170953.2936724-5-claudiu.beznea.uj@xxxxxxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/sound/soc/sh/rz-ssi.c b/sound/soc/sh/rz-ssi.c
index 32db2cead8a4e..1b74dc1137958 100644
--- a/sound/soc/sh/rz-ssi.c
+++ b/sound/soc/sh/rz-ssi.c
@@ -416,8 +416,12 @@ static int rz_ssi_stop(struct rz_ssi_priv *ssi, struct rz_ssi_stream *strm)
 	rz_ssi_reg_mask_setl(ssi, SSICR, SSICR_TEN | SSICR_REN, 0);
 
 	/* Cancel all remaining DMA transactions */
-	if (rz_ssi_is_dma_enabled(ssi))
-		dmaengine_terminate_async(strm->dma_ch);
+	if (rz_ssi_is_dma_enabled(ssi)) {
+		if (ssi->playback.dma_ch)
+			dmaengine_terminate_async(ssi->playback.dma_ch);
+		if (ssi->capture.dma_ch)
+			dmaengine_terminate_async(ssi->capture.dma_ch);
+	}
 
 	rz_ssi_set_idle(ssi);
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux