diff mbox series

dmaengine: sh: rz-dmac: Fix lockdep assert warning

Message ID 20240625170119.173595-1-biju.das.jz@bp.renesas.com (mailing list archive)
State Accepted
Commit 0e53aa3464e9a0a82bd3b926ba5999a11569c9ba
Headers show
Series dmaengine: sh: rz-dmac: Fix lockdep assert warning | expand

Commit Message

Biju Das June 25, 2024, 5:01 p.m. UTC
Fix the below lockdep assert warning by holding vc.lock for
vchan_get_all_descriptors().

WARNING: virt-dma.h:188 rz_dmac_terminate_all
pc : rz_dmac_terminate_all

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 drivers/dma/sh/rz-dmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Geert Uytterhoeven June 26, 2024, 9:03 a.m. UTC | #1
On Tue, Jun 25, 2024 at 7:01 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> Fix the below lockdep assert warning by holding vc.lock for
> vchan_get_all_descriptors().
>
> WARNING: virt-dma.h:188 rz_dmac_terminate_all
> pc : rz_dmac_terminate_all
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>

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

Gr{oetje,eeting}s,

                        Geert
Vinod Koul June 28, 2024, 10:10 a.m. UTC | #2
On Tue, 25 Jun 2024 18:01:16 +0100, Biju Das wrote:
> Fix the below lockdep assert warning by holding vc.lock for
> vchan_get_all_descriptors().
> 
> WARNING: virt-dma.h:188 rz_dmac_terminate_all
> pc : rz_dmac_terminate_all
> 
> 
> [...]

Applied, thanks!

[1/1] dmaengine: sh: rz-dmac: Fix lockdep assert warning
      commit: 0e53aa3464e9a0a82bd3b926ba5999a11569c9ba

Best regards,
diff mbox series

Patch

diff --git a/drivers/dma/sh/rz-dmac.c b/drivers/dma/sh/rz-dmac.c
index 1f1e86ba5c66..65a27c5a7bce 100644
--- a/drivers/dma/sh/rz-dmac.c
+++ b/drivers/dma/sh/rz-dmac.c
@@ -540,8 +540,8 @@  static int rz_dmac_terminate_all(struct dma_chan *chan)
 	spin_lock_irqsave(&channel->vc.lock, flags);
 	list_splice_tail_init(&channel->ld_active, &channel->ld_free);
 	list_splice_tail_init(&channel->ld_queue, &channel->ld_free);
-	spin_unlock_irqrestore(&channel->vc.lock, flags);
 	vchan_get_all_descriptors(&channel->vc, &head);
+	spin_unlock_irqrestore(&channel->vc.lock, flags);
 	vchan_dma_desc_free_list(&channel->vc, &head);
 
 	return 0;