From c30f649c4f85929580490180122a1e8c5edb6098 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Tue, 8 Nov 2016 13:27:29 -0800 Subject: 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 Reviewed-on: http://git-master/r/1249964 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c') 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) return 0; gr_engine_id = gk20a_fifo_get_gr_engine_id(g); + if (gr_engine_id != FIFO_INVAL_ENGINE_ID) + gr_engine_id = BIT(gr_engine_id); grfifo_ctl = gk20a_readl(g, gr_gpfifo_ctl_r()); grfifo_ctl &= ~gr_gpfifo_ctl_semaphore_access_f(1); @@ -6371,13 +6373,13 @@ int gk20a_gr_isr(struct gk20a *g) if (need_reset) { if (tsgid != NVGPU_INVALID_TSG_ID) - gk20a_fifo_recover(g, BIT(gr_engine_id), + gk20a_fifo_recover(g, gr_engine_id, tsgid, true, true, true); else if (ch) - gk20a_fifo_recover(g, BIT(gr_engine_id), + gk20a_fifo_recover(g, gr_engine_id, ch->hw_chid, false, true, true); else - gk20a_fifo_recover(g, BIT(gr_engine_id), + gk20a_fifo_recover(g, gr_engine_id, 0, false, false, true); } -- cgit v1.2.2