Skip to content

Commit 69418db

Browse files
ShuichengLinlucasdemarchi
authored andcommitted
drm/xe: Handle unreliable MMIO reads during forcewake
In some cases, when the driver attempts to read an MMIO register, the hardware may return 0xFFFFFFFF. The current force wake path code treats this as a valid response, as it only checks the BIT. However, 0xFFFFFFFF should be considered an invalid value, indicating a potential issue. To address this, we should add a log entry to highlight this condition and return failure. The force wake failure log level is changed from notice to err to match the failure return value. v2 (Matt Brost): - set ret value (-EIO) to kick the error to upper layers v3 (Rodrigo): - add commit message for the log level promotion from notice to err v4: - update reviewed info Suggested-by: Alex Zuo <[email protected]> Signed-off-by: Shuicheng Lin <[email protected]> Cc: Matthew Brost <[email protected]> Cc: Michal Wajdeczko <[email protected]> Reviewed-by: Himal Prasad Ghimiray <[email protected]> Acked-by: Badal Nilawar <[email protected]> Cc: Anshuman Gupta <[email protected]> Cc: Matt Roper <[email protected]> Cc: Rodrigo Vivi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Rodrigo Vivi <[email protected]> (cherry picked from commit a9fbeab) Signed-off-by: Lucas De Marchi <[email protected]>
1 parent 22ef43c commit 69418db

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

drivers/gpu/drm/xe/xe_force_wake.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,15 @@ static int __domain_wait(struct xe_gt *gt, struct xe_force_wake_domain *domain,
115115
XE_FORCE_WAKE_ACK_TIMEOUT_MS * USEC_PER_MSEC,
116116
&value, true);
117117
if (ret)
118-
xe_gt_notice(gt, "Force wake domain %d failed to ack %s (%pe) reg[%#x] = %#x\n",
119-
domain->id, str_wake_sleep(wake), ERR_PTR(ret),
120-
domain->reg_ack.addr, value);
118+
xe_gt_err(gt, "Force wake domain %d failed to ack %s (%pe) reg[%#x] = %#x\n",
119+
domain->id, str_wake_sleep(wake), ERR_PTR(ret),
120+
domain->reg_ack.addr, value);
121+
if (value == ~0) {
122+
xe_gt_err(gt,
123+
"Force wake domain %d: %s. MMIO unreliable (forcewake register returns 0xFFFFFFFF)!\n",
124+
domain->id, str_wake_sleep(wake));
125+
ret = -EIO;
126+
}
121127

122128
return ret;
123129
}

0 commit comments

Comments
 (0)