summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Benech <nbenech@nvidia.com>2018-08-30 13:55:37 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-09-06 19:13:52 -0400
commitba1245d8f74816189af0fc3e0d0d1c642f87cdf2 (patch)
treeff736e29e9dc62e8c7ffac6afcf12790b5f374b2
parent5cfd481cf5319d52f613cb5c5f66a1f643af5bed (diff)
gpu: nvgpu: Add return code to fb.tlb_invalidate
As part of MISRA 17.7 fixes for a different GPU, the tlb_invalidate needs to return an error code. Change-Id: I3b8b9f112708c17457855dd1fb151168791bc6bf Signed-off-by: Nicolas Benech <nbenech@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1810106 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/common/fb/fb_gm20b.c7
-rw-r--r--drivers/gpu/nvgpu/common/fb/fb_gm20b.h2
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h2
-rw-r--r--drivers/gpu/nvgpu/vgpu/mm_vgpu.c3
-rw-r--r--drivers/gpu/nvgpu/vgpu/mm_vgpu.h2
5 files changed, 10 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/common/fb/fb_gm20b.c b/drivers/gpu/nvgpu/common/fb/fb_gm20b.c
index b4756546..65b7336c 100644
--- a/drivers/gpu/nvgpu/common/fb/fb_gm20b.c
+++ b/drivers/gpu/nvgpu/common/fb/fb_gm20b.c
@@ -60,11 +60,12 @@ void gm20b_fb_init_hw(struct gk20a *g)
60 gk20a_writel(g, fb_niso_flush_sysmem_addr_r(), addr); 60 gk20a_writel(g, fb_niso_flush_sysmem_addr_r(), addr);
61} 61}
62 62
63void gm20b_fb_tlb_invalidate(struct gk20a *g, struct nvgpu_mem *pdb) 63int gm20b_fb_tlb_invalidate(struct gk20a *g, struct nvgpu_mem *pdb)
64{ 64{
65 struct nvgpu_timeout timeout; 65 struct nvgpu_timeout timeout;
66 u32 addr_lo; 66 u32 addr_lo;
67 u32 data; 67 u32 data;
68 int err = 0;
68 69
69 nvgpu_log_fn(g, " "); 70 nvgpu_log_fn(g, " ");
70 71
@@ -75,7 +76,7 @@ void gm20b_fb_tlb_invalidate(struct gk20a *g, struct nvgpu_mem *pdb)
75 power is turned off */ 76 power is turned off */
76 77
77 if (!g->power_on) { 78 if (!g->power_on) {
78 return; 79 return err;
79 } 80 }
80 81
81 addr_lo = u64_lo32(nvgpu_mem_get_addr(g, pdb) >> 12); 82 addr_lo = u64_lo32(nvgpu_mem_get_addr(g, pdb) >> 12);
@@ -96,6 +97,7 @@ void gm20b_fb_tlb_invalidate(struct gk20a *g, struct nvgpu_mem *pdb)
96 "wait mmu fifo space")); 97 "wait mmu fifo space"));
97 98
98 if (nvgpu_timeout_peek_expired(&timeout)) { 99 if (nvgpu_timeout_peek_expired(&timeout)) {
100 err = -ETIMEDOUT;
99 goto out; 101 goto out;
100 } 102 }
101 103
@@ -126,6 +128,7 @@ void gm20b_fb_tlb_invalidate(struct gk20a *g, struct nvgpu_mem *pdb)
126 128
127out: 129out:
128 nvgpu_mutex_release(&g->mm.tlb_lock); 130 nvgpu_mutex_release(&g->mm.tlb_lock);
131 return err;
129} 132}
130 133
131void fb_gm20b_init_fs_state(struct gk20a *g) 134void fb_gm20b_init_fs_state(struct gk20a *g)
diff --git a/drivers/gpu/nvgpu/common/fb/fb_gm20b.h b/drivers/gpu/nvgpu/common/fb/fb_gm20b.h
index 95991432..bc240ae3 100644
--- a/drivers/gpu/nvgpu/common/fb/fb_gm20b.h
+++ b/drivers/gpu/nvgpu/common/fb/fb_gm20b.h
@@ -33,7 +33,7 @@ struct nvgpu_mem;
33 33
34void gm20b_fb_reset(struct gk20a *g); 34void gm20b_fb_reset(struct gk20a *g);
35void gm20b_fb_init_hw(struct gk20a *g); 35void gm20b_fb_init_hw(struct gk20a *g);
36void gm20b_fb_tlb_invalidate(struct gk20a *g, struct nvgpu_mem *pdb); 36int gm20b_fb_tlb_invalidate(struct gk20a *g, struct nvgpu_mem *pdb);
37void fb_gm20b_init_fs_state(struct gk20a *g); 37void fb_gm20b_init_fs_state(struct gk20a *g);
38void gm20b_fb_set_mmu_page_size(struct gk20a *g); 38void gm20b_fb_set_mmu_page_size(struct gk20a *g);
39bool gm20b_fb_set_use_full_comp_tag_line(struct gk20a *g); 39bool gm20b_fb_set_use_full_comp_tag_line(struct gk20a *g);
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index 20f07c6c..2b8e8b0a 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -551,7 +551,7 @@ struct gpu_ops {
551 struct wpr_carveout_info *inf); 551 struct wpr_carveout_info *inf);
552 bool (*is_debug_mode_enabled)(struct gk20a *g); 552 bool (*is_debug_mode_enabled)(struct gk20a *g);
553 void (*set_debug_mode)(struct gk20a *g, bool enable); 553 void (*set_debug_mode)(struct gk20a *g, bool enable);
554 void (*tlb_invalidate)(struct gk20a *g, struct nvgpu_mem *pdb); 554 int (*tlb_invalidate)(struct gk20a *g, struct nvgpu_mem *pdb);
555 void (*hub_isr)(struct gk20a *g); 555 void (*hub_isr)(struct gk20a *g);
556 void (*handle_replayable_fault)(struct gk20a *g); 556 void (*handle_replayable_fault)(struct gk20a *g);
557 int (*mem_unlock)(struct gk20a *g); 557 int (*mem_unlock)(struct gk20a *g);
diff --git a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
index 837508bb..ae35cafc 100644
--- a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
@@ -250,11 +250,12 @@ void vgpu_mm_l2_flush(struct gk20a *g, bool invalidate)
250 vgpu_cache_maint(vgpu_get_handle(g), op); 250 vgpu_cache_maint(vgpu_get_handle(g), op);
251} 251}
252 252
253void vgpu_mm_tlb_invalidate(struct gk20a *g, struct nvgpu_mem *pdb) 253int vgpu_mm_tlb_invalidate(struct gk20a *g, struct nvgpu_mem *pdb)
254{ 254{
255 nvgpu_log_fn(g, " "); 255 nvgpu_log_fn(g, " ");
256 256
257 nvgpu_err(g, "call to RM server not supported"); 257 nvgpu_err(g, "call to RM server not supported");
258 return 0;
258} 259}
259 260
260void vgpu_mm_mmu_set_debug_mode(struct gk20a *g, bool enable) 261void vgpu_mm_mmu_set_debug_mode(struct gk20a *g, bool enable)
diff --git a/drivers/gpu/nvgpu/vgpu/mm_vgpu.h b/drivers/gpu/nvgpu/vgpu/mm_vgpu.h
index 41bae96d..491700fc 100644
--- a/drivers/gpu/nvgpu/vgpu/mm_vgpu.h
+++ b/drivers/gpu/nvgpu/vgpu/mm_vgpu.h
@@ -43,6 +43,6 @@ int vgpu_vm_bind_channel(struct vm_gk20a *vm,
43int vgpu_mm_fb_flush(struct gk20a *g); 43int vgpu_mm_fb_flush(struct gk20a *g);
44void vgpu_mm_l2_invalidate(struct gk20a *g); 44void vgpu_mm_l2_invalidate(struct gk20a *g);
45void vgpu_mm_l2_flush(struct gk20a *g, bool invalidate); 45void vgpu_mm_l2_flush(struct gk20a *g, bool invalidate);
46void vgpu_mm_tlb_invalidate(struct gk20a *g, struct nvgpu_mem *pdb); 46int vgpu_mm_tlb_invalidate(struct gk20a *g, struct nvgpu_mem *pdb);
47void vgpu_mm_mmu_set_debug_mode(struct gk20a *g, bool enable); 47void vgpu_mm_mmu_set_debug_mode(struct gk20a *g, bool enable);
48#endif 48#endif