Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 334E6C54E58 for ; Thu, 14 Mar 2024 00:59:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BE27D10E105; Thu, 14 Mar 2024 00:58:59 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Nt4f5o45"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) by gabe.freedesktop.org (Postfix) with ESMTPS id 43D4810E105 for ; Thu, 14 Mar 2024 00:58:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710377939; x=1741913939; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=jDpPFTt8Qk6zfxtQQFWgQM6MjgpXkUrZWG2QZiJqnNo=; b=Nt4f5o45oLd5QwwrQUFsHUdJn0juLGJuzz2V9ZGMjEm4/jUqlXDAdv6y yrvOWSIWodOwkJbCCEJxaCpI38Z4X/SLQhh9l+7y0AmGROfIdrk2C2pqK ufM7f7z/vwaY9omkwipoiE1xRjPxhY0Pd9VQR+5lNyS3KWaAPOBnHD4l2 reZiZID6m71RkuTdJlzGLooILk89URkzTADu2cTCTnqdeFhE8osB7xeUN NikdrVtFkUnPErwluP2wRm0FhOQy881IwlSFwr3C7Me/5iw12zwbDmYvJ F7qHmtj3UeJvC2Ry9qf94MixFzyvqIqpkiTu8lk1NNGqr2hzVdAe73u2o A==; X-IronPort-AV: E=McAfee;i="6600,9927,11012"; a="5041839" X-IronPort-AV: E=Sophos;i="6.07,124,1708416000"; d="scan'208";a="5041839" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Mar 2024 17:58:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,124,1708416000"; d="scan'208";a="49558568" Received: from mdroper-desk1.fm.intel.com ([10.1.39.140]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Mar 2024 17:58:56 -0700 From: Matt Roper To: igt-dev@lists.freedesktop.org Cc: matthew.d.roper@intel.com Subject: [PATCH i-g-t] lib/xe_spin: Fix MI_STORE_REGISTER_MEM instruction usage Date: Wed, 13 Mar 2024 17:58:52 -0700 Message-ID: <20240314005852.2985628-1-matthew.d.roper@intel.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: igt-dev@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development mailing list for IGT GPU Tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" The MI_STORE_REGISTER_MEM macro in IGT's instruction header is the "old" version of this define, intended for use on pre-gen8 platforms since it bakes in the fixed 3-dword instruction length in the instruction header. For gen8 and beyond (i.e., every platform the Xe driver supports), the MI_STORE_REGISTER_MEM_GEN8 macro should be used instead, which properly bakes in the 4-dword instruction length. Since the xe_spin library was using the old macro, but then manually |'ing in a "2" at the end of the expression, it was effectively winding up with a field value of 3 (which would represent a 5-dword instruction). Switch xe_spin to using the "GEN8" macro and drop the redundant "| 2" which is already handled by the macro itself. Signed-off-by: Matt Roper --- lib/xe/xe_spin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/xe/xe_spin.c b/lib/xe/xe_spin.c index 2c531e85e..1ca54ea19 100644 --- a/lib/xe/xe_spin.c +++ b/lib/xe/xe_spin.c @@ -114,7 +114,7 @@ void xe_spin_init(struct xe_spin *spin, struct xe_spin_opts *opts) spin->batch[b++] = MI_MATH_STOREINV(MI_MATH_REG(NOW_TS), MI_MATH_REG_ACCU); /* Save delta for reading by COND_BBE */ - spin->batch[b++] = MI_STORE_REGISTER_MEM | MI_SRM_CS_MMIO | 2; + spin->batch[b++] = MI_STORE_REGISTER_MEM_GEN8 | MI_SRM_CS_MMIO; spin->batch[b++] = CS_GPR(NOW_TS); spin->batch[b++] = ticks_delta_addr; spin->batch[b++] = ticks_delta_addr >> 32; -- 2.43.0