From ebf991e990f43f664340016c6825ee4c3cbd5e78 Mon Sep 17 00:00:00 2001 From: Sang-Hun Lee Date: Tue, 3 Jun 2014 13:28:45 -0700 Subject: gpu: nvgpu: flush write before unlocking - gk20a_enable is reading the clock after unlocking the spinlock to flush any previous write - This could lead to a race if any write afterwards assume the write has been completed already - Read the clock before unlocking to ensure all previous writes have been completed before letting any other thread use gk20a Bug 200007520 Change-Id: I737fbbe825c68b25ca256c4a8ee2b99aa8baf0f5 Signed-off-by: Sang-Hun Lee Reviewed-on: http://git-master/r/418485 (cherry picked from commit 2aed542a719caa69620766bf2dceefe50626c189) Reviewed-on: http://git-master/r/437842 Reviewed-by: Mitch Luban Tested-by: Mitch Luban --- drivers/gpu/nvgpu/gk20a/gk20a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 0eaf31fa..b0aef022 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -1656,8 +1656,8 @@ void gk20a_enable(struct gk20a *g, u32 units) pmc = gk20a_readl(g, mc_enable_r()); pmc |= units; gk20a_writel(g, mc_enable_r(), pmc); - spin_unlock(&g->mc_enable_lock); gk20a_readl(g, mc_enable_r()); + spin_unlock(&g->mc_enable_lock); udelay(20); } -- cgit v1.2.2