From b3e1ce04b963e91b9b425b3c35cc4eff11db7543 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Fri, 21 Apr 2017 12:42:57 -0700 Subject: gpu: nvgpu: Put debugfs dependencies inside #ifdef Put all debugfs dependencies inside #ifdef CONFIG_DEBUG_FS. This includes some functions in allocators that were used only for debugging. Remove include of linux/debugfs.h on files that do not deal with debugfs. linux/debugfs.h implicitly included linux/fs.h, which we relied on. Add explicit include of linux/fs.h for all files where this is the case. Change-Id: I16feffae6b0e3a2edf366075cdc01ade86be06f9 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1467897 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/common/linux/ioctl_as.c | 1 + drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c | 1 + drivers/gpu/nvgpu/common/linux/kmem.c | 2 +- drivers/gpu/nvgpu/common/linux/module.c | 4 +++- drivers/gpu/nvgpu/common/linux/pci.c | 2 ++ drivers/gpu/nvgpu/common/mm/bitmap_allocator.c | 4 ++++ drivers/gpu/nvgpu/common/mm/buddy_allocator.c | 4 ++++ drivers/gpu/nvgpu/common/mm/lockless_allocator.c | 6 +++++- drivers/gpu/nvgpu/common/mm/nvgpu_allocator.c | 2 +- drivers/gpu/nvgpu/common/mm/page_allocator.c | 4 ++++ drivers/gpu/nvgpu/gk20a/cde_gk20a.c | 4 ++++ drivers/gpu/nvgpu/gk20a/ce2_gk20a.c | 6 ++---- drivers/gpu/nvgpu/gk20a/clk_gk20a.c | 2 ++ drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c | 1 - drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h | 4 ++-- drivers/gpu/nvgpu/gk20a/debug_gk20a.c | 5 ++++- drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c | 2 ++ drivers/gpu/nvgpu/gk20a/fence_gk20a.c | 1 + drivers/gpu/nvgpu/gk20a/gk20a.h | 9 +++++++++ drivers/gpu/nvgpu/gk20a/gk20a_scale.c | 1 - drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 2 ++ drivers/gpu/nvgpu/gk20a/sched_gk20a.c | 2 ++ drivers/gpu/nvgpu/gk20a/sched_gk20a.h | 1 + drivers/gpu/nvgpu/gk20a/therm_gk20a.c | 11 +++++------ drivers/gpu/nvgpu/gm206/bios_gm206.c | 4 ++++ drivers/gpu/nvgpu/gm20b/acr_gm20b.c | 3 +++ drivers/gpu/nvgpu/gm20b/clk_gm20b.c | 2 ++ drivers/gpu/nvgpu/gp106/acr_gp106.c | 2 ++ drivers/gpu/nvgpu/gp106/clk_gp106.c | 3 ++- drivers/gpu/nvgpu/gp106/therm_gp106.c | 2 ++ drivers/gpu/nvgpu/gp106/xve_gp106.c | 4 ++++ drivers/gpu/nvgpu/include/nvgpu/allocator.h | 5 ++++- drivers/gpu/nvgpu/pmgr/pmgr.c | 5 ++++- 33 files changed, 89 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_as.c b/drivers/gpu/nvgpu/common/linux/ioctl_as.c index d9316c7f..6a9d3811 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_as.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_as.c @@ -15,6 +15,7 @@ #include #include +#include #include diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c index 0546658d..97e911b9 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include diff --git a/drivers/gpu/nvgpu/common/linux/kmem.c b/drivers/gpu/nvgpu/common/linux/kmem.c index 4fe68830..f38a5e78 100644 --- a/drivers/gpu/nvgpu/common/linux/kmem.c +++ b/drivers/gpu/nvgpu/common/linux/kmem.c @@ -479,6 +479,7 @@ static void print_histogram(struct nvgpu_mem_alloc_tracker *tracker, } } +#ifdef CONFIG_DEBUG_FS /** * nvgpu_kmem_print_stats - Print kmem tracking stats. * @@ -515,7 +516,6 @@ void nvgpu_kmem_print_stats(struct nvgpu_mem_alloc_tracker *tracker, unlock_tracker(tracker); } -#if defined(CONFIG_DEBUG_FS) static int __kmem_tracking_show(struct seq_file *s, void *unused) { struct nvgpu_mem_alloc_tracker *tracker = s->private; diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c index 79d6bd5f..ebc25a26 100644 --- a/drivers/gpu/nvgpu/common/linux/module.c +++ b/drivers/gpu/nvgpu/common/linux/module.c @@ -615,9 +615,9 @@ static int gk20a_pm_unrailgate(struct device *dev) { struct gk20a_platform *platform = dev_get_drvdata(dev); int ret = 0; +#ifdef CONFIG_DEBUG_FS struct gk20a *g = get_gk20a(dev); -#ifdef CONFIG_DEBUG_FS g->pstats.last_rail_ungate_start = jiffies; if (g->pstats.railgating_cycle_count >= 1) g->pstats.total_rail_gate_time_ms = @@ -974,8 +974,10 @@ static int __exit gk20a_remove(struct platform_device *pdev) gk20a_user_deinit(dev, &nvgpu_class); +#ifdef CONFIG_DEBUG_FS debugfs_remove_recursive(platform->debugfs); debugfs_remove_recursive(platform->debugfs_alias); +#endif gk20a_remove_sysfs(dev); diff --git a/drivers/gpu/nvgpu/common/linux/pci.c b/drivers/gpu/nvgpu/common/linux/pci.c index 0bad2b67..b4e6cb7c 100644 --- a/drivers/gpu/nvgpu/common/linux/pci.c +++ b/drivers/gpu/nvgpu/common/linux/pci.c @@ -463,8 +463,10 @@ static void nvgpu_pci_remove(struct pci_dev *pdev) gk20a_user_deinit(g->dev, &nvgpu_pci_class); gk20a_dbg(gpu_dbg_shutdown, "User de-init done.\b"); +#ifdef CONFIG_DEBUG_FS debugfs_remove_recursive(platform->debugfs); debugfs_remove_recursive(platform->debugfs_alias); +#endif gk20a_remove_sysfs(g->dev); diff --git a/drivers/gpu/nvgpu/common/mm/bitmap_allocator.c b/drivers/gpu/nvgpu/common/mm/bitmap_allocator.c index 4b44bd7e..40ee199a 100644 --- a/drivers/gpu/nvgpu/common/mm/bitmap_allocator.c +++ b/drivers/gpu/nvgpu/common/mm/bitmap_allocator.c @@ -310,6 +310,7 @@ static void nvgpu_bitmap_alloc_destroy(struct nvgpu_allocator *__a) nvgpu_kfree(nvgpu_alloc_to_gpu(__a), a); } +#ifdef CONFIG_DEBUG_FS static void nvgpu_bitmap_print_stats(struct nvgpu_allocator *__a, struct seq_file *s, int lock) { @@ -329,6 +330,7 @@ static void nvgpu_bitmap_print_stats(struct nvgpu_allocator *__a, __alloc_pstat(s, __a, " Outstanding = 0x%llx\n", a->bytes_alloced - a->bytes_freed); } +#endif static const struct nvgpu_allocator_ops bitmap_ops = { .alloc = nvgpu_bitmap_alloc, @@ -344,7 +346,9 @@ static const struct nvgpu_allocator_ops bitmap_ops = { .fini = nvgpu_bitmap_alloc_destroy, +#ifdef CONFIG_DEBUG_FS .print_stats = nvgpu_bitmap_print_stats, +#endif }; diff --git a/drivers/gpu/nvgpu/common/mm/buddy_allocator.c b/drivers/gpu/nvgpu/common/mm/buddy_allocator.c index 44e8edb2..34bc51df 100644 --- a/drivers/gpu/nvgpu/common/mm/buddy_allocator.c +++ b/drivers/gpu/nvgpu/common/mm/buddy_allocator.c @@ -1086,6 +1086,7 @@ static u64 nvgpu_buddy_alloc_space(struct nvgpu_allocator *a) return space; } +#ifdef CONFIG_DEBUG_FS /* * Print the buddy allocator top level stats. If you pass @s as NULL then the * stats are printed to the kernel log. This lets this code be used for @@ -1163,6 +1164,7 @@ static void nvgpu_buddy_print_stats(struct nvgpu_allocator *__a, if (lock) alloc_unlock(__a); } +#endif static const struct nvgpu_allocator_ops buddy_ops = { .alloc = nvgpu_buddy_balloc, @@ -1182,7 +1184,9 @@ static const struct nvgpu_allocator_ops buddy_ops = { .fini = nvgpu_buddy_allocator_destroy, +#ifdef CONFIG_DEBUG_FS .print_stats = nvgpu_buddy_print_stats, +#endif }; /* diff --git a/drivers/gpu/nvgpu/common/mm/lockless_allocator.c b/drivers/gpu/nvgpu/common/mm/lockless_allocator.c index dc72d8bf..d8043c0b 100644 --- a/drivers/gpu/nvgpu/common/mm/lockless_allocator.c +++ b/drivers/gpu/nvgpu/common/mm/lockless_allocator.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2016-2017, 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, @@ -106,6 +106,7 @@ static void nvgpu_lockless_alloc_destroy(struct nvgpu_allocator *a) nvgpu_kfree(nvgpu_alloc_to_gpu(a), pa); } +#ifdef CONFIG_DEBUG_FS static void nvgpu_lockless_print_stats(struct nvgpu_allocator *a, struct seq_file *s, int lock) { @@ -122,6 +123,7 @@ static void nvgpu_lockless_print_stats(struct nvgpu_allocator *a, __alloc_pstat(s, a, " Number free = %d\n", pa->nr_nodes - atomic_read(&pa->nr_allocs)); } +#endif static const struct nvgpu_allocator_ops pool_ops = { .alloc = nvgpu_lockless_alloc, @@ -134,7 +136,9 @@ static const struct nvgpu_allocator_ops pool_ops = { .fini = nvgpu_lockless_alloc_destroy, +#ifdef CONFIG_DEBUG_FS .print_stats = nvgpu_lockless_print_stats, +#endif }; int nvgpu_lockless_allocator_init(struct gk20a *g, struct nvgpu_allocator *__a, diff --git a/drivers/gpu/nvgpu/common/mm/nvgpu_allocator.c b/drivers/gpu/nvgpu/common/mm/nvgpu_allocator.c index b84855b5..115a0904 100644 --- a/drivers/gpu/nvgpu/common/mm/nvgpu_allocator.c +++ b/drivers/gpu/nvgpu/common/mm/nvgpu_allocator.c @@ -150,13 +150,13 @@ int __nvgpu_alloc_common_init(struct nvgpu_allocator *a, struct gk20a *g, return 0; } +#ifdef CONFIG_DEBUG_FS void nvgpu_alloc_print_stats(struct nvgpu_allocator *__a, struct seq_file *s, int lock) { __a->ops->print_stats(__a, s, lock); } -#ifdef CONFIG_DEBUG_FS static int __alloc_show(struct seq_file *s, void *unused) { struct nvgpu_allocator *a = s->private; diff --git a/drivers/gpu/nvgpu/common/mm/page_allocator.c b/drivers/gpu/nvgpu/common/mm/page_allocator.c index 6fbdbedd..2ffff63d 100644 --- a/drivers/gpu/nvgpu/common/mm/page_allocator.c +++ b/drivers/gpu/nvgpu/common/mm/page_allocator.c @@ -742,6 +742,7 @@ static void nvgpu_page_allocator_destroy(struct nvgpu_allocator *__a) alloc_unlock(__a); } +#ifdef CONFIG_DEBUG_FS static void nvgpu_page_print_stats(struct nvgpu_allocator *__a, struct seq_file *s, int lock) { @@ -788,6 +789,7 @@ static void nvgpu_page_print_stats(struct nvgpu_allocator *__a, if (lock) alloc_unlock(__a); } +#endif static const struct nvgpu_allocator_ops page_ops = { .alloc = nvgpu_page_alloc, @@ -807,7 +809,9 @@ static const struct nvgpu_allocator_ops page_ops = { .fini = nvgpu_page_allocator_destroy, +#ifdef CONFIG_DEBUG_FS .print_stats = nvgpu_page_print_stats, +#endif }; /* diff --git a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c index 391f6612..f0927692 100644 --- a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c @@ -18,7 +18,9 @@ #include #include +#ifdef CONFIG_DEBUG_FS #include +#endif #include #include @@ -1662,6 +1664,7 @@ int gk20a_mark_compressible_write(struct gk20a *g, u32 buffer_fd, return 0; } +#ifdef CONFIG_DEBUG_FS static ssize_t gk20a_cde_reload_write(struct file *file, const char __user *userbuf, size_t count, loff_t *ppos) { @@ -1694,3 +1697,4 @@ void gk20a_cde_debugfs_init(struct device *dev) debugfs_create_file("reload_cde_firmware", S_IWUSR, platform->debugfs, g, &gk20a_cde_reload_fops); } +#endif diff --git a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c index 523ba4f6..ed5a8b4e 100644 --- a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c @@ -11,13 +11,11 @@ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. */ +#ifdef CONFIG_DEBUG_FS #include +#endif #include #include diff --git a/drivers/gpu/nvgpu/gk20a/clk_gk20a.c b/drivers/gpu/nvgpu/gk20a/clk_gk20a.c index b69f74b2..e904be49 100644 --- a/drivers/gpu/nvgpu/gk20a/clk_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/clk_gk20a.c @@ -18,7 +18,9 @@ #include #include +#ifdef CONFIG_DEBUG_FS #include +#endif #include #include "gk20a.h" diff --git a/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c b/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c index 94f07701..f3b54355 100644 --- a/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h b/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h index bb79331c..2f84b0dc 100644 --- a/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2016-2017, 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, @@ -24,7 +24,7 @@ struct channel_ctx_gk20a; struct gk20a_ctxsw_dev; struct gk20a_fecs_trace; struct tsg_gk20a; - +struct poll_table_struct; int gk20a_ctxsw_dev_release(struct inode *inode, struct file *filp); int gk20a_ctxsw_dev_open(struct inode *inode, struct file *filp); diff --git a/drivers/gpu/nvgpu/gk20a/debug_gk20a.c b/drivers/gpu/nvgpu/gk20a/debug_gk20a.c index 1a9ffe77..d577c625 100644 --- a/drivers/gpu/nvgpu/gk20a/debug_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/debug_gk20a.c @@ -12,9 +12,12 @@ * */ +#ifdef CONFIG_DEBUG_FS #include +#endif #include #include +#include #include #include @@ -298,8 +301,8 @@ int gk20a_railgating_debugfs_init(struct device *dev) void gk20a_debug_init(struct device *dev, const char *debugfs_symlink) { - struct gk20a_platform *platform = dev_get_drvdata(dev); #ifdef CONFIG_DEBUG_FS + struct gk20a_platform *platform = dev_get_drvdata(dev); struct gk20a *g = platform->g; platform->debugfs = debugfs_create_dir(dev_name(dev), NULL); diff --git a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c index 7d509a4a..9e78c843 100644 --- a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c @@ -13,7 +13,9 @@ #include #include +#ifdef CONFIG_DEBUG_FS #include +#endif #include #include diff --git a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c index c886101c..92698745 100644 --- a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index a1700ebf..7c8b4eae 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -35,6 +35,9 @@ struct dbg_profiler_object_data; #include #include #include +#ifdef CONFIG_DEBUG_FS +#include +#endif #include "../../../arch/arm/mach-tegra/iomap.h" @@ -150,7 +153,9 @@ struct gpu_ops { struct zbc_entry *s_val, u32 index); void (*init_cbc)(struct gk20a *g, struct gr_gk20a *gr); +#ifdef CONFIG_DEBUG_FS void (*sync_debugfs)(struct gk20a *g); +#endif void (*init_fs_state)(struct gk20a *g); void (*isr)(struct gk20a *g); u32 (*cbc_fix_config)(struct gk20a *g, int base); @@ -669,7 +674,9 @@ struct gpu_ops { struct { int (*init_therm_setup_hw)(struct gk20a *g); int (*elcg_init_idle_filters)(struct gk20a *g); +#ifdef CONFIG_DEBUG_FS void (*therm_debugfs_init)(struct gk20a *g); +#endif int (*get_internal_sensor_curr_temp)(struct gk20a *g, u32 *temp_f24_8); void (*get_internal_sensor_limits)(s32 *max_24_8, s32 *min_24_8); @@ -1140,7 +1147,9 @@ struct gk20a { u32 tpc_fs_mask_user; struct nvgpu_bios bios; +#ifdef CONFIG_DEBUG_FS struct debugfs_blob_wrapper bios_blob; +#endif struct nvgpu_clk_arb *clk_arb; diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c index 06c73b90..8c7a9d80 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c @@ -17,7 +17,6 @@ */ #include -#include #include #include #include diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c index 229d5b4f..98513511 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c @@ -17,7 +17,9 @@ */ #include +#ifdef CONFIG_DEBUG_FS #include +#endif #include #include diff --git a/drivers/gpu/nvgpu/gk20a/sched_gk20a.c b/drivers/gpu/nvgpu/gk20a/sched_gk20a.c index ff038b62..54091014 100644 --- a/drivers/gpu/nvgpu/gk20a/sched_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/sched_gk20a.c @@ -13,7 +13,9 @@ #include #include +#ifdef CONFIG_DEBUG_FS #include +#endif #include #include #include diff --git a/drivers/gpu/nvgpu/gk20a/sched_gk20a.h b/drivers/gpu/nvgpu/gk20a/sched_gk20a.h index 1f983678..4f6d1510 100644 --- a/drivers/gpu/nvgpu/gk20a/sched_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/sched_gk20a.h @@ -17,6 +17,7 @@ struct gk20a; struct gpu_ops; struct tsg_gk20a; +struct poll_table_struct; struct gk20a_sched_ctrl { struct gk20a *g; diff --git a/drivers/gpu/nvgpu/gk20a/therm_gk20a.c b/drivers/gpu/nvgpu/gk20a/therm_gk20a.c index 0d2f1281..b700c735 100644 --- a/drivers/gpu/nvgpu/gk20a/therm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/therm_gk20a.c @@ -1,9 +1,7 @@ /* - * drivers/video/tegra/host/gk20a/therm_gk20a.c - * * GK20A Therm * - * Copyright (c) 2011-2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2011-2017, 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, @@ -14,9 +12,8 @@ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ #include "gk20a.h" @@ -105,8 +102,10 @@ int gk20a_init_therm_support(struct gk20a *g) if (err) return err; +#ifdef CONFIG_DEBUG_FS if (g->ops.therm.therm_debugfs_init) g->ops.therm.therm_debugfs_init(g); +#endif return err; } diff --git a/drivers/gpu/nvgpu/gm206/bios_gm206.c b/drivers/gpu/nvgpu/gm206/bios_gm206.c index 6db37d72..058df3c4 100644 --- a/drivers/gpu/nvgpu/gm206/bios_gm206.c +++ b/drivers/gpu/nvgpu/gm206/bios_gm206.c @@ -256,7 +256,9 @@ int gm206_bios_init(struct gk20a *g) { unsigned int i; struct gk20a_platform *platform = dev_get_drvdata(g->dev); +#ifdef CONFIG_DEBUG_FS struct dentry *d; +#endif struct nvgpu_firmware *bios_fw; int err; struct pci_dev *pdev = to_pci_dev(g->dev); @@ -317,6 +319,7 @@ int gm206_bios_init(struct gk20a *g) (g->pci_device_id == 0x1c75) && (g->gpu_characteristics.vbios_version == 0x86065300); +#ifdef CONFIG_DEBUG_FS g->bios_blob.data = g->bios.data; g->bios_blob.size = g->bios.size; @@ -324,6 +327,7 @@ int gm206_bios_init(struct gk20a *g) &g->bios_blob); if (!d) nvgpu_err(g, "No debugfs?"); +#endif gk20a_dbg_fn("done"); diff --git a/drivers/gpu/nvgpu/gm20b/acr_gm20b.c b/drivers/gpu/nvgpu/gm20b/acr_gm20b.c index 7f0edbb2..fafe8734 100644 --- a/drivers/gpu/nvgpu/gm20b/acr_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/acr_gm20b.c @@ -11,8 +11,11 @@ * more details. */ +#ifdef CONFIG_DEBUG_FS #include +#endif +#include #include #include diff --git a/drivers/gpu/nvgpu/gm20b/clk_gm20b.c b/drivers/gpu/nvgpu/gm20b/clk_gm20b.c index aaea080a..8156fa00 100644 --- a/drivers/gpu/nvgpu/gm20b/clk_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/clk_gm20b.c @@ -18,8 +18,10 @@ #include #include +#ifdef CONFIG_DEBUG_FS #include #include +#endif #include #include #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)) diff --git a/drivers/gpu/nvgpu/gp106/acr_gp106.c b/drivers/gpu/nvgpu/gp106/acr_gp106.c index c4045cb6..5570489e 100644 --- a/drivers/gpu/nvgpu/gp106/acr_gp106.c +++ b/drivers/gpu/nvgpu/gp106/acr_gp106.c @@ -11,7 +11,9 @@ * more details. */ +#ifdef CONFIG_DEBUG_FS #include +#endif #include #include diff --git a/drivers/gpu/nvgpu/gp106/clk_gp106.c b/drivers/gpu/nvgpu/gp106/clk_gp106.c index fb9406e5..e4348e73 100644 --- a/drivers/gpu/nvgpu/gp106/clk_gp106.c +++ b/drivers/gpu/nvgpu/gp106/clk_gp106.c @@ -16,8 +16,9 @@ * along with this program. If not, see . */ +#ifdef CONFIG_DEBUG_FS #include -#include +#endif #include diff --git a/drivers/gpu/nvgpu/gp106/therm_gp106.c b/drivers/gpu/nvgpu/gp106/therm_gp106.c index 761d1b89..4f616d8e 100644 --- a/drivers/gpu/nvgpu/gp106/therm_gp106.c +++ b/drivers/gpu/nvgpu/gp106/therm_gp106.c @@ -12,7 +12,9 @@ */ #include "therm_gp106.h" +#ifdef CONFIG_DEBUG_FS #include +#endif #include "therm/thrmpmu.h" #include diff --git a/drivers/gpu/nvgpu/gp106/xve_gp106.c b/drivers/gpu/nvgpu/gp106/xve_gp106.c index a5834174..4d00b20b 100644 --- a/drivers/gpu/nvgpu/gp106/xve_gp106.c +++ b/drivers/gpu/nvgpu/gp106/xve_gp106.c @@ -14,8 +14,10 @@ * along with this program. If not, see . */ +#ifdef CONFIG_DEBUG_FS #include #include +#endif #include "gk20a/gk20a.h" #include "gm206/bios_gm206.h" @@ -498,6 +500,7 @@ static void xve_available_speeds_gp106(struct gk20a *g, u32 *speed_mask) *speed_mask = GPU_XVE_SPEED_2P5 | GPU_XVE_SPEED_5P0; } +#ifdef CONFIG_DEBUG_FS static ssize_t xve_link_speed_write(struct file *filp, const char __user *buff, size_t len, loff_t *off) @@ -621,6 +624,7 @@ static const struct file_operations xve_link_control_status_fops = { .llseek = seq_lseek, .release = single_release, }; +#endif static int xve_sw_init_gp106(struct device *dev) { diff --git a/drivers/gpu/nvgpu/include/nvgpu/allocator.h b/drivers/gpu/nvgpu/include/nvgpu/allocator.h index 61914d8c..b605b059 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/allocator.h +++ b/drivers/gpu/nvgpu/include/nvgpu/allocator.h @@ -17,7 +17,6 @@ #ifndef NVGPU_ALLOCATOR_H #define NVGPU_ALLOCATOR_H -#include #include #include @@ -74,9 +73,11 @@ struct nvgpu_allocator_ops { /* Destructor. */ void (*fini)(struct nvgpu_allocator *allocator); +#ifdef CONFIG_DEBUG_FS /* Debugging. */ void (*print_stats)(struct nvgpu_allocator *allocator, struct seq_file *s, int lock); +#endif }; struct nvgpu_allocator { @@ -246,8 +247,10 @@ u64 nvgpu_alloc_space(struct nvgpu_allocator *a); void nvgpu_alloc_destroy(struct nvgpu_allocator *allocator); +#ifdef CONFIG_DEBUG_FS void nvgpu_alloc_print_stats(struct nvgpu_allocator *a, struct seq_file *s, int lock); +#endif static inline struct gk20a *nvgpu_alloc_to_gpu(struct nvgpu_allocator *a) { diff --git a/drivers/gpu/nvgpu/pmgr/pmgr.c b/drivers/gpu/nvgpu/pmgr/pmgr.c index c41a3a22..f4fe984c 100644 --- a/drivers/gpu/nvgpu/pmgr/pmgr.c +++ b/drivers/gpu/nvgpu/pmgr/pmgr.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2016-2017, 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, @@ -14,7 +14,10 @@ #include "gk20a/gk20a.h" #include "pwrdev.h" #include "pmgrpmu.h" + +#ifdef CONFIG_DEBUG_FS #include +#endif int pmgr_pwr_devices_get_power(struct gk20a *g, u32 *val) { -- cgit v1.2.2