summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2016-10-14 11:57:05 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-11-07 18:47:49 -0500
commit5855fe26cb401d6d139b930ab48bb1106301585f (patch)
tree4aef6673f773db8730abfb12718dc11b1e0a27f4 /drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
parent5f1c2bc27fb9dd66ed046b0590afc365be5011bf (diff)
gpu: nvgpu: Do not post events to unbound channels
Change-Id: Ia1157198aad248e12e94823eb9f273497c724b2c Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1248366 Tested-by: Sachit Kadle <skadle@nvidia.com> Reviewed-by: David Martinez Nieto <dmartineznie@nvidia.com> GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/fifo_vgpu.c')
-rw-r--r--drivers/gpu/nvgpu/vgpu/fifo_vgpu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
index 3d00e72c..efeeb8ee 100644
--- a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
@@ -36,7 +36,8 @@ static void vgpu_channel_bind(struct channel_gk20a *ch)
36 err = vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg)); 36 err = vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg));
37 WARN_ON(err || msg.ret); 37 WARN_ON(err || msg.ret);
38 38
39 ch->bound = true; 39 wmb();
40 atomic_set(&ch->bound, true);
40} 41}
41 42
42static void vgpu_channel_unbind(struct channel_gk20a *ch) 43static void vgpu_channel_unbind(struct channel_gk20a *ch)
@@ -44,7 +45,7 @@ static void vgpu_channel_unbind(struct channel_gk20a *ch)
44 45
45 gk20a_dbg_fn(""); 46 gk20a_dbg_fn("");
46 47
47 if (ch->bound) { 48 if (atomic_cmpxchg(&ch->bound, true, false)) {
48 struct tegra_vgpu_cmd_msg msg; 49 struct tegra_vgpu_cmd_msg msg;
49 struct tegra_vgpu_channel_config_params *p = 50 struct tegra_vgpu_channel_config_params *p =
50 &msg.params.channel_config; 51 &msg.params.channel_config;
@@ -57,7 +58,6 @@ static void vgpu_channel_unbind(struct channel_gk20a *ch)
57 WARN_ON(err || msg.ret); 58 WARN_ON(err || msg.ret);
58 } 59 }
59 60
60 ch->bound = false;
61} 61}
62 62
63static int vgpu_channel_alloc_inst(struct gk20a *g, struct channel_gk20a *ch) 63static int vgpu_channel_alloc_inst(struct gk20a *g, struct channel_gk20a *ch)