From mboxrd@z Thu Jan 1 00:00:00 1970 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 5B636D711C9 for ; Thu, 18 Dec 2025 21:29:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0839E10EB75; Thu, 18 Dec 2025 21:29:59 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="QDg+08BV"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 49ADE10EB73 for ; Thu, 18 Dec 2025 21:29:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1766093389; x=1797629389; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=38B0ffl2fh6GcW0HoNJEUachOdhp0Nzl2jXW8v6f4O0=; b=QDg+08BV43nHltJQSMNQc9wYy1Xt+btmG62Y3YfHInRkFs4wTQY1PjkT zRL6xykxz8r8T4rTj8Lym5jjxgBTQRrSrY4ZN0jg2l2K93VENDowr341+ qDjflzfO5K/6/MoJXLVAjL3xtzUsA9bZR1jt/UL7aCG/EzCMrpx0kBfJs fFT8BNZ014uwqqVg3BAd7ap8zNSrGBXhI/pojk3LXWYKvlqhpf+EgZXor TKxNppHY/tr52FpefOth1+wsFXlt+T7o2oILrHuZe4HHwgl0dLUgutzFX ksmzTLkEaKzZpXynCxxreaSMRxou2JFPXG9k1LhmAL0QYEczioqWK5NG/ Q==; X-CSE-ConnectionGUID: SfuD/mMxQPe6KOsW0Ulucw== X-CSE-MsgGUID: VUPWhcMFTEu7bNiawgyzPA== X-IronPort-AV: E=McAfee;i="6800,10657,11646"; a="67808710" X-IronPort-AV: E=Sophos;i="6.21,159,1763452800"; d="scan'208";a="67808710" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Dec 2025 13:29:48 -0800 X-CSE-ConnectionGUID: djzys+GzTYKeZRMDDIsrZw== X-CSE-MsgGUID: mqZolHz8T0exLlrI6lSOqA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,159,1763452800"; d="scan'208";a="198594090" Received: from dut4086lnl.fm.intel.com ([10.105.10.207]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Dec 2025 13:29:48 -0800 From: Jonathan Cavitt To: intel-xe@lists.freedesktop.org Cc: saurabhg.gupta@intel.com, alex.zuo@intel.com, jonathan.cavitt@intel.com, matthew.brost@intel.com, daniele.ceraolospurio@intel.com, rodrigo.vivi@intel.com, michal.wajdeczko@intel.com, stuart.summers@intel.com, dixit.ashutosh@intel.com Subject: [PATCH v2 1/4] drm/xe/guc: WRITE_ONCE g2h_fence done in g2h_fence_cancel Date: Thu, 18 Dec 2025 21:29:48 +0000 Message-ID: <20251218212946.16577-7-jonathan.cavitt@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251218212946.16577-6-jonathan.cavitt@intel.com> References: <20251218212946.16577-6-jonathan.cavitt@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" Use WRITE_ONCE when operating on g2h_fence->done in g2h_fence_cancel to prevent the compiler from ignoring this operation. Fixes: 94de94d24ea8 ("drm/xe/guc: Cancel ongoing H2G requests when stopping CT") Suggested-by: Matthew Brost Signed-off-by: Jonathan Cavitt Cc: Michal Wajdeczko --- drivers/gpu/drm/xe/xe_guc_ct.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c index c3df9b3f1b4d..d177df166d2a 100644 --- a/drivers/gpu/drm/xe/xe_guc_ct.c +++ b/drivers/gpu/drm/xe/xe_guc_ct.c @@ -206,7 +206,9 @@ static void g2h_fence_cancel(struct g2h_fence *g2h_fence) { g2h_fence->cancel = true; g2h_fence->fail = true; - g2h_fence->done = true; + + /* WRITE_ONCE pairs with wait_event_timeout in guc_ct_send_recv */ + WRITE_ONCE(g2h_fence->done, true); } static bool g2h_fence_needs_alloc(struct g2h_fence *g2h_fence) -- 2.43.0