]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/xe/guc: Drop redundant register read
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Tue, 27 Jan 2026 19:37:24 +0000 (20:37 +0100)
committerMichal Wajdeczko <michal.wajdeczko@intel.com>
Mon, 2 Feb 2026 21:35:44 +0000 (22:35 +0100)
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 <michal.wajdeczko@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patch.msgid.link/20260127193727.601-5-michal.wajdeczko@intel.com
drivers/gpu/drm/xe/xe_guc.c

index c0eeaf08479da31d8bc63af10077b9f35ecc3944..2ae5a78b52ed9d642401e88acfbc42b253623083 100644 (file)
@@ -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 = &gt->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) {
                /*