From: Yongjin Lee Date: Sun, 9 Feb 2014 11:37:51 +0000 (+0900) Subject: dma: pl330: Changed the timeout function X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9f55f2448184bf7588abbadea7e6303ea0ca0f11;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git dma: pl330: Changed the timeout function Change-Id: I52449c51ade4ca3a4fe24a4988bc9912d7aecfb7 Signed-off-by: Yongjin Lee Signed-off-by: Seokju Yoon --- diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index b3832ca2ee8e..3f23c5137517 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -851,26 +851,21 @@ static inline u32 _emit_GO(unsigned dry_run, u8 buf[], 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,