Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Shuicheng Lin <shuicheng.lin@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Shuicheng Lin <shuicheng.lin@intel.com>,
	Alex Zuo <alex.zuo@intel.com>,
	Matthew Brost <matthew.brost@intel.com>,
	Michal Wajdeczko <michal.wajdeczko@intel.com>,
	Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>,
	Matt Roper <matthew.d.roper@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: [PATCH v3] drm/xe: Handle unreliable MMIO reads during forcewake
Date: Thu, 17 Oct 2024 16:30:38 +0000	[thread overview]
Message-ID: <20241017163038.1554591-1-shuicheng.lin@intel.com> (raw)
In-Reply-To: <20241017034026.1525693-1-shuicheng.lin@intel.com>

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

Suggested-by: Alex Zuo <alex.zuo@intel.com>
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/xe/xe_force_wake.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_force_wake.c b/drivers/gpu/drm/xe/xe_force_wake.c
index a64c14757c84..08621717b14b 100644
--- a/drivers/gpu/drm/xe/xe_force_wake.c
+++ b/drivers/gpu/drm/xe/xe_force_wake.c
@@ -115,9 +115,15 @@ static int __domain_wait(struct xe_gt *gt, struct xe_force_wake_domain *domain,
 			     XE_FORCE_WAKE_ACK_TIMEOUT_MS * USEC_PER_MSEC,
 			     &value, true);
 	if (ret)
-		xe_gt_notice(gt, "Force wake domain %d failed to ack %s (%pe) reg[%#x] = %#x\n",
-			     domain->id, str_wake_sleep(wake), ERR_PTR(ret),
-			     domain->reg_ack.addr, value);
+		xe_gt_err(gt, "Force wake domain %d failed to ack %s (%pe) reg[%#x] = %#x\n",
+			  domain->id, str_wake_sleep(wake), ERR_PTR(ret),
+			  domain->reg_ack.addr, value);
+	if (value == ~0) {
+		xe_gt_err(gt,
+			  "Force wake domain %d: %s. MMIO unreliable (forcewake register returns 0xFFFFFFFF)!\n",
+			  domain->id, str_wake_sleep(wake));
+		ret = -EIO;
+	}
 
 	return ret;
 }
-- 
2.25.1


  parent reply	other threads:[~2024-10-17 17:06 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-17  3:40 [PATCH v2] drm/xe: Log unreliable MMIO reads during forcewake Shuicheng Lin
2024-10-17  4:21 ` ✓ CI.Patch_applied: success for drm/xe: Log unreliable MMIO reads during forcewake (rev2) Patchwork
2024-10-17  4:21 ` ✓ CI.checkpatch: " Patchwork
2024-10-17  4:22 ` ✓ CI.KUnit: " Patchwork
2024-10-17  4:34 ` ✓ CI.Build: " Patchwork
2024-10-17  4:36 ` ✓ CI.Hooks: " Patchwork
2024-10-17  4:37 ` ✓ CI.checksparse: " Patchwork
2024-10-17  5:01 ` ✓ CI.BAT: " Patchwork
2024-10-17 14:35 ` [PATCH v2] drm/xe: Log unreliable MMIO reads during forcewake Ghimiray, Himal Prasad
2024-10-17 14:55 ` ✗ CI.FULL: failure for drm/xe: Log unreliable MMIO reads during forcewake (rev2) Patchwork
2024-10-17 15:30 ` [PATCH v2] drm/xe: Log unreliable MMIO reads during forcewake Nilawar, Badal
2024-10-17 16:14   ` Lin, Shuicheng
2024-10-17 16:30 ` Rodrigo Vivi
2024-10-17 16:30 ` Shuicheng Lin [this message]
2024-10-17 17:50   ` [PATCH v3] drm/xe: Handle " Ghimiray, Himal Prasad
2024-10-17 22:25     ` Lin, Shuicheng
2024-10-18 15:13       ` Rodrigo Vivi
2024-10-17 17:31 ` ✓ CI.Patch_applied: success for drm/xe: Log unreliable MMIO reads during forcewake (rev3) Patchwork
2024-10-17 17:31 ` ✓ CI.checkpatch: " Patchwork
2024-10-17 17:34 ` ✓ CI.KUnit: " Patchwork
2024-10-17 17:46 ` ✓ CI.Build: " Patchwork
2024-10-17 17:48 ` ✓ CI.Hooks: " Patchwork
2024-10-17 17:50 ` ✓ CI.checksparse: " Patchwork
2024-10-17 18:18 ` ✓ CI.BAT: " Patchwork
2024-10-17 22:15 ` [PATCH v4] drm/xe: Handle unreliable MMIO reads during forcewake Shuicheng Lin
2024-10-17 22:58 ` ✓ CI.Patch_applied: success for drm/xe: Log unreliable MMIO reads during forcewake (rev4) Patchwork
2024-10-17 22:58 ` ✓ CI.checkpatch: " Patchwork
2024-10-17 22:59 ` ✓ CI.KUnit: " Patchwork
2024-10-17 23:11 ` ✓ CI.Build: " Patchwork
2024-10-17 23:13 ` ✓ CI.Hooks: " Patchwork
2024-10-17 23:15 ` ✓ CI.checksparse: " Patchwork
2024-10-17 23:34 ` ✓ CI.BAT: " Patchwork
2024-10-18  9:53 ` ✗ CI.FULL: failure for drm/xe: Log unreliable MMIO reads during forcewake (rev3) Patchwork
2024-10-18 16:00 ` ✗ CI.FULL: failure for drm/xe: Log unreliable MMIO reads during forcewake (rev4) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241017163038.1554591-1-shuicheng.lin@intel.com \
    --to=shuicheng.lin@intel.com \
    --cc=alex.zuo@intel.com \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.brost@intel.com \
    --cc=matthew.d.roper@intel.com \
    --cc=michal.wajdeczko@intel.com \
    --cc=rodrigo.vivi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox