summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2016-11-08 16:36:17 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2016-11-11 11:21:06 -0500
commit268e772e807460cee64e354c025d43d8e24574b8 (patch)
treef2f4232c4530070f238c95759ad7f2eb5a9f1d14 /drivers/gpu/nvgpu/gm20b/fifo_gm20b.c
parentc30f649c4f85929580490180122a1e8c5edb6098 (diff)
gpu: nvgpu: Deal with invalid MMU id
If gk20a_engine_id_to_mmu_id() fails, it returns ~0. Deal with this by checking the results in each call to it. Change-Id: I6fb9f7151f21a6c4694bfb2ea3c960d344fe629f Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1249965 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/fifo_gm20b.c')
-rw-r--r--drivers/gpu/nvgpu/gm20b/fifo_gm20b.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c b/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c
index a8934035..3b877db1 100644
--- a/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c
@@ -74,16 +74,15 @@ static void gm20b_fifo_trigger_mmu_fault(struct gk20a *g,
74 74
75 /* trigger faults for all bad engines */ 75 /* trigger faults for all bad engines */
76 for_each_set_bit(engine_id, &engine_ids, 32) { 76 for_each_set_bit(engine_id, &engine_ids, 32) {
77 u32 engine_mmu_fault_id;
78
79 if (!gk20a_fifo_is_valid_engine_id(g, engine_id)) { 77 if (!gk20a_fifo_is_valid_engine_id(g, engine_id)) {
80 gk20a_err(dev_from_gk20a(g), 78 gk20a_err(dev_from_gk20a(g),
81 "faulting unknown engine %ld", engine_id); 79 "faulting unknown engine %ld", engine_id);
82 } else { 80 } else {
83 engine_mmu_fault_id = gm20b_engine_id_to_mmu_id(g, 81 u32 mmu_id = gm20b_engine_id_to_mmu_id(g,
84 engine_id); 82 engine_id);
85 gk20a_writel(g, fifo_trigger_mmu_fault_r(engine_id), 83 if (mmu_id != ~0)
86 fifo_trigger_mmu_fault_enable_f(1)); 84 gk20a_writel(g, fifo_trigger_mmu_fault_r(mmu_id),
85 fifo_trigger_mmu_fault_enable_f(1));
87 } 86 }
88 } 87 }
89 88