From 5d42343cbf77964b79f90afef57452b61421c8e0 Mon Sep 17 00:00:00 2001 From: Debarshi Dutta Date: Wed, 28 Jul 2021 11:13:10 +0530 Subject: [PATCH] gpu: nvgpu: use appropriate permissions for debugfs entries SW Profiler's debugfs entry "enable" has both RW permissions set however the corresponding read operation is set to NULL. Similarly, the other entries i.e. "percentiles", "raw_entries" and "basic_stats" only have a read operation defined and write is set to NULL. To enable correct permissions, set permission for "enable" to "W" and set permissions for others as "R" only. Bug 200747304 Change-Id: I296a0ff08a871f752988c9b0a671c080695d5eab Signed-off-by: Debarshi Dutta Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2566322 (cherry picked from commit 8542dd388da536ee693610acd0bb3a679ff52881) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2628035 Tested-by: Jonathan Hunter Tested-by: mobile promotions Reviewed-by: Jonathan Hunter Reviewed-by: Alex Waterman Reviewed-by: mobile promotions GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/os/linux/swprofile_debugfs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/nvgpu/os/linux/swprofile_debugfs.c b/drivers/gpu/nvgpu/os/linux/swprofile_debugfs.c index f6cef5f0d..48df33c19 100644 --- a/drivers/gpu/nvgpu/os/linux/swprofile_debugfs.c +++ b/drivers/gpu/nvgpu/os/linux/swprofile_debugfs.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -130,15 +130,15 @@ void nvgpu_debugfs_swprofile_init(struct gk20a *g, if (IS_ERR_OR_NULL(swprofile_root)) return; - debugfs_create_file("enable", 0600, swprofile_root, p, + debugfs_create_file("enable", 0200, swprofile_root, p, &nvgpu_debugfs_swprofile_enable_debugfs_fops); - debugfs_create_file("percentiles", 0600, swprofile_root, p, + debugfs_create_file("percentiles", 0400, swprofile_root, p, &nvgpu_debugfs_swprofile_stats_debugfs_fops); - debugfs_create_file("raw_data", 0600, swprofile_root, p, + debugfs_create_file("raw_data", 0400, swprofile_root, p, &nvgpu_debugfs_swprofile_raw_data_debugfs_fops); - debugfs_create_file("basic_stats", 0600, swprofile_root, p, + debugfs_create_file("basic_stats", 0400, swprofile_root, p, &nvgpu_debugfs_swprofile_basic_stats_debugfs_fops); }