From: Michal Wajdeczko Date: Tue, 27 Jan 2026 19:37:24 +0000 (+0100) Subject: drm/xe/guc: Drop redundant register read X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=09b45fd9d330e52a5b31d1abc0db4a22b16d340a;p=thirdparty%2Fkernel%2Flinux.git drm/xe/guc: Drop redundant register read The xe_mmio_wait32() already returns the last value of the register for which we were waiting, there is no need read it again. Signed-off-by: Michal Wajdeczko Reviewed-by: Matthew Brost Link: https://patch.msgid.link/20260127193727.601-5-michal.wajdeczko@intel.com --- diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c index c0eeaf08479da..2ae5a78b52ed9 100644 --- a/drivers/gpu/drm/xe/xe_guc.c +++ b/drivers/gpu/drm/xe/xe_guc.c @@ -1405,11 +1405,11 @@ int xe_guc_mmio_send_recv(struct xe_guc *guc, const u32 *request, struct xe_device *xe = guc_to_xe(guc); struct xe_gt *gt = guc_to_gt(guc); struct xe_mmio *mmio = >->mmio; - u32 header, reply; struct xe_reg reply_reg = xe_gt_is_media_type(gt) ? MED_VF_SW_FLAG(0) : VF_SW_FLAG(0); const u32 LAST_INDEX = VF_SW_FLAG_COUNT - 1; bool lost = false; + u32 header; int ret; int i; @@ -1441,21 +1441,20 @@ retry: ret = xe_mmio_wait32(mmio, reply_reg, GUC_HXG_MSG_0_ORIGIN, FIELD_PREP(GUC_HXG_MSG_0_ORIGIN, GUC_HXG_ORIGIN_GUC), - 50000, &reply, false); + 50000, &header, false); if (ret) { /* scratch registers might be cleared during FLR, try once more */ - if (!reply && !lost) { + if (!header && !lost) { xe_gt_dbg(gt, "GuC mmio request %#x: lost, trying again\n", request[0]); lost = true; goto retry; } timeout: xe_gt_err(gt, "GuC mmio request %#x: no reply %#x\n", - request[0], reply); + request[0], header); return ret; } - header = xe_mmio_read32(mmio, reply_reg); if (FIELD_GET(GUC_HXG_MSG_0_TYPE, header) == GUC_HXG_TYPE_NO_RESPONSE_BUSY) { /*