fsi: master-ast-cf: don't sleep in reset_cf() under local_irq_save()
Subsystems (2)
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")
Signed-off-by Hyunjung Ko <[email protected]>
--- drivers/fsi/fsi-master-ast-cf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/fsi/fsi-master-ast-cf.c +2 -2
@@ -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