Skip to contentSkip to conversation

fsi: master-ast-cf: don't sleep in reset_cf() under local_irq_save()

PATCH New Hyunjung Ko 1 participant 1 message Nov 18

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fsi: master-ast-cf: don't sleep in reset_cf() under local_irq_save()

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")
---
 drivers/fsi/fsi-master-ast-cf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/fsi/fsi-master-ast-cf.c +2 -2
index c3ac76bf7e97..787464c8b7f0 100644
@@ -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)
Signature · 1 line
2.43.0