summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/os
diff options
context:
space:
mode:
authorThomas Fleury <tfleury@nvidia.com>2019-04-30 20:19:51 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2020-01-30 02:42:10 -0500
commit9e328ed6b8826f8a1e86bb4584fbb872e91840f3 (patch)
treeaa11590983adc203a71d07d8ea18045fd05a17a9 /drivers/gpu/nvgpu/os
parent41a85b8d2a604c255483871fe09cf59585811d0c (diff)
gpu: nvgpu: add refcounting for MMU debug mode
GPC MMU debug mode should be set if at least one channel in the TSG has requested it. Add refcounting for MMU debug mode, to make sure debug mode is disabled only when no channel in the TSG is using it. Bug 2515097 Bug 2713590 Change-Id: Ic5530f93523a9ec2cd3bfebc97adf7b7000531e0 Signed-off-by: Thomas Fleury <tfleury@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2123017 (cherry picked from commit a1248d87fe6e20aab3e5f2e0764f9fe8d80d0552) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2208769 Reviewed-by: Kajetan Dutka <kdutka@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: Winnie Hsu <whsu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: Kajetan Dutka <kdutka@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu/os')
-rw-r--r--drivers/gpu/nvgpu/os/linux/ioctl_dbg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c b/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c
index f7a65f2b..408bbc64 100644
--- a/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c
+++ b/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c
@@ -1107,10 +1107,11 @@ static int nvgpu_dbg_gpu_ioctl_set_mmu_debug_mode(
1107 ch = nvgpu_dbg_gpu_get_session_channel(dbg_s); 1107 ch = nvgpu_dbg_gpu_get_session_channel(dbg_s);
1108 if (!ch) { 1108 if (!ch) {
1109 nvgpu_err(g, "no bound channel for mmu debug mode"); 1109 nvgpu_err(g, "no bound channel for mmu debug mode");
1110 err = -EINVAL;
1110 goto clean_up; 1111 goto clean_up;
1111 } 1112 }
1112 1113
1113 err = g->ops.gr.set_mmu_debug_mode(g, ch, enable); 1114 err = nvgpu_tsg_set_mmu_debug_mode(tsg_gk20a_from_ch(ch), ch, enable);
1114 if (err) { 1115 if (err) {
1115 nvgpu_err(g, "set mmu debug mode failed, err=%d", err); 1116 nvgpu_err(g, "set mmu debug mode failed, err=%d", err);
1116 } 1117 }