Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
[parent not found: <20240123062846.577031-1-suraj.kandpal@intel.com>]
* [PATCH] drm/xe/gsc: Add status check during gsc header readout
@ 2024-01-24  4:52 Suraj Kandpal
  0 siblings, 0 replies; 4+ messages in thread
From: Suraj Kandpal @ 2024-01-24  4:52 UTC (permalink / raw)
  To: intel-xe

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

--v2
- Use drm_err() instead of drm_dbg_kms() [Daniele]

--v3
- Use &xe->drm in drm_err to make it more cleaner [Daniele]

Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
---
 drivers/gpu/drm/xe/xe_gsc_submit.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_gsc_submit.c b/drivers/gpu/drm/xe/xe_gsc_submit.c
index 9ecc1ead6844..348994b271be 100644
--- a/drivers/gpu/drm/xe/xe_gsc_submit.c
+++ b/drivers/gpu/drm/xe/xe_gsc_submit.c
@@ -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);
 	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_err(&xe->drm, "GSC header readout indicates error: %d\n",
+			status);
+		return -EINVAL;
+	}
+
 	if (size < GSC_HDR_SIZE || payload_size < min_payload_size)
 		return -ENODATA;
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-24  4:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20240122063545.495082-1-suraj.kandpal@intel.com>
2024-01-22 21:54 ` [PATCH] drm/xe/gsc: Add status check during gsc header readout Daniele Ceraolo Spurio
     [not found] <20240123062846.577031-1-suraj.kandpal@intel.com>
2024-01-23 17:58 ` Daniele Ceraolo Spurio
2024-01-23 18:19   ` Jani Nikula
2024-01-24  4:52 Suraj Kandpal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox