summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2016-11-08 16:27:29 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2016-11-11 11:20:52 -0500
commitc30f649c4f85929580490180122a1e8c5edb6098 (patch)
treec997d2ba8761648ba65b395ad385152e4df505aa /drivers/gpu/nvgpu/gk20a/gr_gk20a.c
parent719682688e50c4d3517d56e2f805753e695741f4 (diff)
gpu: nvgpu: Do not use invalid engine ID in bitshift
In calls to gk20a_fifo_recover() we pass a bitfield of engines to recover. We generate the bitfield by acquiring engine id from FIFO, and using BIT(). If GR engine is now known, the resulting engine ID is u32 with all bits set, which cannot be passed to BIT(). gk20a_fifo_recover() can already deal with all bits set, so pass that verbatim instead. Change-Id: Ib79d8e7e156deef0d483642cfb1ce7bf55f3c572 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1249964 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index 4dbdb777..0e8c1884 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -6212,6 +6212,8 @@ int gk20a_gr_isr(struct gk20a *g)
6212 return 0; 6212 return 0;
6213 6213
6214 gr_engine_id = gk20a_fifo_get_gr_engine_id(g); 6214 gr_engine_id = gk20a_fifo_get_gr_engine_id(g);
6215 if (gr_engine_id != FIFO_INVAL_ENGINE_ID)
6216 gr_engine_id = BIT(gr_engine_id);
6215 6217
6216 grfifo_ctl = gk20a_readl(g, gr_gpfifo_ctl_r()); 6218 grfifo_ctl = gk20a_readl(g, gr_gpfifo_ctl_r());
6217 grfifo_ctl &= ~gr_gpfifo_ctl_semaphore_access_f(1); 6219 grfifo_ctl &= ~gr_gpfifo_ctl_semaphore_access_f(1);
@@ -6371,13 +6373,13 @@ int gk20a_gr_isr(struct gk20a *g)
6371 6373
6372 if (need_reset) { 6374 if (need_reset) {
6373 if (tsgid != NVGPU_INVALID_TSG_ID) 6375 if (tsgid != NVGPU_INVALID_TSG_ID)
6374 gk20a_fifo_recover(g, BIT(gr_engine_id), 6376 gk20a_fifo_recover(g, gr_engine_id,
6375 tsgid, true, true, true); 6377 tsgid, true, true, true);
6376 else if (ch) 6378 else if (ch)
6377 gk20a_fifo_recover(g, BIT(gr_engine_id), 6379 gk20a_fifo_recover(g, gr_engine_id,
6378 ch->hw_chid, false, true, true); 6380 ch->hw_chid, false, true, true);
6379 else 6381 else
6380 gk20a_fifo_recover(g, BIT(gr_engine_id), 6382 gk20a_fifo_recover(g, gr_engine_id,
6381 0, false, false, true); 6383 0, false, false, true);
6382 } 6384 }
6383 6385