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>
This commit is contained in:
Terje Bergstrom
2016-11-08 13:27:29 -08:00
committed by mobile promotions
parent 719682688e
commit c30f649c4f

View File

@@ -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);
}