Change-Id: I52449c51ade4ca3a4fe24a4988bc9912d7aecfb7
Signed-off-by: Yongjin Lee <yongjin0.lee@samsung.com>
Signed-off-by: Seokju Yoon <sukju.yoon@samsung.com>
return SZ_DMAGO;
}
-#define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * t)
-
/* Returns Time-Out */
static bool _until_dmac_idle(struct pl330_thread *thrd)
{
void __iomem *regs = thrd->dmac->base;
- unsigned long loops = msecs_to_loops(5);
+ unsigned long timeout = jiffies + msecs_to_jiffies(5);
do {
/* Until Manager is Idle */
if (!(readl(regs + DBGSTATUS) & DBG_BUSY))
- break;
+ return false;
cpu_relax();
- } while (--loops);
+ } while (time_before(jiffies, timeout));
- if (!loops)
- return true;
-
- return false;
+ return true;
}
static inline void _execute_DBGINSN(struct pl330_thread *thrd,