aboutsummaryrefslogtreecommitdiffstats
path: root/runlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'runlist.c')
-rw-r--r--runlist.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/runlist.c b/runlist.c
index 91fca82..2e9577d 100644
--- a/runlist.c
+++ b/runlist.c
@@ -8,8 +8,10 @@
8#include "nvdebug.h" 8#include "nvdebug.h"
9 9
10// Uncomment to, upon BAR2 access failure, return a PRAMIN-based runlist pointer 10// Uncomment to, upon BAR2 access failure, return a PRAMIN-based runlist pointer
11// **If enabled, PRAMIN may not be otherwise used while walking the runlist!** 11// in get_runlist_iter(). In order for this pointer to remain valid, PRAMIN
12// Runlists can only be printed on the Jetson TX2 if this is enabled. 12// **must** not be moved during runlist traversal.
13// The Jetson TX2 has no BAR2, and stores the runlist in VID_MEM, so this must
14// be enabled to print the runlist on the TX2.
13//#define FALLBACK_TO_PRAMIN 15//#define FALLBACK_TO_PRAMIN
14 16
15/* Get runlist head and info (incl. length) 17/* Get runlist head and info (incl. length)
@@ -142,12 +144,16 @@ int preempt_runlist(struct nvdebug_state *g, uint32_t rl_id) {
142int resubmit_runlist(struct nvdebug_state *g, uint32_t rl_id) { 144int resubmit_runlist(struct nvdebug_state *g, uint32_t rl_id) {
143 if (g->chip_id < NV_CHIP_ID_TURING) { 145 if (g->chip_id < NV_CHIP_ID_TURING) {
144 eng_runlist_gf100_t rl; 146 eng_runlist_gf100_t rl;
147 if (rl_id > MAX_RUNLISTS_GF100)
148 return -EINVAL;
145 if ((rl.raw = nvdebug_readq(g, NV_PFIFO_ENG_RUNLIST_BASE_GF100(rl_id))) == -1) 149 if ((rl.raw = nvdebug_readq(g, NV_PFIFO_ENG_RUNLIST_BASE_GF100(rl_id))) == -1)
146 return -EIO; 150 return -EIO;
147 rl.id = rl_id; 151 rl.id = rl_id;
148 nvdebug_writeq(g, NV_PFIFO_RUNLIST_BASE_GF100, rl.raw); 152 nvdebug_writeq(g, NV_PFIFO_RUNLIST_BASE_GF100, rl.raw);
149 } else if (g->chip_id < NV_CHIP_ID_AMPERE) { 153 } else if (g->chip_id < NV_CHIP_ID_AMPERE) {
150 runlist_submit_tu102_t submit; 154 runlist_submit_tu102_t submit;
155 if (rl_id > MAX_RUNLISTS_TU102)
156 return -EINVAL;
151 if ((submit.raw = nvdebug_readq(g, NV_PFIFO_RUNLIST_SUBMIT_TU102(rl_id))) == -1) 157 if ((submit.raw = nvdebug_readq(g, NV_PFIFO_RUNLIST_SUBMIT_TU102(rl_id))) == -1)
152 return -EIO; 158 return -EIO;
153 nvdebug_writeq(g, NV_PFIFO_RUNLIST_SUBMIT_TU102(rl_id), submit.raw); 159 nvdebug_writeq(g, NV_PFIFO_RUNLIST_SUBMIT_TU102(rl_id), submit.raw);