Skip to contentSkip to conversation

FAILED: patch "[PATCH] drm/xe/hdcp: Add NULL check for media_gt in" failed to apply to 6.18-stable tree

PATCH Applied [email protected] 3 participants 3 messages May 15 – May 24

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 6.18-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.18.y
git checkout FETCH_HEAD
git cherry-pick -x 60a1e131a811b68703da58fd805ab359b704ab03
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026051542-traps-bubbling-c3d7@gregkh' --subject-prefix 'PATCH 6.18.y' HEAD^..

Possible dependencies:

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 60a1e131a811b68703da58fd805ab359b704ab03 Mon Sep 17 00:00:00 2001
From: Gustavo Sousa <[email protected]>
Date: Thu, 16 Apr 2026 15:17:19 -0300
Subject: [PATCH] drm/xe/hdcp: Add NULL check for media_gt in
intel_hdcp_gsc_check_status()

When media GT is disabled via configfs, there is no allocation for media_gt, which is kept as NULL. In such scenario, intel_hdcp_gsc_check_status() results in a kernel pagefault error due to &gt->uc.gsc being evaluated as an invalid memory address.

Fix that by introducing a NULL check on media_gt and bailing out early if so.

While at it, also drop the NULL check for gsc, since it can't be NULL if media_gt is not NULL.

v2:
- Get address for gsc only after checking that gt is not NULL. (Shuicheng)
- Drop the NULL check for gsc. (Shuicheng)
v3:
- Add "Fixes" and "Cc: <stable...>" tags. (Matt)

Fixes 4af50beb4e0f ("drm/xe: Use gsc_proxy_init_done to check proxy status")
Cc <[email protected]> # v6.10+
(cherry picked from commit bfaf87e84ca3ca3f6e275f9ae56da47a8b55ffd1)
drivers/gpu/drm/xe/display/xe_hdcp_gsc.c +10 -2
index 29c72aa4b0d2..33494b86205d 100644
@@ -37,9 +37,17 @@ static bool intel_hdcp_gsc_check_status(struct drm_device *drm)
 	struct xe_device *xe = to_xe_device(drm);
 	struct xe_tile *tile = xe_device_get_root_tile(xe);
 	struct xe_gt *gt = tile->media_gt;
-	struct xe_gsc *gsc = &gt->uc.gsc;
+	struct xe_gsc *gsc;
 
-	if (!gsc || !xe_uc_fw_is_available(&gsc->fw)) {
+	if (!gt) {
+		drm_dbg_kms(&xe->drm,
+			    "not checking GSC status for HDCP2.x: media GT not present or disabled\n");
+		return false;
+	}
+
+	gsc = &gt->uc.gsc;
+
+	if (!xe_uc_fw_is_available(&gsc->fw)) {
 		drm_dbg_kms(&xe->drm,
 			    "GSC Components not ready for HDCP2.x\n");
 		return false;
#1 lore raw

PATCH 1/1 drm/xe/hdcp: Add NULL check for media_gt in intel_hdcp_gsc_check_status()

When media GT is disabled via configfs, there is no allocation for media_gt, which is kept as NULL. In such scenario, intel_hdcp_gsc_check_status() results in a kernel pagefault error due to &gt->uc.gsc being evaluated as an invalid memory address.

Fix that by introducing a NULL check on media_gt and bailing out early if so.

While at it, also drop the NULL check for gsc, since it can't be NULL if media_gt is not NULL.

v2:
- Get address for gsc only after checking that gt is not NULL. (Shuicheng)
- Drop the NULL check for gsc. (Shuicheng)
v3:
- Add "Fixes" and "Cc: <stable...>" tags. (Matt)

Fixes 4af50beb4e0f ("drm/xe: Use gsc_proxy_init_done to check proxy status")
Cc <[email protected]> # v6.10+
(cherry picked from commit bfaf87e84ca3ca3f6e275f9ae56da47a8b55ffd1)
(cherry picked from commit 60a1e131a811b68703da58fd805ab359b704ab03)
---
 drivers/gpu/drm/xe/display/xe_hdcp_gsc.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/gpu/drm/xe/display/xe_hdcp_gsc.c +10 -2
index 4ae847b628e2..6324f526dcfa 100644
@@ -35,11 +35,19 @@ bool intel_hdcp_gsc_check_status(struct drm_device *drm)
 	struct xe_device *xe = to_xe_device(drm);
 	struct xe_tile *tile = xe_device_get_root_tile(xe);
 	struct xe_gt *gt = tile->media_gt;
-	struct xe_gsc *gsc = &gt->uc.gsc;
+	struct xe_gsc *gsc;
 	bool ret = true;
 	unsigned int fw_ref;
 
-	if (!gsc || !xe_uc_fw_is_enabled(&gsc->fw)) {
+	if (!gt) {
+		drm_dbg_kms(&xe->drm,
+			    "not checking GSC status for HDCP2.x: media GT not present or disabled\n");
+		return false;
+	}
+
+	gsc = &gt->uc.gsc;
+
+	if (!xe_uc_fw_is_enabled(&gsc->fw)) {
 		drm_dbg_kms(&xe->drm,
 			    "GSC Components not ready for HDCP2.x\n");
 		return false;
Signature · 1 line
2.53.0
maintainer Applied
#2 lore raw

Re: [PATCH 6.18.y] drm/xe/hdcp: Add NULL check for media_gt in intel_hdcp_gsc_check_status()

Queued for 6.18, thanks.

Signature · 2 lines
Thanks,
Sasha