arm/imx9: Replace spinlock/sched_lock with spin_lock_irqsave_nopreempt

Replace the spinlock/sched_lock pair in arm/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:24:52 +08:00
committed by Xiang Xiao
parent 26af1fadc9
commit 8978be2939
2 changed files with 6 additions and 12 deletions

View File

@@ -242,11 +242,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
@@ -474,8 +472,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 */
@@ -527,8 +524,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);
}
/****************************************************************************

View File

@@ -813,8 +813,7 @@ static int imx9_txpoll(struct net_driver_s *dev)
* the field d_len is set to a value > 0.
*/
flags = spin_lock_irqsave(&priv->lock);
sched_lock();
flags = spin_lock_irqsave_nopreempt(&priv->lock);
if (priv->dev.d_len > 0)
{
@@ -834,8 +833,7 @@ static int imx9_txpoll(struct net_driver_s *dev)
}
}
spin_unlock_irqrestore(&priv->lock, flags);
sched_unlock();
spin_unlock_irqrestore_nopreempt(&priv->lock, flags);
/* If zero is returned, the polling will continue until all connections
* have been examined.