diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/pmu_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c index eb79fe17..f7af9035 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | |||
@@ -4123,6 +4123,27 @@ static const struct file_operations perfmon_events_count_fops = { | |||
4123 | .release = single_release, | 4123 | .release = single_release, |
4124 | }; | 4124 | }; |
4125 | 4125 | ||
4126 | static int security_show(struct seq_file *s, void *data) | ||
4127 | { | ||
4128 | struct gk20a *g = s->private; | ||
4129 | |||
4130 | seq_printf(s, "%d\n", g->pmu.pmu_mode); | ||
4131 | return 0; | ||
4132 | |||
4133 | } | ||
4134 | |||
4135 | static int security_open(struct inode *inode, struct file *file) | ||
4136 | { | ||
4137 | return single_open(file, security_show, inode->i_private); | ||
4138 | } | ||
4139 | |||
4140 | static const struct file_operations security_fops = { | ||
4141 | .open = security_open, | ||
4142 | .read = seq_read, | ||
4143 | .llseek = seq_lseek, | ||
4144 | .release = single_release, | ||
4145 | }; | ||
4146 | |||
4126 | int gk20a_pmu_debugfs_init(struct platform_device *dev) | 4147 | int gk20a_pmu_debugfs_init(struct platform_device *dev) |
4127 | { | 4148 | { |
4128 | struct dentry *d; | 4149 | struct dentry *d; |
@@ -4158,8 +4179,13 @@ int gk20a_pmu_debugfs_init(struct platform_device *dev) | |||
4158 | &perfmon_events_count_fops); | 4179 | &perfmon_events_count_fops); |
4159 | if (!d) | 4180 | if (!d) |
4160 | goto err_out; | 4181 | goto err_out; |
4161 | return 0; | ||
4162 | 4182 | ||
4183 | d = debugfs_create_file( | ||
4184 | "pmu_security", S_IRUGO, platform->debugfs, g, | ||
4185 | &security_fops); | ||
4186 | if (!d) | ||
4187 | goto err_out; | ||
4188 | return 0; | ||
4163 | err_out: | 4189 | err_out: |
4164 | pr_err("%s: Failed to make debugfs node\n", __func__); | 4190 | pr_err("%s: Failed to make debugfs node\n", __func__); |
4165 | debugfs_remove_recursive(platform->debugfs); | 4191 | debugfs_remove_recursive(platform->debugfs); |