diff options
-rw-r--r-- | runlist_procfs.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/runlist_procfs.c b/runlist_procfs.c index a3a6df3..d4b5a4d 100644 --- a/runlist_procfs.c +++ b/runlist_procfs.c | |||
@@ -9,13 +9,9 @@ | |||
9 | 9 | ||
10 | #include "nvdebug_linux.h" | 10 | #include "nvdebug_linux.h" |
11 | 11 | ||
12 | // We cannot touch PRAMIN (via page table operations or ctxsw access) if we're | ||
13 | // using it to walk the runlist | ||
14 | //#ifndef FALLBACK_TO_PRAMIN | ||
15 | // Uncomment to expand channel status, instance, and context information when | 12 | // Uncomment to expand channel status, instance, and context information when |
16 | // printing the runlist | 13 | // printing the runlist |
17 | #define DETAILED_CHANNEL_INFO | 14 | #define DETAILED_CHANNEL_INFO |
18 | //#endif | ||
19 | 15 | ||
20 | #ifdef DETAILED_CHANNEL_INFO | 16 | #ifdef DETAILED_CHANNEL_INFO |
21 | // Print the channel instance and context swtich blocks | 17 | // Print the channel instance and context swtich blocks |
@@ -29,8 +25,13 @@ static int runlist_detail_seq_show_inst(struct seq_file *s, struct nvdebug_state | |||
29 | int i; | 25 | int i; |
30 | 26 | ||
31 | #ifdef FALLBACK_TO_PRAMIN | 27 | #ifdef FALLBACK_TO_PRAMIN |
28 | uint32_t window_reg; | ||
29 | if ((g->chip_id >= NV_CHIP_ID_HOPPER && g->chip_id < NV_CHIP_ID_ADA) || g->chip_id >= NV_CHIP_ID_BLACKWELL) | ||
30 | window_reg = NV_XAL_EP_BAR0_WINDOW_BASE; | ||
31 | else | ||
32 | window_reg = NV_PBUS_BAR0_WINDOW; | ||
32 | bar0_window_t win; | 33 | bar0_window_t win; |
33 | win.raw = nvdebug_readl(g, NV_XAL_EP_BAR0_WINDOW_BASE); | 34 | win.raw = nvdebug_readl(g, window_reg); |
34 | inst = g->regs + NV_PRAMIN + addr_to_pramin_mut(g, instance_ptr, instance_target); | 35 | inst = g->regs + NV_PRAMIN + addr_to_pramin_mut(g, instance_ptr, instance_target); |
35 | #else | 36 | #else |
36 | if (IS_ERR(inst = instance_deref(g, instance_ptr, instance_target))) | 37 | if (IS_ERR(inst = instance_deref(g, instance_ptr, instance_target))) |
@@ -81,14 +82,14 @@ static int runlist_detail_seq_show_inst(struct seq_file *s, struct nvdebug_state | |||
81 | 82 | ||
82 | if (IS_ERR(ctxsw = get_ctxsw(g, inst))) { | 83 | if (IS_ERR(ctxsw = get_ctxsw(g, inst))) { |
83 | #ifdef FALLBACK_TO_PRAMIN | 84 | #ifdef FALLBACK_TO_PRAMIN |
84 | nvdebug_writel(g, NV_XAL_EP_BAR0_WINDOW_BASE, win.raw); | 85 | nvdebug_writel(g, window_reg, win.raw); |
85 | #endif | 86 | #endif |
86 | return PTR_ERR(ctxsw); | 87 | return PTR_ERR(ctxsw); |
87 | } | 88 | } |
88 | // If unable to access CTXSW block, skip | 89 | // If unable to access CTXSW block, skip |
89 | if (!ctxsw) { | 90 | if (!ctxsw) { |
90 | #ifdef FALLBACK_TO_PRAMIN | 91 | #ifdef FALLBACK_TO_PRAMIN |
91 | nvdebug_writel(g, NV_XAL_EP_BAR0_WINDOW_BASE, win.raw); | 92 | nvdebug_writel(g, window_reg, win.raw); |
92 | #endif | 93 | #endif |
93 | return 0; | 94 | return 0; |
94 | } | 95 | } |
@@ -107,7 +108,7 @@ static int runlist_detail_seq_show_inst(struct seq_file *s, struct nvdebug_state | |||
107 | seq_printf(s, "%s| #GFXP Saves:%8d|\n", prefix, ctxsw->num_gfxp_save_operations); | 108 | seq_printf(s, "%s| #GFXP Saves:%8d|\n", prefix, ctxsw->num_gfxp_save_operations); |
108 | seq_printf(s, "%s| #CILP Saves:%8d|\n", prefix, ctxsw->num_cilp_save_operations); | 109 | seq_printf(s, "%s| #CILP Saves:%8d|\n", prefix, ctxsw->num_cilp_save_operations); |
109 | #ifdef FALLBACK_TO_PRAMIN | 110 | #ifdef FALLBACK_TO_PRAMIN |
110 | nvdebug_writel(g, NV_XAL_EP_BAR0_WINDOW_BASE, win.raw); | 111 | nvdebug_writel(g, window_reg, win.raw); |
111 | #endif | 112 | #endif |
112 | return 0; | 113 | return 0; |
113 | } | 114 | } |