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
This commit is contained in:
wangchengdong
2025-11-04 13:26:43 +08:00
committed by Xiang Xiao
parent 5b4d2dda9d
commit 6c28a2b749

View File

@@ -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);
}
/****************************************************************************