mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fsi: master-ast-cf: don't sleep in reset_cf() under local_irq_save()
@ 2026-11-18  8:48 Hyunjung Ko
  0 siblings, 0 replies; only message in thread
From: Hyunjung Ko @ 2026-11-18  8:48 UTC (permalink / raw)
  To: Eddie James, Ninad Palsule; +Cc: linux-fsi, linux-kernel, stable, Hyunjung Ko

fsi_master_acf_terminate() calls reset_cf() with interrupts disabled via
local_irq_save(), but reset_cf() uses usleep_range(), which can sleep.
That is a sleep-in-atomic-context bug on the terminate path.

Switch the two 20 us delays to udelay(). reset_cf() is otherwise called
only from process context, so the short busy-wait is harmless there.

Fixes: 6a794a27daca ("fsi: master-ast-cf: Add new FSI master using Aspeed ColdFire")
Cc: stable@vger.kernel.org
Signed-off-by: Hyunjung Ko <hj351016@gmail.com>
---
 drivers/fsi/fsi-master-ast-cf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/fsi/fsi-master-ast-cf.c b/drivers/fsi/fsi-master-ast-cf.c
index c3ac76bf7e97..787464c8b7f0 100644
--- a/drivers/fsi/fsi-master-ast-cf.c
+++ b/drivers/fsi/fsi-master-ast-cf.c
@@ -690,9 +690,9 @@ static int fsi_master_acf_break(struct fsi_master *_master, int link)
 static void reset_cf(struct fsi_master_acf *master)
 {
 	regmap_write(master->scu, SCU_COPRO_CTRL, SCU_COPRO_RESET);
-	usleep_range(20,20);
+	udelay(20);
 	regmap_write(master->scu, SCU_COPRO_CTRL, 0);
-	usleep_range(20,20);
+	udelay(20);
 }
 
 static void start_cf(struct fsi_master_acf *master)
-- 
2.43.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-18  8:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-18  8:48 [PATCH] fsi: master-ast-cf: don't sleep in reset_cf() under local_irq_save() Hyunjung Ko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®