mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
Upstream Linux commit 393b06383fb7 ("debugfs: remove return value of
debugfs_create_bool()") updated the function debugfs_create_bool() to
remove the return value because it was not needed and user do not need
to check the return value. This breaks building the NVGPU driver against
the current upstream Linux kernel and the following error messages are
seen ...
nvgpu/drivers/gpu/nvgpu/os/linux/debug.c: In function ‘gk20a_debug_init’:
nvgpu/drivers/gpu/nvgpu/os/linux/debug.c:469:25: error: void value not ignored as it ought to be
l->debugfs_ltc_enabled =
^
nvgpu/drivers/gpu/nvgpu/os/linux/debug.c:507:32: error: void value not ignored as it ought to be
l->debugfs_runlist_interleave =
^
Fix this by not saving the value returned from debugfs_create_bool() and
remove the variables debugfs_ltc_enabled and debugfs_runlist_interleave
from the nvgpu_os_linux structure. Note that these variables are not
used anywhere in the driver and currently we don't check the return
value from debugfs_create_bool() and so there is no impact from this
change for older kernel versions.
JIRA LS-114
Change-Id: I539388c8645f2026292d8b9f33f55921dfda648f
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2555299
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
157 lines
3.7 KiB
C
157 lines
3.7 KiB
C
/*
|
|
* Copyright (c) 2017-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,
|
|
* version 2, as published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
* 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, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef NVGPU_OS_LINUX_H
|
|
#define NVGPU_OS_LINUX_H
|
|
|
|
#include <linux/iommu.h>
|
|
#include <linux/notifier.h>
|
|
#include <linux/version.h>
|
|
|
|
#include <nvgpu/gk20a.h>
|
|
#include <nvgpu/interrupts.h>
|
|
|
|
#include "cde.h"
|
|
#include "sched.h"
|
|
|
|
struct nvgpu_os_linux_ops {
|
|
struct {
|
|
void (*get_program_numbers)(struct gk20a *g,
|
|
u32 block_height_log2,
|
|
u32 shader_parameter,
|
|
int *hprog, int *vprog);
|
|
bool (*need_scatter_buffer)(struct gk20a *g);
|
|
int (*populate_scatter_buffer)(struct gk20a *g,
|
|
struct sg_table *sgt,
|
|
size_t surface_size,
|
|
void *scatter_buffer_ptr,
|
|
size_t scatter_buffer_size);
|
|
} cde;
|
|
|
|
struct {
|
|
int (*init_debugfs)(struct gk20a *g);
|
|
} clk;
|
|
|
|
struct {
|
|
int (*init_debugfs)(struct gk20a *g);
|
|
} therm;
|
|
|
|
struct {
|
|
int (*init_debugfs)(struct gk20a *g);
|
|
} fecs_trace;
|
|
|
|
struct {
|
|
int (*init_debugfs)(struct gk20a *g);
|
|
} volt;
|
|
|
|
struct {
|
|
int (*init_debugfs)(struct gk20a *g);
|
|
} s_param;
|
|
};
|
|
|
|
struct dgpu_thermal_alert {
|
|
struct workqueue_struct *workqueue;
|
|
struct work_struct work;
|
|
u32 therm_alert_irq;
|
|
u32 event_delay;
|
|
};
|
|
|
|
struct nvgpu_os_linux {
|
|
struct gk20a g;
|
|
struct device *dev;
|
|
struct dgpu_thermal_alert thermal_alert;
|
|
struct nvgpu_interrupts interrupts;
|
|
|
|
struct nvgpu_list_node class_list_head;
|
|
struct nvgpu_list_node cdev_list_head;
|
|
u32 power_cdevs;
|
|
u32 num_cdevs;
|
|
bool dev_nodes_created;
|
|
bool cdev_list_init_done;
|
|
|
|
dev_t power_cdev_region;
|
|
dev_t cdev_region;
|
|
|
|
/* see gk20a_ctrl_priv */
|
|
struct nvgpu_list_node ctrl_privs;
|
|
/* guards modifications to the list and its contents */
|
|
struct nvgpu_mutex ctrl_privs_lock;
|
|
|
|
struct devfreq *devfreq;
|
|
|
|
struct device_dma_parameters dma_parms;
|
|
|
|
atomic_t nonstall_ops;
|
|
|
|
struct work_struct nonstall_fn_work;
|
|
struct workqueue_struct *nonstall_work_queue;
|
|
|
|
struct resource *reg_mem;
|
|
struct resource *bar1_mem;
|
|
|
|
struct nvgpu_os_linux_ops ops;
|
|
|
|
struct notifier_block nvgpu_reboot_nb;
|
|
|
|
#ifdef CONFIG_DEBUG_FS
|
|
struct dentry *debugfs;
|
|
struct dentry *debugfs_alias;
|
|
|
|
struct dentry *debugfs_timeouts_enabled;
|
|
struct dentry *debugfs_disable_bigpage;
|
|
struct dentry *debugfs_dbg_tsg_timeslice_max_us;
|
|
struct dentry *debugfs_disable_syncpts;
|
|
|
|
struct dentry *debugfs_allocators;
|
|
struct dentry *debugfs_xve;
|
|
struct dentry *debugfs_kmem;
|
|
struct dentry *debugfs_hal;
|
|
struct dentry *debugfs_ltc;
|
|
|
|
struct dentry *debugfs_dump_ctxsw_stats;
|
|
#endif
|
|
struct dev_ext_attribute *ecc_attrs;
|
|
|
|
struct gk20a_cde_app cde_app;
|
|
|
|
struct rw_semaphore busy_lock;
|
|
|
|
struct nvgpu_mutex dmabuf_priv_list_lock;
|
|
struct nvgpu_list_node dmabuf_priv_list;
|
|
|
|
bool init_done;
|
|
|
|
bool enable_platform_dbg;
|
|
};
|
|
|
|
static inline struct nvgpu_os_linux *nvgpu_os_linux_from_gk20a(struct gk20a *g)
|
|
{
|
|
return container_of(g, struct nvgpu_os_linux, g);
|
|
}
|
|
|
|
static inline struct device *dev_from_gk20a(struct gk20a *g)
|
|
{
|
|
return nvgpu_os_linux_from_gk20a(g)->dev;
|
|
}
|
|
|
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
|
|
#define totalram_size_in_mb (totalram_pages() >> (10 - (PAGE_SHIFT - 10)))
|
|
#else
|
|
#define totalram_size_in_mb (totalram_pages >> (10 - (PAGE_SHIFT - 10)))
|
|
#endif
|
|
|
|
#endif
|