summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/gsp_phys_booter.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c
index 8e3f25f..d61df37 100644
--- a/kernel/gsp_phys_booter.c
+++ b/kernel/gsp_phys_booter.c
@@ -20758,6 +20758,22 @@ static void gsp_phys_gr_ctx_wipe_latches(void)
* stream3d lane only, so CUDA/QMD and CE submissions are untouched.
*/
static u32 gsp_phys_gr_cwd_clears;
+/*
+ * eng16: 0x40706c (our "cwd3") is a read-only hardware sentinel - it reads
+ * 0xbadf5040 on every read (305/305 samples, write 0x0 -> readback unchanged;
+ * eng15 receipts). Gating the pre-replay clear on it made the clear fire on
+ * EVERY stream3d launch (7x/boot observed c250-254), running a TSG
+ * preempt/resched + MME latch wipe before each replay while the noQMD replay
+ * lane carries no context re-load - i.e. the clear itself destroyed the
+ * context the incremental chunks ran against. The predicate now uses only
+ * the real poison sources (esr 0x404490, grfifo 0x400504); cwd3 is read for
+ * the log line only. knob sema_gl_cwd_clear (default 1) = A/B switch.
+ */
+static bool gsp_phys_gr_cwd_clear_en = true;
+module_param_named(sema_gl_cwd_clear, gsp_phys_gr_cwd_clear_en, bool, 0644);
+MODULE_PARM_DESC(sema_gl_cwd_clear,
+ "Pre-replay FE priv-error clear on the stream3d lane. Predicate = real poison sources only (esr 0x404490 / grfifo 0x400504; cwd3 0x40706c excluded - hardware read sentinel). 0 = fully off (A/B knob)");
+
static void gsp_phys_gr_cwd_clear_locked(void __iomem *bar0, u32 h_object,
u64 push_va)
{
@@ -20766,7 +20782,6 @@ static void gsp_phys_gr_cwd_clear_locked(void __iomem *bar0, u32 h_object,
u32 gf = ioread32(bar0 + 0x00400504u);
if ((esr & 0xffff0000u) != 0xbadf0000u &&
- (cwd3 & 0xffff0000u) != 0xbadf0000u &&
(gf & 0xffff0000u) != 0xbadf0000u)
return;
gsp_phys_gr_cwd_clears++;
@@ -31023,11 +31038,13 @@ gr_page_unmapped:
* CONT.474 CWD-CLEAR: clear a pre-existing 0xbadf FE priv-error latch
* BEFORE this replay is emitted (see gsp_phys_gr_cwd_clear_locked).
* Bounded to one attempt per launch; stream3d lane only, so the
- * CUDA/QMD and CE paths never reach this site. Gated by the same
- * sema_gr_wedge_recover knob as the mid-launch recovery, which stays
- * available for a poison the replay itself causes.
+ * CUDA/QMD and CE paths never reach this site. Gated by
+ * sema_gl_cwd_clear (eng16 A/B knob) and the same sema_gr_wedge_recover
+ * knob as the mid-launch recovery, which stays available for a poison
+ * the replay itself causes.
*/
if (stream3d && bar0 && !cwd_clear_done &&
+ READ_ONCE(gsp_phys_gr_cwd_clear_en) &&
READ_ONCE(gsp_phys_gr_wedge_recover)) {
cwd_clear_done = true;
gsp_phys_gr_cwd_clear_locked(bar0, req->h_object, req->push_va);