summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index 976e9171..f5c3bd62 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -5224,6 +5224,7 @@ static int gk20a_gr_handle_notify_pending(struct gk20a *g,
5224 5224
5225/* Used by sw interrupt thread to translate current ctx to chid. 5225/* Used by sw interrupt thread to translate current ctx to chid.
5226 * For performance, we don't want to go through 128 channels every time. 5226 * For performance, we don't want to go through 128 channels every time.
5227 * curr_ctx should be the value read from gr_fecs_current_ctx_r().
5227 * A small tlb is used here to cache translation */ 5228 * A small tlb is used here to cache translation */
5228static int gk20a_gr_get_chid_from_ctx(struct gk20a *g, u32 curr_ctx) 5229static int gk20a_gr_get_chid_from_ctx(struct gk20a *g, u32 curr_ctx)
5229{ 5230{
@@ -5232,6 +5233,13 @@ static int gk20a_gr_get_chid_from_ctx(struct gk20a *g, u32 curr_ctx)
5232 u32 chid = -1; 5233 u32 chid = -1;
5233 u32 i; 5234 u32 i;
5234 5235
5236 /* when contexts are unloaded from GR, the valid bit is reset
5237 * but the instance pointer information remains intact. So the
5238 * valid bit must be checked to be absolutely certain that a
5239 * valid context is currently resident. */
5240 if (!gr_fecs_current_ctx_valid_v(curr_ctx))
5241 return -1;
5242
5235 spin_lock(&gr->ch_tlb_lock); 5243 spin_lock(&gr->ch_tlb_lock);
5236 5244
5237 /* check cache first */ 5245 /* check cache first */