aboutsummaryrefslogtreecommitdiffstats
path: root/nvdebug_entry.c
diff options
context:
space:
mode:
authorBenjamin Hadad IV <bh4@unc.edu>2023-07-19 13:02:52 -0400
committerBenjamin Hadad IV <bh4@unc.edu>2023-07-19 13:02:52 -0400
commit33c915f08f5dc63674b158ecc18897494256a6d0 (patch)
tree917bfa0e6b3b5f482ddb3180f40d2dac9b6dfed1 /nvdebug_entry.c
parentbfb4dcf0e78954c0163f3a06a5a088c4d1b437a8 (diff)
Debugged device_info functionality
- Fixed device_info crash bugs - Made further edits to display functionality - Refactored code to enhance readability
Diffstat (limited to 'nvdebug_entry.c')
-rw-r--r--nvdebug_entry.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/nvdebug_entry.c b/nvdebug_entry.c
index d82c648..3dfe1e8 100644
--- a/nvdebug_entry.c
+++ b/nvdebug_entry.c
@@ -150,7 +150,7 @@ int create_runlist_files_previous(int device_id, struct proc_dir_entry *dir) {
150 // Figure out how many runlists there are by checking the device info 150 // Figure out how many runlists there are by checking the device info
151 // registers. Runlists are always numbered sequentially, so we just have 151 // registers. Runlists are always numbered sequentially, so we just have
152 // to find the highest-valued one and add 1 to get the number of runlists. 152 // to find the highest-valued one and add 1 to get the number of runlists.
153 for (i = 0; i < NV_PTOP_DEVICE_INFO__SIZE_1; i++) { 153 for (i = 0; i < NV_PTOP_DEVICE_INFO__SIZE_1_PREVIOUS; i++) {
154 info.raw = nvdebug_readl(&g_nvdebug_state[device_id], NV_PTOP_DEVICE_INFO_PREVIOUS(i)); 154 info.raw = nvdebug_readl(&g_nvdebug_state[device_id], NV_PTOP_DEVICE_INFO_PREVIOUS(i));
155 if (info.info_type != INFO_TYPE_ENUM || !info.runlist_is_valid) 155 if (info.info_type != INFO_TYPE_ENUM || !info.runlist_is_valid)
156 continue; 156 continue;
@@ -180,7 +180,7 @@ int create_runlist_files_ampere(int device_id, struct proc_dir_entry *dir) {
180 // Figure out how many runlists there are by checking the device info 180 // Figure out how many runlists there are by checking the device info
181 // registers. Runlists are always numbered sequentially, so we just have 181 // registers. Runlists are always numbered sequentially, so we just have
182 // to find the highest-valued one and add 1 to get the number of runlists. 182 // to find the highest-valued one and add 1 to get the number of runlists.
183 for (i = 0; i < (nvdebug_readl(&g_nvdebug_state[device_id], 0x0224fc) >> 20); i++) { 183 for (i = 0; i < NV_PTOP_DEVICE_INFO__SIZE_1_AMPERE(&g_nvdebug_state[device_id]); i++) {
184 info.raw = nvdebug_readl(&g_nvdebug_state[device_id], NV_PTOP_DEVICE_INFO_AMPERE(i)); 184 info.raw = nvdebug_readl(&g_nvdebug_state[device_id], NV_PTOP_DEVICE_INFO_AMPERE(i));
185 if (info.runlist_enum_ampere > max_rl_id) 185 if (info.runlist_enum_ampere > max_rl_id)
186 max_rl_id = info.runlist_enum; 186 max_rl_id = info.runlist_enum;