From 217aaa952fb812bfdce62402cfab959910ea7265 Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Wed, 11 Jun 2025 15:05:01 -0400 Subject: Fix fallback to PRAMIN on non-Hopper/Blackwell platforms --- runlist_procfs.c | 17 +++++++++-------- 1 file 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 @@ #include "nvdebug_linux.h" -// We cannot touch PRAMIN (via page table operations or ctxsw access) if we're -// using it to walk the runlist -//#ifndef FALLBACK_TO_PRAMIN // Uncomment to expand channel status, instance, and context information when // printing the runlist #define DETAILED_CHANNEL_INFO -//#endif #ifdef DETAILED_CHANNEL_INFO // 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 int i; #ifdef FALLBACK_TO_PRAMIN + uint32_t window_reg; + if ((g->chip_id >= NV_CHIP_ID_HOPPER && g->chip_id < NV_CHIP_ID_ADA) || g->chip_id >= NV_CHIP_ID_BLACKWELL) + window_reg = NV_XAL_EP_BAR0_WINDOW_BASE; + else + window_reg = NV_PBUS_BAR0_WINDOW; bar0_window_t win; - win.raw = nvdebug_readl(g, NV_XAL_EP_BAR0_WINDOW_BASE); + win.raw = nvdebug_readl(g, window_reg); inst = g->regs + NV_PRAMIN + addr_to_pramin_mut(g, instance_ptr, instance_target); #else 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 if (IS_ERR(ctxsw = get_ctxsw(g, inst))) { #ifdef FALLBACK_TO_PRAMIN - nvdebug_writel(g, NV_XAL_EP_BAR0_WINDOW_BASE, win.raw); + nvdebug_writel(g, window_reg, win.raw); #endif return PTR_ERR(ctxsw); } // If unable to access CTXSW block, skip if (!ctxsw) { #ifdef FALLBACK_TO_PRAMIN - nvdebug_writel(g, NV_XAL_EP_BAR0_WINDOW_BASE, win.raw); + nvdebug_writel(g, window_reg, win.raw); #endif return 0; } @@ -107,7 +108,7 @@ static int runlist_detail_seq_show_inst(struct seq_file *s, struct nvdebug_state seq_printf(s, "%s| #GFXP Saves:%8d|\n", prefix, ctxsw->num_gfxp_save_operations); seq_printf(s, "%s| #CILP Saves:%8d|\n", prefix, ctxsw->num_cilp_save_operations); #ifdef FALLBACK_TO_PRAMIN - nvdebug_writel(g, NV_XAL_EP_BAR0_WINDOW_BASE, win.raw); + nvdebug_writel(g, window_reg, win.raw); #endif return 0; } -- cgit v1.2.2