From 9b7b5c3affdac7babeee111a2493baa90aace806 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Wed, 7 Sep 2016 10:26:28 -0700 Subject: gpu: nvgpu: Fix ordering of wmb() in gk20a_writel() Putting the wmb() before the write only ensures that any previous writes are done. But this doesn't really do anything for the writel_relaxed(). The point of the wmb() here is to ensure that the write performed by the writel_relaxed() is actually done before proceeding. Bug 1811382 Change-Id: I7250ea074b8548c899acfd34d816de466cf53b6f Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1216434 (cherry picked from commit c9aa02dc61138615d971902fe58dc6a113cdf00a) Reviewed-on: http://git-master/r/1223457 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/gk20a.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 83d388a7..72170362 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -1028,8 +1028,8 @@ int gk20a_restore_registers(struct gk20a *g); static inline void gk20a_writel(struct gk20a *g, u32 r, u32 v) { gk20a_dbg(gpu_dbg_reg, " r=0x%x v=0x%x", r, v); - wmb(); writel_relaxed(v, g->regs + r); + wmb(); } static inline u32 gk20a_readl(struct gk20a *g, u32 r) { -- cgit v1.2.2