gpu: nvgpu: Move debugfs fields to os_linux

Move all Linux specific debugfs dentry fields to struct
nvgpu_os_linux.

JIRA NVGPU-62

Change-Id: I615620005f5d042943dd2e478c1629bcc912c550
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1528263
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Terje Bergstrom
2017-07-27 13:31:32 -07:00
committed by mobile promotions
parent b8efd9d045
commit 972c42fddf
23 changed files with 152 additions and 163 deletions

View File

@@ -32,7 +32,6 @@
#include "clk/clk_arb.h" #include "clk/clk_arb.h"
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
#include "gk20a/platform_gk20a.h"
#include "common/linux/os_linux.h" #include "common/linux/os_linux.h"
#endif #endif
@@ -2077,9 +2076,8 @@ static const struct file_operations nvgpu_clk_arb_stats_fops = {
static int nvgpu_clk_arb_debugfs_init(struct gk20a *g) static int nvgpu_clk_arb_debugfs_init(struct gk20a *g)
{ {
struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
struct dentry *gpu_root = l->debugfs;
struct dentry *gpu_root = platform->debugfs;
struct dentry *d; struct dentry *d;
gk20a_dbg(gpu_dbg_info, "g=%p", g); gk20a_dbg(gpu_dbg_info, "g=%p", g);

View File

@@ -223,14 +223,14 @@ static const struct file_operations railgate_residency_fops = {
static int gk20a_railgating_debugfs_init(struct gk20a *g) static int gk20a_railgating_debugfs_init(struct gk20a *g)
{ {
struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
struct dentry *d; struct dentry *d;
if (!g->can_railgate) if (!g->can_railgate)
return 0; return 0;
d = debugfs_create_file( d = debugfs_create_file(
"railgate_residency", S_IRUGO|S_IWUSR, platform->debugfs, g, "railgate_residency", S_IRUGO|S_IWUSR, l->debugfs, g,
&railgate_residency_fops); &railgate_residency_fops);
if (!d) if (!d)
return -ENOMEM; return -ENOMEM;
@@ -240,101 +240,101 @@ static int gk20a_railgating_debugfs_init(struct gk20a *g)
void gk20a_debug_init(struct gk20a *g, const char *debugfs_symlink) void gk20a_debug_init(struct gk20a *g, const char *debugfs_symlink)
{ {
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
struct device *dev = dev_from_gk20a(g); struct device *dev = dev_from_gk20a(g);
struct gk20a_platform *platform = dev_get_drvdata(dev);
platform->debugfs = debugfs_create_dir(dev_name(dev), NULL); l->debugfs = debugfs_create_dir(dev_name(dev), NULL);
if (!platform->debugfs) if (!l->debugfs)
return; return;
if (debugfs_symlink) if (debugfs_symlink)
platform->debugfs_alias = l->debugfs_alias =
debugfs_create_symlink(debugfs_symlink, debugfs_create_symlink(debugfs_symlink,
NULL, dev_name(dev)); NULL, dev_name(dev));
debugfs_create_file("status", S_IRUGO, platform->debugfs, debugfs_create_file("status", S_IRUGO, l->debugfs,
dev, &gk20a_debug_fops); dev, &gk20a_debug_fops);
debugfs_create_file("gr_status", S_IRUGO, platform->debugfs, debugfs_create_file("gr_status", S_IRUGO, l->debugfs,
dev, &gk20a_gr_debug_fops); dev, &gk20a_gr_debug_fops);
debugfs_create_u32("trace_cmdbuf", S_IRUGO|S_IWUSR, debugfs_create_u32("trace_cmdbuf", S_IRUGO|S_IWUSR,
platform->debugfs, &gk20a_debug_trace_cmdbuf); l->debugfs, &gk20a_debug_trace_cmdbuf);
debugfs_create_u32("ch_wdt_timeout_ms", S_IRUGO|S_IWUSR, debugfs_create_u32("ch_wdt_timeout_ms", S_IRUGO|S_IWUSR,
platform->debugfs, &g->ch_wdt_timeout_ms); l->debugfs, &g->ch_wdt_timeout_ms);
debugfs_create_u32("disable_syncpoints", S_IRUGO|S_IWUSR, debugfs_create_u32("disable_syncpoints", S_IRUGO|S_IWUSR,
platform->debugfs, &g->disable_syncpoints); l->debugfs, &g->disable_syncpoints);
/* Legacy debugging API. */ /* Legacy debugging API. */
debugfs_create_u32("dbg_mask", S_IRUGO|S_IWUSR, debugfs_create_u32("dbg_mask", S_IRUGO|S_IWUSR,
platform->debugfs, &nvgpu_dbg_mask); l->debugfs, &nvgpu_dbg_mask);
/* New debug logging API. */ /* New debug logging API. */
debugfs_create_u32("log_mask", S_IRUGO|S_IWUSR, debugfs_create_u32("log_mask", S_IRUGO|S_IWUSR,
platform->debugfs, &g->log_mask); l->debugfs, &g->log_mask);
debugfs_create_u32("log_trace", S_IRUGO|S_IWUSR, debugfs_create_u32("log_trace", S_IRUGO|S_IWUSR,
platform->debugfs, &g->log_trace); l->debugfs, &g->log_trace);
g->debugfs_ltc_enabled = l->debugfs_ltc_enabled =
debugfs_create_bool("ltc_enabled", S_IRUGO|S_IWUSR, debugfs_create_bool("ltc_enabled", S_IRUGO|S_IWUSR,
platform->debugfs, l->debugfs,
&g->mm.ltc_enabled_target); &g->mm.ltc_enabled_target);
g->debugfs_gr_idle_timeout_default = l->debugfs_gr_idle_timeout_default =
debugfs_create_u32("gr_idle_timeout_default_us", debugfs_create_u32("gr_idle_timeout_default_us",
S_IRUGO|S_IWUSR, platform->debugfs, S_IRUGO|S_IWUSR, l->debugfs,
&g->gr_idle_timeout_default); &g->gr_idle_timeout_default);
g->debugfs_timeouts_enabled = l->debugfs_timeouts_enabled =
debugfs_create_bool("timeouts_enabled", debugfs_create_bool("timeouts_enabled",
S_IRUGO|S_IWUSR, S_IRUGO|S_IWUSR,
platform->debugfs, l->debugfs,
&g->timeouts_enabled); &g->timeouts_enabled);
g->debugfs_bypass_smmu = l->debugfs_bypass_smmu =
debugfs_create_bool("bypass_smmu", debugfs_create_bool("bypass_smmu",
S_IRUGO|S_IWUSR, S_IRUGO|S_IWUSR,
platform->debugfs, l->debugfs,
&g->mm.bypass_smmu); &g->mm.bypass_smmu);
g->debugfs_disable_bigpage = l->debugfs_disable_bigpage =
debugfs_create_bool("disable_bigpage", debugfs_create_bool("disable_bigpage",
S_IRUGO|S_IWUSR, S_IRUGO|S_IWUSR,
platform->debugfs, l->debugfs,
&g->mm.disable_bigpage); &g->mm.disable_bigpage);
g->debugfs_timeslice_low_priority_us = l->debugfs_timeslice_low_priority_us =
debugfs_create_u32("timeslice_low_priority_us", debugfs_create_u32("timeslice_low_priority_us",
S_IRUGO|S_IWUSR, S_IRUGO|S_IWUSR,
platform->debugfs, l->debugfs,
&g->timeslice_low_priority_us); &g->timeslice_low_priority_us);
g->debugfs_timeslice_medium_priority_us = l->debugfs_timeslice_medium_priority_us =
debugfs_create_u32("timeslice_medium_priority_us", debugfs_create_u32("timeslice_medium_priority_us",
S_IRUGO|S_IWUSR, S_IRUGO|S_IWUSR,
platform->debugfs, l->debugfs,
&g->timeslice_medium_priority_us); &g->timeslice_medium_priority_us);
g->debugfs_timeslice_high_priority_us = l->debugfs_timeslice_high_priority_us =
debugfs_create_u32("timeslice_high_priority_us", debugfs_create_u32("timeslice_high_priority_us",
S_IRUGO|S_IWUSR, S_IRUGO|S_IWUSR,
platform->debugfs, l->debugfs,
&g->timeslice_high_priority_us); &g->timeslice_high_priority_us);
g->debugfs_runlist_interleave = l->debugfs_runlist_interleave =
debugfs_create_bool("runlist_interleave", debugfs_create_bool("runlist_interleave",
S_IRUGO|S_IWUSR, S_IRUGO|S_IWUSR,
platform->debugfs, l->debugfs,
&g->runlist_interleave); &g->runlist_interleave);
#ifdef CONFIG_ARCH_TEGRA_18x_SOC #ifdef CONFIG_ARCH_TEGRA_18x_SOC
g->gr.t18x.ctx_vars.debugfs_force_preemption_gfxp = l->debugfs_force_preemption_gfxp =
debugfs_create_bool("force_preemption_gfxp", S_IRUGO|S_IWUSR, debugfs_create_bool("force_preemption_gfxp", S_IRUGO|S_IWUSR,
platform->debugfs, l->debugfs,
&g->gr.t18x.ctx_vars.force_preemption_gfxp); &g->gr.t18x.ctx_vars.force_preemption_gfxp);
g->gr.t18x.ctx_vars.debugfs_force_preemption_cilp = l->debugfs_force_preemption_cilp =
debugfs_create_bool("force_preemption_cilp", S_IRUGO|S_IWUSR, debugfs_create_bool("force_preemption_cilp", S_IRUGO|S_IWUSR,
platform->debugfs, l->debugfs,
&g->gr.t18x.ctx_vars.force_preemption_cilp); &g->gr.t18x.ctx_vars.force_preemption_cilp);
g->gr.t18x.ctx_vars.debugfs_dump_ctxsw_stats = l->debugfs_dump_ctxsw_stats =
debugfs_create_bool("dump_ctxsw_stats_on_channel_close", debugfs_create_bool("dump_ctxsw_stats_on_channel_close",
S_IRUGO|S_IWUSR, platform->debugfs, S_IRUGO|S_IWUSR, l->debugfs,
&g->gr.t18x. &g->gr.t18x.
ctx_vars.dump_ctxsw_stats_on_channel_close); ctx_vars.dump_ctxsw_stats_on_channel_close);
#endif #endif
@@ -355,13 +355,13 @@ void gk20a_debug_init(struct gk20a *g, const char *debugfs_symlink)
void gk20a_debug_deinit(struct gk20a *g) void gk20a_debug_deinit(struct gk20a *g)
{ {
struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
if (!platform->debugfs) if (!l->debugfs)
return; return;
gk20a_fifo_debugfs_deinit(g); gk20a_fifo_debugfs_deinit(g);
debugfs_remove_recursive(platform->debugfs); debugfs_remove_recursive(l->debugfs);
debugfs_remove_recursive(platform->debugfs_alias); debugfs_remove_recursive(l->debugfs_alias);
} }

View File

@@ -13,7 +13,6 @@
*/ */
#include "debug_allocator.h" #include "debug_allocator.h"
#include "gk20a/platform_gk20a.h"
#include "os_linux.h" #include "os_linux.h"
#include <linux/debugfs.h> #include <linux/debugfs.h>
@@ -52,11 +51,13 @@ static const struct file_operations __alloc_fops = {
void nvgpu_init_alloc_debug(struct gk20a *g, struct nvgpu_allocator *a) void nvgpu_init_alloc_debug(struct gk20a *g, struct nvgpu_allocator *a)
{ {
if (!g->debugfs_allocators) struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
if (!l->debugfs_allocators)
return; return;
a->debugfs_entry = debugfs_create_file(a->name, S_IRUGO, a->debugfs_entry = debugfs_create_file(a->name, S_IRUGO,
g->debugfs_allocators, l->debugfs_allocators,
a, &__alloc_fops); a, &__alloc_fops);
} }
@@ -68,14 +69,14 @@ void nvgpu_fini_alloc_debug(struct nvgpu_allocator *a)
void nvgpu_alloc_debugfs_init(struct gk20a *g) void nvgpu_alloc_debugfs_init(struct gk20a *g)
{ {
struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
g->debugfs_allocators = debugfs_create_dir("allocators", platform->debugfs); l->debugfs_allocators = debugfs_create_dir("allocators", l->debugfs);
if (IS_ERR_OR_NULL(g->debugfs_allocators)) { if (IS_ERR_OR_NULL(l->debugfs_allocators)) {
g->debugfs_allocators = NULL; l->debugfs_allocators = NULL;
return; return;
} }
debugfs_create_u32("tracing", 0664, g->debugfs_allocators, debugfs_create_u32("tracing", 0664, l->debugfs_allocators,
&nvgpu_alloc_tracing_on); &nvgpu_alloc_tracing_on);
} }

View File

@@ -34,19 +34,20 @@ static const struct file_operations gk20a_cde_reload_fops = {
void gk20a_cde_debugfs_init(struct gk20a *g) void gk20a_cde_debugfs_init(struct gk20a *g)
{ {
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g));
if (!platform->has_cde) if (!platform->has_cde)
return; return;
debugfs_create_u32("cde_parameter", S_IWUSR | S_IRUGO, debugfs_create_u32("cde_parameter", S_IWUSR | S_IRUGO,
platform->debugfs, &g->cde_app.shader_parameter); l->debugfs, &g->cde_app.shader_parameter);
debugfs_create_u32("cde_ctx_count", S_IWUSR | S_IRUGO, debugfs_create_u32("cde_ctx_count", S_IWUSR | S_IRUGO,
platform->debugfs, &g->cde_app.ctx_count); l->debugfs, &g->cde_app.ctx_count);
debugfs_create_u32("cde_ctx_usecount", S_IWUSR | S_IRUGO, debugfs_create_u32("cde_ctx_usecount", S_IWUSR | S_IRUGO,
platform->debugfs, &g->cde_app.ctx_usecount); l->debugfs, &g->cde_app.ctx_usecount);
debugfs_create_u32("cde_ctx_count_top", S_IWUSR | S_IRUGO, debugfs_create_u32("cde_ctx_count_top", S_IWUSR | S_IRUGO,
platform->debugfs, &g->cde_app.ctx_count_top); l->debugfs, &g->cde_app.ctx_count_top);
debugfs_create_file("reload_cde_firmware", S_IWUSR, platform->debugfs, debugfs_create_file("reload_cde_firmware", S_IWUSR, l->debugfs,
g, &gk20a_cde_reload_fops); g, &gk20a_cde_reload_fops);
} }

View File

@@ -13,19 +13,18 @@
*/ */
#include "debug_ce.h" #include "debug_ce.h"
#include "gk20a/platform_gk20a.h"
#include "os_linux.h" #include "os_linux.h"
#include <linux/debugfs.h> #include <linux/debugfs.h>
void gk20a_ce_debugfs_init(struct gk20a *g) void gk20a_ce_debugfs_init(struct gk20a *g)
{ {
struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
debugfs_create_u32("ce_app_ctx_count", S_IWUSR | S_IRUGO, debugfs_create_u32("ce_app_ctx_count", S_IWUSR | S_IRUGO,
platform->debugfs, &g->ce_app.ctx_count); l->debugfs, &g->ce_app.ctx_count);
debugfs_create_u32("ce_app_state", S_IWUSR | S_IRUGO, debugfs_create_u32("ce_app_state", S_IWUSR | S_IRUGO,
platform->debugfs, &g->ce_app.app_state); l->debugfs, &g->ce_app.app_state);
debugfs_create_u32("ce_app_next_ctx_id", S_IWUSR | S_IRUGO, debugfs_create_u32("ce_app_next_ctx_id", S_IWUSR | S_IRUGO,
platform->debugfs, &g->ce_app.next_ctx_id); l->debugfs, &g->ce_app.next_ctx_id);
} }

View File

@@ -217,49 +217,49 @@ static const struct file_operations pll_param_fops = {
int gm20b_clk_init_debugfs(struct gk20a *g) int gm20b_clk_init_debugfs(struct gk20a *g)
{ {
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
struct dentry *d; struct dentry *d;
struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g));
if (!platform->debugfs) if (!l->debugfs)
return -EINVAL; return -EINVAL;
d = debugfs_create_file( d = debugfs_create_file(
"rate", S_IRUGO|S_IWUSR, platform->debugfs, g, &rate_fops); "rate", S_IRUGO|S_IWUSR, l->debugfs, g, &rate_fops);
if (!d) if (!d)
goto err_out; goto err_out;
d = debugfs_create_file( d = debugfs_create_file(
"pll_reg", S_IRUGO, platform->debugfs, g, &pll_reg_fops); "pll_reg", S_IRUGO, l->debugfs, g, &pll_reg_fops);
if (!d) if (!d)
goto err_out; goto err_out;
d = debugfs_create_file("pll_reg_raw", d = debugfs_create_file("pll_reg_raw",
S_IRUGO, platform->debugfs, g, &pll_reg_raw_fops); S_IRUGO, l->debugfs, g, &pll_reg_raw_fops);
if (!d) if (!d)
goto err_out; goto err_out;
d = debugfs_create_file( d = debugfs_create_file(
"monitor", S_IRUGO, platform->debugfs, g, &monitor_fops); "monitor", S_IRUGO, l->debugfs, g, &monitor_fops);
if (!d) if (!d)
goto err_out; goto err_out;
d = debugfs_create_file( d = debugfs_create_file(
"voltage", S_IRUGO, platform->debugfs, g, &voltage_fops); "voltage", S_IRUGO, l->debugfs, g, &voltage_fops);
if (!d) if (!d)
goto err_out; goto err_out;
d = debugfs_create_file( d = debugfs_create_file(
"pll_param", S_IRUGO, platform->debugfs, g, &pll_param_fops); "pll_param", S_IRUGO, l->debugfs, g, &pll_param_fops);
if (!d) if (!d)
goto err_out; goto err_out;
d = debugfs_create_u32("pll_na_mode", S_IRUGO, platform->debugfs, d = debugfs_create_u32("pll_na_mode", S_IRUGO, l->debugfs,
(u32 *)&g->clk.gpc_pll.mode); (u32 *)&g->clk.gpc_pll.mode);
if (!d) if (!d)
goto err_out; goto err_out;
d = debugfs_create_u32("fmax2x_at_vmin_safe_t", S_IRUGO, d = debugfs_create_u32("fmax2x_at_vmin_safe_t", S_IRUGO,
platform->debugfs, (u32 *)&g->clk.dvfs_safe_max_freq); l->debugfs, (u32 *)&g->clk.dvfs_safe_max_freq);
if (!d) if (!d)
goto err_out; goto err_out;
@@ -267,6 +267,6 @@ int gm20b_clk_init_debugfs(struct gk20a *g)
err_out: err_out:
pr_err("%s: Failed to make debugfs node\n", __func__); pr_err("%s: Failed to make debugfs node\n", __func__);
debugfs_remove_recursive(platform->debugfs); debugfs_remove_recursive(l->debugfs);
return -ENOMEM; return -ENOMEM;
} }

View File

@@ -13,7 +13,6 @@
*/ */
#include "debug_fifo.h" #include "debug_fifo.h"
#include "gk20a/platform_gk20a.h"
#include "os_linux.h" #include "os_linux.h"
#include <linux/debugfs.h> #include <linux/debugfs.h>
@@ -292,9 +291,8 @@ static const struct file_operations gk20a_fifo_profile_stats_debugfs_fops = {
void gk20a_fifo_debugfs_init(struct gk20a *g) void gk20a_fifo_debugfs_init(struct gk20a *g)
{ {
struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
struct dentry *gpu_root = l->debugfs;
struct dentry *gpu_root = platform->debugfs;
struct dentry *fifo_root; struct dentry *fifo_root;
struct dentry *profile_root; struct dentry *profile_root;

View File

@@ -13,18 +13,17 @@
*/ */
#include "debug_gr.h" #include "debug_gr.h"
#include "gk20a/platform_gk20a.h"
#include "os_linux.h" #include "os_linux.h"
#include <linux/debugfs.h> #include <linux/debugfs.h>
int gr_gk20a_debugfs_init(struct gk20a *g) int gr_gk20a_debugfs_init(struct gk20a *g)
{ {
struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
g->debugfs_gr_default_attrib_cb_size = l->debugfs_gr_default_attrib_cb_size =
debugfs_create_u32("gr_default_attrib_cb_size", debugfs_create_u32("gr_default_attrib_cb_size",
S_IRUGO|S_IWUSR, platform->debugfs, S_IRUGO|S_IWUSR, l->debugfs,
&g->gr.attrib_cb_default_size); &g->gr.attrib_cb_default_size);
return 0; return 0;

View File

@@ -13,15 +13,14 @@
*/ */
#include "debug_mm.h" #include "debug_mm.h"
#include "gk20a/platform_gk20a.h"
#include "os_linux.h" #include "os_linux.h"
#include <linux/debugfs.h> #include <linux/debugfs.h>
void gk20a_mm_debugfs_init(struct gk20a *g) void gk20a_mm_debugfs_init(struct gk20a *g)
{ {
struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
debugfs_create_bool("force_pramin", 0664, platform->debugfs, debugfs_create_bool("force_pramin", 0664, l->debugfs,
&g->mm.force_pramin); &g->mm.force_pramin);
} }

View File

@@ -14,7 +14,6 @@
#include <nvgpu/enabled.h> #include <nvgpu/enabled.h>
#include "debug_pmu.h" #include "debug_pmu.h"
#include "gk20a/platform_gk20a.h"
#include "os_linux.h" #include "os_linux.h"
#include <linux/debugfs.h> #include <linux/debugfs.h>
@@ -420,64 +419,64 @@ static const struct file_operations security_fops = {
int gk20a_pmu_debugfs_init(struct gk20a *g) int gk20a_pmu_debugfs_init(struct gk20a *g)
{ {
struct dentry *d; struct dentry *d;
struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
d = debugfs_create_file( d = debugfs_create_file(
"lpwr_debug", S_IRUGO|S_IWUSR, platform->debugfs, g, "lpwr_debug", S_IRUGO|S_IWUSR, l->debugfs, g,
&lpwr_debug_fops); &lpwr_debug_fops);
if (!d) if (!d)
goto err_out; goto err_out;
d = debugfs_create_file( d = debugfs_create_file(
"mscg_residency", S_IRUGO|S_IWUSR, platform->debugfs, g, "mscg_residency", S_IRUGO|S_IWUSR, l->debugfs, g,
&mscg_stat_fops); &mscg_stat_fops);
if (!d) if (!d)
goto err_out; goto err_out;
d = debugfs_create_file( d = debugfs_create_file(
"mscg_transitions", S_IRUGO, platform->debugfs, g, "mscg_transitions", S_IRUGO, l->debugfs, g,
&mscg_transitions_fops); &mscg_transitions_fops);
if (!d) if (!d)
goto err_out; goto err_out;
d = debugfs_create_file( d = debugfs_create_file(
"elpg_residency", S_IRUGO|S_IWUSR, platform->debugfs, g, "elpg_residency", S_IRUGO|S_IWUSR, l->debugfs, g,
&elpg_stat_fops); &elpg_stat_fops);
if (!d) if (!d)
goto err_out; goto err_out;
d = debugfs_create_file( d = debugfs_create_file(
"elpg_transitions", S_IRUGO, platform->debugfs, g, "elpg_transitions", S_IRUGO, l->debugfs, g,
&elpg_transitions_fops); &elpg_transitions_fops);
if (!d) if (!d)
goto err_out; goto err_out;
d = debugfs_create_file( d = debugfs_create_file(
"falc_trace", S_IRUGO, platform->debugfs, g, "falc_trace", S_IRUGO, l->debugfs, g,
&falc_trace_fops); &falc_trace_fops);
if (!d) if (!d)
goto err_out; goto err_out;
d = debugfs_create_file( d = debugfs_create_file(
"perfmon_events_enable", S_IRUGO, platform->debugfs, g, "perfmon_events_enable", S_IRUGO, l->debugfs, g,
&perfmon_events_enable_fops); &perfmon_events_enable_fops);
if (!d) if (!d)
goto err_out; goto err_out;
d = debugfs_create_file( d = debugfs_create_file(
"perfmon_events_count", S_IRUGO, platform->debugfs, g, "perfmon_events_count", S_IRUGO, l->debugfs, g,
&perfmon_events_count_fops); &perfmon_events_count_fops);
if (!d) if (!d)
goto err_out; goto err_out;
d = debugfs_create_file( d = debugfs_create_file(
"pmu_security", S_IRUGO, platform->debugfs, g, "pmu_security", S_IRUGO, l->debugfs, g,
&security_fops); &security_fops);
if (!d) if (!d)
goto err_out; goto err_out;
return 0; return 0;
err_out: err_out:
pr_err("%s: Failed to make debugfs node\n", __func__); pr_err("%s: Failed to make debugfs node\n", __func__);
debugfs_remove_recursive(platform->debugfs); debugfs_remove_recursive(l->debugfs);
return -ENOMEM; return -ENOMEM;
} }

View File

@@ -13,7 +13,6 @@
*/ */
#include "debug_sched.h" #include "debug_sched.h"
#include "gk20a/platform_gk20a.h"
#include "os_linux.h" #include "os_linux.h"
#include <linux/debugfs.h> #include <linux/debugfs.h>
@@ -73,8 +72,8 @@ static const struct file_operations gk20a_sched_debugfs_fops = {
void gk20a_sched_debugfs_init(struct gk20a *g) void gk20a_sched_debugfs_init(struct gk20a *g)
{ {
struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
debugfs_create_file("sched_ctrl", S_IRUGO, platform->debugfs, debugfs_create_file("sched_ctrl", S_IRUGO, l->debugfs,
g, &gk20a_sched_debugfs_fops); g, &gk20a_sched_debugfs_fops);
} }

View File

@@ -83,6 +83,30 @@ struct nvgpu_os_linux {
struct work_struct nonstall_fn_work; struct work_struct nonstall_fn_work;
struct workqueue_struct *nonstall_work_queue; struct workqueue_struct *nonstall_work_queue;
#ifdef CONFIG_DEBUG_FS
struct dentry *debugfs;
struct dentry *debugfs_alias;
struct dentry *debugfs_ltc_enabled;
struct dentry *debugfs_timeouts_enabled;
struct dentry *debugfs_gr_idle_timeout_default;
struct dentry *debugfs_bypass_smmu;
struct dentry *debugfs_disable_bigpage;
struct dentry *debugfs_gr_default_attrib_cb_size;
struct dentry *debugfs_timeslice_low_priority_us;
struct dentry *debugfs_timeslice_medium_priority_us;
struct dentry *debugfs_timeslice_high_priority_us;
struct dentry *debugfs_runlist_interleave;
struct dentry *debugfs_allocators;
struct dentry *debugfs_xve;
struct dentry *debugfs_kmem;
struct dentry *debugfs_force_preemption_cilp;
struct dentry *debugfs_force_preemption_gfxp;
struct dentry *debugfs_dump_ctxsw_stats;
#endif
}; };
static inline struct nvgpu_os_linux *nvgpu_os_linux_from_gk20a(struct gk20a *g) static inline struct nvgpu_os_linux *nvgpu_os_linux_from_gk20a(struct gk20a *g)

View File

@@ -443,6 +443,7 @@ static void nvgpu_pci_remove(struct pci_dev *pdev)
{ {
struct gk20a_platform *platform = gk20a_get_platform(&pdev->dev); struct gk20a_platform *platform = gk20a_get_platform(&pdev->dev);
struct gk20a *g = get_gk20a(&pdev->dev); struct gk20a *g = get_gk20a(&pdev->dev);
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
gk20a_dbg(gpu_dbg_shutdown, "Removing nvgpu driver!\n"); gk20a_dbg(gpu_dbg_shutdown, "Removing nvgpu driver!\n");
@@ -474,8 +475,8 @@ static void nvgpu_pci_remove(struct pci_dev *pdev)
gk20a_dbg(gpu_dbg_shutdown, "User de-init done.\b"); gk20a_dbg(gpu_dbg_shutdown, "User de-init done.\b");
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
debugfs_remove_recursive(platform->debugfs); debugfs_remove_recursive(l->debugfs);
debugfs_remove_recursive(platform->debugfs_alias); debugfs_remove_recursive(l->debugfs_alias);
#endif #endif
nvgpu_remove_sysfs(dev_from_gk20a(g)); nvgpu_remove_sysfs(dev_from_gk20a(g));

View File

@@ -27,7 +27,6 @@
#include "fecs_trace_gk20a.h" #include "fecs_trace_gk20a.h"
#include "gk20a.h" #include "gk20a.h"
#include "gr_gk20a.h" #include "gr_gk20a.h"
#include "platform_gk20a.h"
#include "common/linux/os_linux.h" #include "common/linux/os_linux.h"
#include <nvgpu/log.h> #include <nvgpu/log.h>
@@ -537,21 +536,21 @@ DEFINE_SIMPLE_ATTRIBUTE(gk20a_fecs_trace_debugfs_write_fops,
static void gk20a_fecs_trace_debugfs_init(struct gk20a *g) static void gk20a_fecs_trace_debugfs_init(struct gk20a *g)
{ {
struct gk20a_platform *plat = dev_get_drvdata(dev_from_gk20a(g)); struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
debugfs_create_file("ctxsw_trace_read", 0600, plat->debugfs, g, debugfs_create_file("ctxsw_trace_read", 0600, l->debugfs, g,
&gk20a_fecs_trace_debugfs_read_fops); &gk20a_fecs_trace_debugfs_read_fops);
debugfs_create_file("ctxsw_trace_write", 0600, plat->debugfs, g, debugfs_create_file("ctxsw_trace_write", 0600, l->debugfs, g,
&gk20a_fecs_trace_debugfs_write_fops); &gk20a_fecs_trace_debugfs_write_fops);
debugfs_create_file("ctxsw_trace_ring", 0600, plat->debugfs, g, debugfs_create_file("ctxsw_trace_ring", 0600, l->debugfs, g,
&gk20a_fecs_trace_debugfs_ring_fops); &gk20a_fecs_trace_debugfs_ring_fops);
} }
static void gk20a_fecs_trace_debugfs_cleanup(struct gk20a *g) static void gk20a_fecs_trace_debugfs_cleanup(struct gk20a *g)
{ {
struct gk20a_platform *plat = dev_get_drvdata(dev_from_gk20a(g)); struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
debugfs_remove_recursive(plat->debugfs); debugfs_remove_recursive(l->debugfs);
} }
#else #else

View File

@@ -1147,22 +1147,6 @@ struct gk20a {
struct nvgpu_spinlock ltc_enabled_lock; struct nvgpu_spinlock ltc_enabled_lock;
#ifdef CONFIG_DEBUG_FS
struct dentry *debugfs_ltc_enabled;
struct dentry *debugfs_timeouts_enabled;
struct dentry *debugfs_gr_idle_timeout_default;
struct dentry *debugfs_bypass_smmu;
struct dentry *debugfs_disable_bigpage;
struct dentry *debugfs_gr_default_attrib_cb_size;
struct dentry *debugfs_timeslice_low_priority_us;
struct dentry *debugfs_timeslice_medium_priority_us;
struct dentry *debugfs_timeslice_high_priority_us;
struct dentry *debugfs_runlist_interleave;
struct dentry *debugfs_allocators;
struct dentry *debugfs_xve;
struct dentry *debugfs_kmem;
#endif
struct gk20a_ctxsw_ucode_info ctxsw_ucode_info; struct gk20a_ctxsw_ucode_info ctxsw_ucode_info;
/* /*

View File

@@ -61,10 +61,6 @@ struct gk20a_platform {
/* Set if the platform can unify the small/large address spaces. */ /* Set if the platform can unify the small/large address spaces. */
bool unify_address_spaces; bool unify_address_spaces;
/* Should be populated by probe. */
struct dentry *debugfs;
struct dentry *debugfs_alias;
/* Clock configuration is stored here. Platform probe is responsible /* Clock configuration is stored here. Platform probe is responsible
* for filling this data. */ * for filling this data. */
struct clk *clk[GK20A_CLKS_MAX]; struct clk *clk[GK20A_CLKS_MAX];

View File

@@ -172,6 +172,7 @@ int gm206_bios_init(struct gk20a *g)
unsigned int i; unsigned int i;
struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g));
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
struct dentry *d; struct dentry *d;
#endif #endif
struct nvgpu_firmware *bios_fw; struct nvgpu_firmware *bios_fw;
@@ -239,7 +240,7 @@ int gm206_bios_init(struct gk20a *g)
g->bios_blob.data = g->bios.data; g->bios_blob.data = g->bios.data;
g->bios_blob.size = g->bios.size; g->bios_blob.size = g->bios.size;
d = debugfs_create_blob("bios", S_IRUGO, platform->debugfs, d = debugfs_create_blob("bios", S_IRUGO, l->debugfs,
&g->bios_blob); &g->bios_blob);
if (!d) if (!d)
nvgpu_err(g, "No debugfs?"); nvgpu_err(g, "No debugfs?");

View File

@@ -23,9 +23,6 @@
#include <nvgpu/kmem.h> #include <nvgpu/kmem.h>
#include "gk20a/gk20a.h" #include "gk20a/gk20a.h"
#ifdef CONFIG_DEBUG_FS
#include "gk20a/platform_gk20a.h"
#endif
#include "common/linux/os_linux.h" #include "common/linux/os_linux.h"
#include "clk_gp106.h" #include "clk_gp106.h"
@@ -240,10 +237,10 @@ static int gp106_get_rate_show(void *data , u64 *val) {
DEFINE_SIMPLE_ATTRIBUTE(get_rate_fops, gp106_get_rate_show, NULL, "%llu\n"); DEFINE_SIMPLE_ATTRIBUTE(get_rate_fops, gp106_get_rate_show, NULL, "%llu\n");
static int clk_gp106_debugfs_init(struct gk20a *g) { static int clk_gp106_debugfs_init(struct gk20a *g)
struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); {
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
struct dentry *gpu_root = platform->debugfs; struct dentry *gpu_root = l->debugfs;
struct dentry *clocks_root; struct dentry *clocks_root;
struct dentry *d; struct dentry *d;
unsigned int i; unsigned int i;

View File

@@ -18,7 +18,6 @@
#include "gk20a/gk20a.h" #include "gk20a/gk20a.h"
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
#include "gk20a/platform_gk20a.h"
#include "common/linux/os_linux.h" #include "common/linux/os_linux.h"
#endif #endif
#include "gp106/mclk_gp106.h" #include "gp106/mclk_gp106.h"
@@ -3495,9 +3494,8 @@ static const struct file_operations mclk_switch_stats_fops = {
static int mclk_debugfs_init(struct gk20a *g) static int mclk_debugfs_init(struct gk20a *g)
{ {
struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
struct dentry *gpu_root = l->debugfs;
struct dentry *gpu_root = platform->debugfs;
struct dentry *d; struct dentry *d;
gk20a_dbg(gpu_dbg_info, "g=%p", g); gk20a_dbg(gpu_dbg_info, "g=%p", g);

View File

@@ -18,7 +18,6 @@
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
#include <linux/debugfs.h> #include <linux/debugfs.h>
#include "gk20a/platform_gk20a.h"
#include "common/linux/os_linux.h" #include "common/linux/os_linux.h"
#endif #endif
@@ -72,11 +71,11 @@ DEFINE_SIMPLE_ATTRIBUTE(therm_ctrl_fops, therm_get_internal_sensor_curr_temp, NU
void gp106_therm_debugfs_init(struct gk20a *g) void gp106_therm_debugfs_init(struct gk20a *g)
{ {
struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
struct dentry *dbgentry; struct dentry *dbgentry;
dbgentry = debugfs_create_file( dbgentry = debugfs_create_file(
"temp", S_IRUGO, platform->debugfs, g, &therm_ctrl_fops); "temp", S_IRUGO, l->debugfs, g, &therm_ctrl_fops);
if (!dbgentry) if (!dbgentry)
nvgpu_err(g, "debugfs entry create failed for therm_curr_temp"); nvgpu_err(g, "debugfs entry create failed for therm_curr_temp");
} }

View File

@@ -22,10 +22,10 @@
#include "gk20a/gk20a.h" #include "gk20a/gk20a.h"
#include "gm206/bios_gm206.h" #include "gm206/bios_gm206.h"
#include "gp106/xve_gp106.h" #include "gp106/xve_gp106.h"
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
#include "gk20a/platform_gk20a.h" #include "gk20a/platform_gk20a.h"
#endif #endif
#include "common/linux/os_linux.h"
#include <nvgpu/bug.h> #include <nvgpu/bug.h>
@@ -607,12 +607,12 @@ int xve_sw_init_gp106(struct device *dev)
{ {
int err = -ENODEV; int err = -ENODEV;
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
struct gk20a *g = get_gk20a(dev); struct gk20a *g = gk20a_from_dev(dev);
struct gk20a_platform *plat = gk20a_get_platform(dev); struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
struct dentry *gpu_root = plat->debugfs; struct dentry *gpu_root = l->debugfs;
g->debugfs_xve = debugfs_create_dir("xve", gpu_root); l->debugfs_xve = debugfs_create_dir("xve", gpu_root);
if (IS_ERR_OR_NULL(g->debugfs_xve)) if (IS_ERR_OR_NULL(l->debugfs_xve))
goto fail; goto fail;
/* /*
@@ -620,13 +620,13 @@ int xve_sw_init_gp106(struct device *dev)
* worrying the higher level SW. * worrying the higher level SW.
*/ */
debugfs_create_file("link_speed", S_IRUGO, debugfs_create_file("link_speed", S_IRUGO,
g->debugfs_xve, g, l->debugfs_xve, g,
&xve_link_speed_fops); &xve_link_speed_fops);
debugfs_create_file("available_speeds", S_IRUGO, debugfs_create_file("available_speeds", S_IRUGO,
g->debugfs_xve, g, l->debugfs_xve, g,
&xve_available_speeds_fops); &xve_available_speeds_fops);
debugfs_create_file("link_control_status", S_IRUGO, debugfs_create_file("link_control_status", S_IRUGO,
g->debugfs_xve, g, l->debugfs_xve, g,
&xve_link_control_status_fops); &xve_link_control_status_fops);
err = 0; err = 0;

View File

@@ -64,9 +64,6 @@ struct gr_t18x {
bool force_preemption_cilp; bool force_preemption_cilp;
bool dump_ctxsw_stats_on_channel_close; bool dump_ctxsw_stats_on_channel_close;
#endif #endif
struct dentry *debugfs_force_preemption_cilp;
struct dentry *debugfs_force_preemption_gfxp;
struct dentry *debugfs_dump_ctxsw_stats;
} ctx_vars; } ctx_vars;
u32 fecs_feature_override_ecc_val; u32 fecs_feature_override_ecc_val;

View File

@@ -17,7 +17,6 @@
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
#include <linux/debugfs.h> #include <linux/debugfs.h>
#include "gk20a/platform_gk20a.h"
#include "common/linux/os_linux.h" #include "common/linux/os_linux.h"
#endif #endif
@@ -112,22 +111,23 @@ DEFINE_SIMPLE_ATTRIBUTE(
DEFINE_SIMPLE_ATTRIBUTE( DEFINE_SIMPLE_ATTRIBUTE(
pmgr_voltage_ctrl_fops, pmgr_pwr_devices_get_voltage_u64, NULL, "%llu\n"); pmgr_voltage_ctrl_fops, pmgr_pwr_devices_get_voltage_u64, NULL, "%llu\n");
static void pmgr_debugfs_init(struct gk20a *g) { static void pmgr_debugfs_init(struct gk20a *g)
struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); {
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
struct dentry *dbgentry; struct dentry *dbgentry;
dbgentry = debugfs_create_file( dbgentry = debugfs_create_file(
"power", S_IRUGO, platform->debugfs, g, &pmgr_power_ctrl_fops); "power", S_IRUGO, l->debugfs, g, &pmgr_power_ctrl_fops);
if (!dbgentry) if (!dbgentry)
nvgpu_err(g, "debugfs entry create failed for power"); nvgpu_err(g, "debugfs entry create failed for power");
dbgentry = debugfs_create_file( dbgentry = debugfs_create_file(
"current", S_IRUGO, platform->debugfs, g, &pmgr_current_ctrl_fops); "current", S_IRUGO, l->debugfs, g, &pmgr_current_ctrl_fops);
if (!dbgentry) if (!dbgentry)
nvgpu_err(g, "debugfs entry create failed for current"); nvgpu_err(g, "debugfs entry create failed for current");
dbgentry = debugfs_create_file( dbgentry = debugfs_create_file(
"voltage", S_IRUGO, platform->debugfs, g, &pmgr_voltage_ctrl_fops); "voltage", S_IRUGO, l->debugfs, g, &pmgr_voltage_ctrl_fops);
if (!dbgentry) if (!dbgentry)
nvgpu_err(g, "debugfs entry create failed for voltage"); nvgpu_err(g, "debugfs entry create failed for voltage");
} }