From 6c28a2b749187f9e4b29c387155c19ae92dd4f71 Mon Sep 17 00:00:00 2001 From: wangchengdong Date: Tue, 4 Nov 2025 13:26:43 +0800 Subject: [PATCH] arm64/imx9: Replace spinlock/sched_lock with spin_lock_irqsave_nopreempt Replace the spinlock/sched_lock pair in arm64/imx9 with spin_lock_irqsave_nopreempt() to improve code clarity and consistency. Signed-off-by: Chengdong Wang wangchengdong@lixiang.com --- arch/arm64/src/imx9/imx9_edma.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/arch/arm64/src/imx9/imx9_edma.c b/arch/arm64/src/imx9/imx9_edma.c index d610c5b26ae..6ae182cb398 100644 --- a/arch/arm64/src/imx9/imx9_edma.c +++ b/arch/arm64/src/imx9/imx9_edma.c @@ -238,11 +238,9 @@ static void imx9_tcd_free(struct imx9_edmatcd_s *tcd) * a TCD. */ - flags = spin_lock_irqsave(&g_edma.lock); - sched_lock(); + flags = spin_lock_irqsave_nopreempt(&g_edma.lock); imx9_tcd_free_nolock(tcd); - spin_unlock_irqrestore(&g_edma.lock, flags); - sched_unlock(); + spin_unlock_irqrestore_nopreempt(&g_edma.lock, flags); } #endif @@ -454,8 +452,7 @@ static void imx9_dmaterminate(struct imx9_dmach_s *dmach, int result) irqstate_t flags; - flags = spin_lock_irqsave(&g_edma.lock); - sched_lock(); + flags = spin_lock_irqsave_nopreempt(&g_edma.lock); /* Disable channel IRQ requests */ @@ -507,8 +504,7 @@ static void imx9_dmaterminate(struct imx9_dmach_s *dmach, int result) callback((DMACH_HANDLE)dmach, arg, true, result); } - spin_unlock_irqrestore(&g_edma.lock, flags); - sched_unlock(); + spin_unlock_irqrestore_nopreempt(&g_edma.lock, flags); } /****************************************************************************