summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2018-09-19 09:44:25 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-09-24 13:15:14 -0400
commitb7b107c1a19d0c9ca399c6a356a9d1adc4daac85 (patch)
treeb733aaf34a2bf3fbb58c322d73fec7036276110c
parente16843c2efdffa13c15cc0a014b2a5598cc2f4ec (diff)
gpu: nvgpu: Add HALs to implement pdb cache WAR
We have a h/w bug on some chips and we need to support below additional HALs to implement a s/w WAR gops.fifo.init_pdb_cache_war() gops.fifo.deinit_pdb_cache_war() gops.fb.apply_pdb_cache_war() Add new API nvgpu_init_mm_pdb_cache_war() to initialize WAR sequence and call this from MM initialization and before setting up rest of the memory management units Deinitialize WAR while cleaning up MM support Add pdb_cache_war_mem member to gk20a to hold all the memory needed for the WAR Bug 200449545 Change-Id: Id2ac0d940c7881c7b0cf396413273c0f329a1a1f Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1834901 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/common/mm/mm.c30
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/gk20a.h5
2 files changed, 35 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/mm.c b/drivers/gpu/nvgpu/common/mm/mm.c
index 88e3baa8..6c8f2cdf 100644
--- a/drivers/gpu/nvgpu/common/mm/mm.c
+++ b/drivers/gpu/nvgpu/common/mm/mm.c
@@ -198,6 +198,10 @@ static void nvgpu_remove_mm_support(struct mm_gk20a *mm)
198 nvgpu_semaphore_sea_destroy(g); 198 nvgpu_semaphore_sea_destroy(g);
199 nvgpu_vidmem_destroy(g); 199 nvgpu_vidmem_destroy(g);
200 nvgpu_pd_cache_fini(g); 200 nvgpu_pd_cache_fini(g);
201
202 if (g->ops.fifo.deinit_pdb_cache_war) {
203 g->ops.fifo.deinit_pdb_cache_war(g);
204 }
201} 205}
202 206
203/* pmu vm, share channel_vm interfaces */ 207/* pmu vm, share channel_vm interfaces */
@@ -501,6 +505,27 @@ static int nvgpu_init_mm_setup_sw(struct gk20a *g)
501 return 0; 505 return 0;
502} 506}
503 507
508static int nvgpu_init_mm_pdb_cache_war(struct gk20a *g)
509{
510 int err;
511
512 if (g->ops.fifo.init_pdb_cache_war) {
513 err = g->ops.fifo.init_pdb_cache_war(g);
514 if (err) {
515 return err;
516 }
517 }
518
519 if (g->ops.fb.apply_pdb_cache_war) {
520 err = g->ops.fb.apply_pdb_cache_war(g);
521 if (err) {
522 return err;
523 }
524 }
525
526 return 0;
527}
528
504int nvgpu_init_mm_support(struct gk20a *g) 529int nvgpu_init_mm_support(struct gk20a *g)
505{ 530{
506 u32 err; 531 u32 err;
@@ -510,6 +535,11 @@ int nvgpu_init_mm_support(struct gk20a *g)
510 return err; 535 return err;
511 } 536 }
512 537
538 err = nvgpu_init_mm_pdb_cache_war(g);
539 if (err) {
540 return err;
541 }
542
513 err = nvgpu_init_mm_setup_sw(g); 543 err = nvgpu_init_mm_setup_sw(g);
514 if (err) { 544 if (err) {
515 return err; 545 return err;
diff --git a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h
index 593b553c..2fd533c6 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h
@@ -583,6 +583,7 @@ struct gpu_ops {
583 u32 index, u32 state); 583 u32 index, u32 state);
584 void (*fault_buf_configure_hw)(struct gk20a *g, u32 index); 584 void (*fault_buf_configure_hw)(struct gk20a *g, u32 index);
585 size_t (*get_vidmem_size)(struct gk20a *g); 585 size_t (*get_vidmem_size)(struct gk20a *g);
586 int (*apply_pdb_cache_war)(struct gk20a *g);
586 } fb; 587 } fb;
587 struct { 588 struct {
588 void (*slcg_bus_load_gating_prod)(struct gk20a *g, bool prod); 589 void (*slcg_bus_load_gating_prod)(struct gk20a *g, bool prod);
@@ -749,6 +750,8 @@ struct gpu_ops {
749 struct nvgpu_semaphore *s, u64 sema_va, 750 struct nvgpu_semaphore *s, u64 sema_va,
750 struct priv_cmd_entry *cmd, 751 struct priv_cmd_entry *cmd,
751 u32 off, bool acquire, bool wfi); 752 u32 off, bool acquire, bool wfi);
753 int (*init_pdb_cache_war)(struct gk20a *g);
754 void (*deinit_pdb_cache_war)(struct gk20a *g);
752 } fifo; 755 } fifo;
753 struct pmu_v { 756 struct pmu_v {
754 u32 (*get_pmu_cmdline_args_size)(struct nvgpu_pmu *pmu); 757 u32 (*get_pmu_cmdline_args_size)(struct nvgpu_pmu *pmu);
@@ -1647,6 +1650,8 @@ struct gk20a {
1647 1650
1648 struct nvgpu_list_node boardobj_head; 1651 struct nvgpu_list_node boardobj_head;
1649 struct nvgpu_list_node boardobjgrp_head; 1652 struct nvgpu_list_node boardobjgrp_head;
1653
1654 struct nvgpu_mem pdb_cache_war_mem;
1650}; 1655};
1651 1656
1652static inline bool nvgpu_is_timeouts_enabled(struct gk20a *g) 1657static inline bool nvgpu_is_timeouts_enabled(struct gk20a *g)