summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/gsp_phys_booter.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c
index b966ac3..d20e042 100644
--- a/kernel/gsp_phys_booter.c
+++ b/kernel/gsp_phys_booter.c
@@ -16314,6 +16314,16 @@ static u64 gsp_phys_gr_stall_retry;
static u32 gsp_phys_gr_nw_streak;
static u64 gsp_phys_gr_wedge_quiet;
static u64 gsp_phys_gr_wedge_heals;
+/*
+ * r411: once a quiet heal has succeeded on this boot, the lane is in a
+ * wedge-prone episode. r418 showed the wedge can alternate one-no-write /
+ * one-heal, and the healed launch resets nw_streak, so a streak-only trigger
+ * quieted only every second wedged launch and the other was accepted. The
+ * heal count makes the episode sticky for the boot: any later zero-write
+ * launch gets the quiet path on its first retry, so every wedged launch
+ * either heals (engine writes, client data correct) or is loudly classified.
+ */
+static bool gsp_phys_gr_wedge_episode;
/* m86: program-page override blob (see gsp-phys-gr-override). */
static u8 gsp_phys_gr_override[GSP_PHYS_PAGE_SIZE];
static u32 gsp_phys_gr_override_len;
@@ -20529,7 +20539,8 @@ gr_page_unmapped:
while (wrote == 0 && nw_attempts < nw_retries) {
u32 quiet_ms = 0;
- if (READ_ONCE(gsp_phys_gr_nw_streak) > 0 &&
+ if ((READ_ONCE(gsp_phys_gr_nw_streak) > 0 ||
+ READ_ONCE(gsp_phys_gr_wedge_episode)) &&
nw_attempts <= 1) {
quiet_ms =
gsp_phys_gr_wedge_quiet_ms_value();
@@ -20833,6 +20844,8 @@ gr_page_unmapped:
if (quiet_used) {
if (wrote) {
gsp_phys_gr_wedge_heals++;
+ WRITE_ONCE(gsp_phys_gr_wedge_episode,
+ true);
pr_warn("vgsp-gr: WEDGE-QUIET healed: engine wrote %u page(s) after the %u ms hold (streak was %u)\n",
wrote, quiet_used,
READ_ONCE(
@@ -21003,10 +21016,16 @@ gr_page_unmapped:
* even when the retry loop is disabled so the streak always
* reflects the accepted-outcome history.
*/
- if (n_tracked)
+ if (n_tracked) {
WRITE_ONCE(gsp_phys_gr_nw_streak,
wrote ? 0u :
READ_ONCE(gsp_phys_gr_nw_streak) + 1u);
+ /* r411: arm the wedge episode on any accepted
+ * zero-write launch, so the next zero-write launch
+ * quiets even after a heal reset the streak. */
+ if (!wrote)
+ WRITE_ONCE(gsp_phys_gr_wedge_episode, true);
+ }
}
/*
* m114: the kernel ran against the pre-commit bounce window; copy the