Skip to contentSkip to conversation

drm/xe/gsc: Add status check during gsc header readout

PATCH Daniele Ceraolo Spurio 1 participant 1 message Jan 22, 2024 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Daniele Ceraolo Spurio

author Reviewed-by
#1 lore raw
Quoted 16 lines · Suraj Kandpal

Before checking if data is present in the message reply check the status in header and see if it indicates any error.

Cc Daniele Ceraolo Spurio <[email protected]>
---
  drivers/gpu/drm/xe/xe_gsc_submit.c | 7 +++++++
  1 file changed, 7 insertions(+)
drivers/gpu/drm/xe/xe_gsc_submit.c +0 -0
index 9ecc1ead6844..0ccc6d52dd3f 100644
@@ -125,11 +125,18 @@ int xe_gsc_read_out_header(struct xe_device *xe,
  {
  	u32 marker = mtl_gsc_header_rd(xe, map, offset, validity_marker);

drivers/gpu/drm/xe/xe_gsc_submit.c int xe_gsc_read_out_header(struct xe_device *xe, · line 136

Quoted 10 lines
drivers/gpu/drm/xe/xe_gsc_submit.c +4 -0
  	u32 size = mtl_gsc_header_rd(xe, map, offset, message_size);
+	u32 status = mtl_gsc_header_rd(xe, map, offset, status);
  	u32 payload_size = size - GSC_HDR_SIZE;
 
  	if (marker != GSC_HECI_VALIDITY_MARKER)
  		return -EPROTO;
 
+	if (status != 0) {
+		drm_dbg_kms(xe, "GSC header readout indicates error: %d\n",
+			    status);

This should be an error message (drm_err). With that:

Daniele

Quoted 6 lines
drivers/gpu/drm/xe/xe_gsc_submit.c +3 -0
+		return -EINVAL;
+	}
+
  	if (size < GSC_HDR_SIZE || payload_size < min_payload_size)
  		return -ENODATA;