diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/hw_gr_gm20b.h | 8 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/mm_gm20b.c | 9 |
6 files changed, 21 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index e2b8a12e..b1cd50ea 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | |||
@@ -862,7 +862,7 @@ static bool gk20a_fifo_should_defer_engine_reset(struct gk20a *g, u32 engine_id, | |||
862 | /* channel recovery is only deferred if an sm debugger | 862 | /* channel recovery is only deferred if an sm debugger |
863 | is attached and has MMU debug mode is enabled */ | 863 | is attached and has MMU debug mode is enabled */ |
864 | if (!gk20a_gr_sm_debugger_attached(g) || | 864 | if (!gk20a_gr_sm_debugger_attached(g) || |
865 | !gk20a_mm_mmu_debug_mode_enabled(g)) | 865 | !g->ops.mm.is_debug_mode_enabled(g)) |
866 | return false; | 866 | return false; |
867 | 867 | ||
868 | /* if this fault is fake (due to RC recovery), don't defer recovery */ | 868 | /* if this fault is fake (due to RC recovery), don't defer recovery */ |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index b5ef3f0d..77300203 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -239,6 +239,7 @@ struct gpu_ops { | |||
239 | u32 num_pages, u32 pgsz_idx); | 239 | u32 num_pages, u32 pgsz_idx); |
240 | void (*clear_sparse)(struct vm_gk20a *vm, u64 vaddr, | 240 | void (*clear_sparse)(struct vm_gk20a *vm, u64 vaddr, |
241 | u64 size, u32 pgsz_idx); | 241 | u64 size, u32 pgsz_idx); |
242 | bool (*is_debug_mode_enabled)(struct gk20a *g); | ||
242 | } mm; | 243 | } mm; |
243 | struct { | 244 | struct { |
244 | int (*prepare_ucode)(struct gk20a *g); | 245 | int (*prepare_ucode)(struct gk20a *g); |
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 3298a383..a2832a9f 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |||
@@ -5267,7 +5267,7 @@ static int gk20a_gr_lock_down_sm(struct gk20a *g, u32 global_esr_mask) | |||
5267 | unsigned long end_jiffies = jiffies + | 5267 | unsigned long end_jiffies = jiffies + |
5268 | msecs_to_jiffies(gk20a_get_gr_idle_timeout(g)); | 5268 | msecs_to_jiffies(gk20a_get_gr_idle_timeout(g)); |
5269 | u32 delay = GR_IDLE_CHECK_DEFAULT; | 5269 | u32 delay = GR_IDLE_CHECK_DEFAULT; |
5270 | bool mmu_debug_mode_enabled = gk20a_mm_mmu_debug_mode_enabled(g); | 5270 | bool mmu_debug_mode_enabled = g->ops.mm.is_debug_mode_enabled(g); |
5271 | u32 dbgr_control0; | 5271 | u32 dbgr_control0; |
5272 | 5272 | ||
5273 | gk20a_dbg(gpu_dbg_intr | gpu_dbg_gpu_dbg, "locking down SM"); | 5273 | gk20a_dbg(gpu_dbg_intr | gpu_dbg_gpu_dbg, "locking down SM"); |
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index 93a29b13..92095162 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c | |||
@@ -3111,5 +3111,6 @@ void gk20a_init_mm(struct gpu_ops *gops) | |||
3111 | gops->mm.set_sparse = gk20a_vm_put_sparse; | 3111 | gops->mm.set_sparse = gk20a_vm_put_sparse; |
3112 | gops->mm.put_empty = gk20a_vm_put_empty; | 3112 | gops->mm.put_empty = gk20a_vm_put_empty; |
3113 | gops->mm.clear_sparse = gk20a_vm_clear_sparse; | 3113 | gops->mm.clear_sparse = gk20a_vm_clear_sparse; |
3114 | gops->mm.is_debug_mode_enabled = gk20a_mm_mmu_debug_mode_enabled; | ||
3114 | } | 3115 | } |
3115 | 3116 | ||
diff --git a/drivers/gpu/nvgpu/gm20b/hw_gr_gm20b.h b/drivers/gpu/nvgpu/gm20b/hw_gr_gm20b.h index eb6cf4ad..21a46d33 100644 --- a/drivers/gpu/nvgpu/gm20b/hw_gr_gm20b.h +++ b/drivers/gpu/nvgpu/gm20b/hw_gr_gm20b.h | |||
@@ -3210,6 +3210,14 @@ static inline u32 gr_gpcs_pri_mmu_debug_ctrl_r(void) | |||
3210 | { | 3210 | { |
3211 | return 0x004188b0; | 3211 | return 0x004188b0; |
3212 | } | 3212 | } |
3213 | static inline u32 gr_gpcs_pri_mmu_debug_ctrl_debug_v(u32 r) | ||
3214 | { | ||
3215 | return (r >> 16) & 0x1; | ||
3216 | } | ||
3217 | static inline u32 gr_gpcs_pri_mmu_debug_ctrl_debug_enabled_v(void) | ||
3218 | { | ||
3219 | return 0x00000001; | ||
3220 | } | ||
3213 | static inline u32 gr_gpcs_pri_mmu_debug_wr_r(void) | 3221 | static inline u32 gr_gpcs_pri_mmu_debug_wr_r(void) |
3214 | { | 3222 | { |
3215 | return 0x004188b4; | 3223 | return 0x004188b4; |
diff --git a/drivers/gpu/nvgpu/gm20b/mm_gm20b.c b/drivers/gpu/nvgpu/gm20b/mm_gm20b.c index a16f4adf..ac82d56a 100644 --- a/drivers/gpu/nvgpu/gm20b/mm_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/mm_gm20b.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include "mm_gm20b.h" | 18 | #include "mm_gm20b.h" |
19 | #include "hw_gmmu_gm20b.h" | 19 | #include "hw_gmmu_gm20b.h" |
20 | #include "hw_fb_gm20b.h" | 20 | #include "hw_fb_gm20b.h" |
21 | #include "hw_gr_gm20b.h" | ||
21 | 22 | ||
22 | static const u32 gmmu_page_sizes[gmmu_nr_page_sizes] = { SZ_4K, SZ_128K }; | 23 | static const u32 gmmu_page_sizes[gmmu_nr_page_sizes] = { SZ_4K, SZ_128K }; |
23 | static const u32 gmmu_page_shifts[gmmu_nr_page_sizes] = { 12, 17 }; | 24 | static const u32 gmmu_page_shifts[gmmu_nr_page_sizes] = { 12, 17 }; |
@@ -314,8 +315,16 @@ void gm20b_vm_clear_sparse(struct vm_gk20a *vm, u64 vaddr, | |||
314 | return; | 315 | return; |
315 | } | 316 | } |
316 | 317 | ||
318 | bool gm20b_mm_mmu_debug_mode_enabled(struct gk20a *g) | ||
319 | { | ||
320 | u32 debug_ctrl = gk20a_readl(g, gr_gpcs_pri_mmu_debug_ctrl_r()); | ||
321 | return gr_gpcs_pri_mmu_debug_ctrl_debug_v(debug_ctrl) == | ||
322 | gr_gpcs_pri_mmu_debug_ctrl_debug_enabled_v(); | ||
323 | } | ||
324 | |||
317 | void gm20b_init_mm(struct gpu_ops *gops) | 325 | void gm20b_init_mm(struct gpu_ops *gops) |
318 | { | 326 | { |
319 | gops->mm.set_sparse = gm20b_vm_put_sparse; | 327 | gops->mm.set_sparse = gm20b_vm_put_sparse; |
320 | gops->mm.clear_sparse = gm20b_vm_clear_sparse; | 328 | gops->mm.clear_sparse = gm20b_vm_clear_sparse; |
329 | gops->mm.is_debug_mode_enabled = gm20b_mm_mmu_debug_mode_enabled; | ||
321 | } | 330 | } |