summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a.c
diff options
context:
space:
mode:
authorSang-Hun Lee <sanlee@nvidia.com>2014-06-03 16:28:45 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:10:33 -0400
commitebf991e990f43f664340016c6825ee4c3cbd5e78 (patch)
tree80c9e184f75114f8b114ab17c7ab8f394439122a /drivers/gpu/nvgpu/gk20a/gk20a.c
parent5312fd2a1852cd965c8aea473aa357f4d9d65318 (diff)
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 <sanlee@nvidia.com> Reviewed-on: http://git-master/r/418485 (cherry picked from commit 2aed542a719caa69620766bf2dceefe50626c189) Reviewed-on: http://git-master/r/437842 Reviewed-by: Mitch Luban <mluban@nvidia.com> Tested-by: Mitch Luban <mluban@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c2
1 files changed, 1 insertions, 1 deletions
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)
1656 pmc = gk20a_readl(g, mc_enable_r()); 1656 pmc = gk20a_readl(g, mc_enable_r());
1657 pmc |= units; 1657 pmc |= units;
1658 gk20a_writel(g, mc_enable_r(), pmc); 1658 gk20a_writel(g, mc_enable_r(), pmc);
1659 spin_unlock(&g->mc_enable_lock);
1660 gk20a_readl(g, mc_enable_r()); 1659 gk20a_readl(g, mc_enable_r());
1660 spin_unlock(&g->mc_enable_lock);
1661 1661
1662 udelay(20); 1662 udelay(20);
1663} 1663}