summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/mm
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 /drivers/gpu/nvgpu/common/mm
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>
Diffstat (limited to 'drivers/gpu/nvgpu/common/mm')
-rw-r--r--drivers/gpu/nvgpu/common/mm/mm.c30
1 files changed, 30 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;