From 72b565452ee1caeac67a478e69428bfb4efa6c40 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Wed, 8 Apr 2015 09:47:15 -0700 Subject: gpu: nvgpu: Fix timeout in gm20b's LTC flush The flush timeout should have been comparing between the current time (jiffies) not the snapshot in time when the L2 flush started. Change-Id: Idba0ccbfeeab9e3fadd0b5bed7073acefbd403e3 Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/729090 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gm20b/ltc_gm20b.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/gm20b/ltc_gm20b.c') diff --git a/drivers/gpu/nvgpu/gm20b/ltc_gm20b.c b/drivers/gpu/nvgpu/gm20b/ltc_gm20b.c index 9090be23..03307c01 100644 --- a/drivers/gpu/nvgpu/gm20b/ltc_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/ltc_gm20b.c @@ -286,15 +286,16 @@ u32 gm20b_ltc_cbc_fix_config(struct gk20a *g, int base) void gm20b_flush_ltc(struct gk20a *g) { u32 op_pending; - unsigned long now, timeout; + unsigned long timeout; #define __timeout_init() \ do { \ - now = jiffies; timeout = now + HZ; \ + timeout = jiffies + HZ; \ } while (0) #define __timeout_check() \ do { \ - if (tegra_platform_is_silicon() && time_after(now, timeout)) { \ + if (tegra_platform_is_silicon() && \ + time_after(jiffies, timeout)) { \ gk20a_err(dev_from_gk20a(g), "L2 flush timeout!"); \ break; \ } \ -- cgit v1.2.2