From 246b5fcf4d4988ff0244c18caf711eca68934196 Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Thu, 21 May 2020 22:58:00 -0700 Subject: [PATCH] gpu: nvgpu: debugfs: only create railgate_residency if not is_virtual Dump railgate_residency causes kernel crash since vgpu does not control railgate_residency. So create railgate_residency only on native driver. Bug 2848790 Signed-off-by: Richard Zhao Change-Id: I08d65e1c1c5bf813f0c47d5bffad5a01ea62adf8 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2349293 Tested-by: mobile promotions Reviewed-by: mobile promotions --- drivers/gpu/nvgpu/os/linux/debug.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/nvgpu/os/linux/debug.c b/drivers/gpu/nvgpu/os/linux/debug.c index 6d2e833f6..bf4eb0011 100644 --- a/drivers/gpu/nvgpu/os/linux/debug.c +++ b/drivers/gpu/nvgpu/os/linux/debug.c @@ -273,11 +273,13 @@ static int gk20a_railgating_debugfs_init(struct gk20a *g) struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); struct dentry *d; - d = debugfs_create_file( - "railgate_residency", S_IRUGO|S_IWUSR, l->debugfs, g, + if (!g->is_virtual) { + d = debugfs_create_file( + "railgate_residency", S_IRUGO|S_IWUSR, l->debugfs, g, &railgate_residency_fops); - if (!d) - return -ENOMEM; + if (!d) + return -ENOMEM; + } return 0; }