Skip to content

Commit a9fbeab

Browse files
ShuichengLinrodrigovivi
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]>
1 parent 61ef737 commit a9fbeab

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
@@ -119,9 +119,15 @@ static int __domain_wait(struct xe_gt *gt, struct xe_force_wake_domain *domain,
119119
XE_FORCE_WAKE_ACK_TIMEOUT_MS * USEC_PER_MSEC,
120120
&value, true);
121121
if (ret)
122-
xe_gt_notice(gt, "Force wake domain %d failed to ack %s (%pe) reg[%#x] = %#x\n",
123-
domain->id, str_wake_sleep(wake), ERR_PTR(ret),
124-
domain->reg_ack.addr, value);
122+
xe_gt_err(gt, "Force wake domain %d failed to ack %s (%pe) reg[%#x] = %#x\n",
123+
domain->id, str_wake_sleep(wake), ERR_PTR(ret),
124+
domain->reg_ack.addr, value);
125+
if (value == ~0) {
126+
xe_gt_err(gt,
127+
"Force wake domain %d: %s. MMIO unreliable (forcewake register returns 0xFFFFFFFF)!\n",
128+
domain->id, str_wake_sleep(wake));
129+
ret = -EIO;
130+
}
125131

126132
return ret;
127133
}

0 commit comments

Comments
 (0)