From 6bdc90abdd034aeaff53f87951b7e89016619cde Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Sat, 13 Apr 2024 14:20:53 -0400 Subject: Misc non-functional cleanup and documentation --- device_info_procfs.c | 10 +++++----- nvdebug.h | 10 +++++----- nvdebug_entry.c | 7 +++++-- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/device_info_procfs.c b/device_info_procfs.c index c8903fc..ce5843f 100644 --- a/device_info_procfs.c +++ b/device_info_procfs.c @@ -23,6 +23,11 @@ static ssize_t nvdebug_reg32_read(struct file *f, char __user *buf, size_t size, return chars_written; } +struct file_operations nvdebug_read_reg32_file_ops = { + .read = nvdebug_reg32_read, + .llseek = default_llseek, +}; + static ssize_t nvdebug_reg_range_read(struct file *f, char __user *buf, size_t size, loff_t *off) { char out[12]; int chars_written; @@ -49,11 +54,6 @@ static ssize_t nvdebug_reg_range_read(struct file *f, char __user *buf, size_t s return chars_written; } -struct file_operations nvdebug_read_reg32_file_ops = { - .read = nvdebug_reg32_read, - .llseek = default_llseek, -}; - // Generic mechanism used for printing a subset of bits from a register // Please store a `union reg_range` rather than a `uintptr_t` in the pde_data struct file_operations nvdebug_read_reg_range_file_ops = { diff --git a/nvdebug.h b/nvdebug.h index b13d311..755fada 100644 --- a/nvdebug.h +++ b/nvdebug.h @@ -126,6 +126,9 @@ struct gm107_runlist_chan { TSGs appear to have been introduced with Kepler and stayed the same until they were rearranged at the time of channel rearrangement to support longer GPU instance addresses with Volta. + + According to nvgpu, "timeslice is measured with PTIMER [which may be] lower + than 1GHz." */ // Support: Volta, Turing*, Ampere* @@ -527,10 +530,7 @@ typedef union { upon reaching the first entry of INFO_TYPE_NOT_VALID. The fields for the Ampere version of the GPU are a strict subset of those for - the earlier versions. They are in different positions within the struct and - have names ending in _ampere to distinguish them. Other than that, each - Ampere device info field is functionally identical to the equivalent field in - the previous version. + the earlier versions. INFO_TYPE : Is this a DATA, ENUM, or ENGINE_TYPE table entry? HAS_NEXT_ENTRY : Does the following entry refer to the same engine? @@ -573,7 +573,7 @@ typedef union { == INFO_TYPE_ENGINE_TYPE fields == ENGINE_TYPE : What type of engine is this? (see ENGINE_TYPES_NAMES) - Support: Kepler, Maxwell, Pascal, Volta, Ampere + Support: Kepler, Maxwell, Pascal, Volta, Turing, Ampere See dev_top.ref.txt of NVIDIA's open-gpu-doc for more info. */ diff --git a/nvdebug_entry.c b/nvdebug_entry.c index f3dcdbb..24fcd32 100644 --- a/nvdebug_entry.c +++ b/nvdebug_entry.c @@ -22,16 +22,19 @@ MODULE_LICENSE("Dual MIT/GPL"); MODULE_AUTHOR("Joshua Bakita"); MODULE_DESCRIPTION("A scheduling debugging module for NVIDIA GPUs"); +// runlist_procfs.c extern struct file_operations runlist_file_ops; extern struct file_operations preempt_tsg_file_ops; extern struct file_operations disable_channel_file_ops; extern struct file_operations enable_channel_file_ops; extern struct file_operations switch_to_tsg_file_ops; +// device_info_procfs.c extern struct file_operations device_info_file_ops; -extern struct file_operations copy_topology_file_ops; extern struct file_operations nvdebug_read_reg32_file_ops; extern struct file_operations nvdebug_read_reg_range_file_ops; extern struct file_operations local_memory_file_ops; +// copy_topology_procfs.c +extern struct file_operations copy_topology_file_ops; struct nvdebug_state g_nvdebug_state[NVDEBUG_MAX_DEVICES]; unsigned int g_nvdebug_devices = 0; @@ -194,7 +197,7 @@ int create_tpc_mask_files(int device_id, struct proc_dir_entry *dir) { int i; struct proc_dir_entry *gpc_tpc_mask_entry; // Get maximum number of enabled GPCs for this chip - uint32_t max_gpcs = nvdebug_readl(&g_nvdebug_state[device_id], NV_PTOP_SCAL_NUM_GPCS); + uint32_t max_gpcs = nvdebug_readl(g, NV_PTOP_SCAL_NUM_GPCS); // Get a bitmask of which GPCs are disabled uint32_t gpcs_mask; if (g->chip_id < NV_CHIP_ID_AMPERE) -- cgit v1.2.2