[PATCH 2/2] drm/xe: Fix xe_force_wake_assert_held for enum XE_FORCEWAKE_ALL

Himal Prasad Ghimiray himal.prasad.ghimiray at intel.com
Fri May 31 06:48:45 UTC 2024


Make sure that the assertion condition covers the wakefulness of all
supported domains for XE_FORCEWAKE_ALL.

Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
Cc: Badal Nilawar <badal.nilawar at intel.com>
Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray at intel.com>
---
 drivers/gpu/drm/xe/xe_force_wake.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_force_wake.h b/drivers/gpu/drm/xe/xe_force_wake.h
index 83cb157da7cc..4c986d72cba7 100644
--- a/drivers/gpu/drm/xe/xe_force_wake.h
+++ b/drivers/gpu/drm/xe/xe_force_wake.h
@@ -32,7 +32,12 @@ static inline void
 xe_force_wake_assert_held(struct xe_force_wake *fw,
 			  enum xe_force_wake_domains domain)
 {
-	xe_gt_assert(fw->gt, fw->awake_domains & domain);
+	enum xe_force_wake_domains is_awake;
+
+	is_awake = (domain == XE_FORCEWAKE_ALL) ?
+		    fw->supported_domains : domain;
+
+	xe_gt_assert(fw->gt, (fw->awake_domains & is_awake) == is_awake);
 }
 
 #endif
-- 
2.25.1



More information about the Intel-xe mailing list