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 8C53FCCF9E4 for ; Thu, 23 Oct 2025 04:08:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 04D3D10E867; Thu, 23 Oct 2025 04:08:07 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Jo566jaZ"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) by gabe.freedesktop.org (Postfix) with ESMTPS id AF14C10E864; Thu, 23 Oct 2025 04:08:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1761192486; x=1792728486; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VahvpDWk1t93nMsNtIfz84NqcIjYxoxetcN6dyK4Kfc=; b=Jo566jaZ16xLlDhaMc2FFnyfW8Um7smPFCGtXR/zuoKsR27SQQXKbIdi LJlkGKztyEs6DNC0PMsa102QRfkmI3fcatyjCNGGh+RHQ8Z/XQ3wB24s/ 1ln3/MvykRXvzGU0dDp/oAcwHymn53m/W/g4EhxhmD8Y42124mlgM1dYc wSQDnoexzreeUtlJS0bCGCcSn6DySOuRztcSaolyFpGaRSYE1GgHMq9l7 bA6+Dhn5OPPXBCoqdAkZpM+jxlCW6gpy62SxuLEUNRVjqBF1C+gzYB+Mc BbHjcgXH5OmM1BO0Bo6D4gkcOMsbdJh6Su82jdAHSMpqKsdWWmSsHordA g==; X-CSE-ConnectionGUID: D9YzGRAaQzSa3/E93XIbow== X-CSE-MsgGUID: AzoMuO0XQqGCmUY6i+gJlg== X-IronPort-AV: E=McAfee;i="6800,10657,11586"; a="63391283" X-IronPort-AV: E=Sophos;i="6.19,248,1754982000"; d="scan'208";a="63391283" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2025 21:08:05 -0700 X-CSE-ConnectionGUID: UJiKyLGgSAOjJs037Z0c/Q== X-CSE-MsgGUID: ABzAdxT/QgS25y7It3b9Bg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,248,1754982000"; d="scan'208";a="189175754" Received: from lstrano-desk.jf.intel.com ([10.54.39.91]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2025 21:08:05 -0700 From: Matthew Brost To: intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: christian.koenig@amd.com Subject: [RFC PATCH 06/14] dma-buf: use inline lock for the stub fence Date: Wed, 22 Oct 2025 21:07:52 -0700 Message-Id: <20251023040800.970283-7-matthew.brost@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251023040800.970283-1-matthew.brost@intel.com> References: <20251023040800.970283-1-matthew.brost@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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" From: Christian König Just as proof of concept and minor cleanup. Signed-off-by: Christian König --- drivers/dma-buf/dma-fence.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c index a0b328fdd90d..a41ff8e8cd25 100644 --- a/drivers/dma-buf/dma-fence.c +++ b/drivers/dma-buf/dma-fence.c @@ -24,7 +24,6 @@ EXPORT_TRACEPOINT_SYMBOL(dma_fence_emit); EXPORT_TRACEPOINT_SYMBOL(dma_fence_enable_signal); EXPORT_TRACEPOINT_SYMBOL(dma_fence_signaled); -static DEFINE_SPINLOCK(dma_fence_stub_lock); static struct dma_fence dma_fence_stub; /* @@ -123,12 +122,8 @@ static const struct dma_fence_ops dma_fence_stub_ops = { static int __init dma_fence_init_stub(void) { - dma_fence_init(&dma_fence_stub, &dma_fence_stub_ops, - &dma_fence_stub_lock, 0, 0); - - set_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT, - &dma_fence_stub.flags); - + dma_fence_init(&dma_fence_stub, &dma_fence_stub_ops, NULL, 0, 0); + set_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT, &dma_fence_stub.flags); dma_fence_signal_locked(&dma_fence_stub); return 0; } @@ -160,16 +155,9 @@ struct dma_fence *dma_fence_allocate_private_stub(ktime_t timestamp) if (fence == NULL) return NULL; - dma_fence_init(fence, - &dma_fence_stub_ops, - &dma_fence_stub_lock, - 0, 0); - - set_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT, - &fence->flags); - + dma_fence_init(fence, &dma_fence_stub_ops, NULL, 0, 0); + set_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT, &fence->flags); dma_fence_signal_timestamp(fence, timestamp); - return fence; } EXPORT_SYMBOL(dma_fence_allocate_private_stub); -- 2.34.1