From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 19B232FD69A for ; Sun, 26 Apr 2026 11:00:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777201219; cv=none; b=ZzvsdneB9Mc5V8gTmBRHiWqRRNpesqBIC+gkh3g2E0wBESrN9mCVdBMtX2+5t4rD7//39HbM0HFdh42u9ZG39CxaeL3DYQ2BPjX2Oh2IqmbId5NMgwCL0FtNyTvg1eqkO66nY1AG7skEWkm9gAL49poO2QPzDPaCylFhIWY4s/I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777201219; c=relaxed/simple; bh=btkQtdgQ0/faA3G8fQ7vJ2dLzybospS9rvLC2N23AHs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tJK5vu4/FoRkyDeqIYkOzdu7mALVDrJGcEgXps4au5BetnbpS4cqcb9Ma6XFMGSN4bPTi0pCuMpgsXdpl1Rvm6PP9J8g4y77d8TLAjXh6NGgCwNTo2lSzM8+1WnqCoMJayqeQIoaJvO9DHt34uOwxITzcrKxiKKp81YzZiWrlaw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ijOPenyA; arc=none smtp.client-ip=209.85.215.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ijOPenyA" Received: by mail-pg1-f179.google.com with SMTP id 41be03b00d2f7-c70fb6aa323so3200433a12.3 for ; Sun, 26 Apr 2026 04:00:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777201217; x=1777806017; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3XNHcqPiS87Phn06IpxO8T5jrJVeHx6CGab+nQaKnDs=; b=ijOPenyADDxyQKTMNlXJhlyPso1afqQItvwL0SCOhnW8W1V3+bMgVLIn9uS0bL1TwI UbQdmRBcqSnlJM8CN25W2nantgNLLk3obvPlh029gG2BuP+DCLOwPxd7jjsenFN+BnRe PRzmLEXI5d2Wvxr1H9raZeNykZms7F6zPEfxq7mp/TrlHClx6+X9XVNmhom+iJLTopOG IE7WOsBKnGFH6GcBb7HEpg8HNcnQ8Ue9BQmAJVIeVvdiRpdp7t0LDKwyPiygHaji5ET7 JkHlXJ2SnDVnAkhx4hVYTLlOa0K2q53BmV39BSVdrDEEjmc8hxXEp+HuAjVcXPbH6oc+ +xrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777201217; x=1777806017; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=3XNHcqPiS87Phn06IpxO8T5jrJVeHx6CGab+nQaKnDs=; b=Iml5Uzdf/0JMgwMZfla8Rpt6IfUWYOtawMDRioK/KPLI41HZEgL7EDKKZI7UD+8Fvd EVDalO3Bt5LhkhVO7fdRw3e9GdNo7x1gkppmre2h5QMpBTPRXLmGbNXiv4nS7vQw9Eq8 py6EQ1HHYwkQ8R0WuwGcUUCJEylLQTUbwKS7q4hGUDzSXxz0CeabE5hnA4FAJRXyUNn8 mwpOBwqpPXVIxPL8hCZ/pPVo1ZIIzObWoAmc6mWAXPrz2dwe81LMp6rRHbGYfbJA84b6 j4z5EBe89BP4CaTYO6qFQCpw+yHxT8U0z94VzQMGmSsyREkP6TNoaA3px9Jjh+KomDaF 0L/g== X-Forwarded-Encrypted: i=1; AFNElJ842BHypYsSzMBGUOWNle3ebgo0u0wVNFb6cgC6HUrVKQHFstsZF2y1LX9jWsWPa+MjC21aHQsv2WlT43g=@vger.kernel.org X-Gm-Message-State: AOJu0Yx9jMHaBo1u4RRrJS6RYKRtaSYhE/FdX6Kbwc8AxQJAUblrMzCb of7bxr0H9CRuo0lf2s7IKXcEtbilsiXOBBb+dpPVcZQ4sRnaq9scnQsf X-Gm-Gg: AeBDieuu0A17+UYmkrxiJWer4J8i02wDT8+U5Nvl0t22RFEV6j6BgM1R4M7MRaaXYNR uFHgYVfYQeqNO/Yh/8b1k0KPNqu8oVpS2ipoPX8/LZpJ3SyrwtmDbaBvyHqnlYuFkBLtB9IkvUT 2vU2Hg000l6L17jOelpilkK5GfyTLG9wkB4digsFLpIYNvRgz8XLjCU1eRWGbXHuxdL4hnuAEoI hXKttVetWVb10mq38UOVDCVYGEdkApfr8Ra//d4SK6ai4R7srT/dEbIWHMD15e9gTZL/S46R4D/ IHInTu1olXKKPWZfacG0a8w6pYtW1GbsGq2VY6LMyYZF02XIEfLHmxYR8kCNrYVjaPqID0BdhbN I6/KBHXPFX4IHXedzaJ9AnlAVAPy/ZlennsJIiOdbjHqXiPC0qwnNO3o8rug9QyZG4zTuWPDS+X jqapGKGLq5UbYmBAlCh4Qv8SeBg0R5cC+3+mtZQptX75YGEXDrhlf/daYlJjXwJ7W253DybsOPx 1lhcJ7762ltwqY= X-Received: by 2002:a17:903:2acc:b0:2b2:497e:3f6d with SMTP id d9443c01a7336-2b5f9e8cdb3mr378037025ad.8.1777201214089; Sun, 26 Apr 2026 04:00:14 -0700 (PDT) Received: from li-1a3e774c-28e4-11b2-a85c-acc9f2883e29.ibm.com.com ([106.51.164.157]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b5faa2f129sm256667235ad.29.2026.04.26.04.00.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Apr 2026 04:00:13 -0700 (PDT) From: "Mukesh Kumar Chaurasiya (IBM)" To: maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com, chleroy@kernel.org, peterz@infradead.org, jpoimboe@kernel.org, jbaron@akamai.com, aliceryhl@google.com, rostedt@goodmis.org, ardb@kernel.org, ojeda@kernel.org, boqun@kernel.org, gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org, a.hindborg@kernel.org, tmgross@umich.edu, dakr@kernel.org, nathan@kernel.org, nick.desaulniers+lkml@gmail.com, morbo@google.com, justinstitt@google.com, daniel.almeida@collabora.com, fujita.tomonori@gmail.com, viresh.kumar@linaro.org, prafulrai522@gmail.com, gregkh@linuxfoundation.org, arnd@arndb.de, tamird@kernel.org, mark.rutland@arm.com, mkchauras@gmail.com, lyude@redhat.com, lina+kernel@asahilina.net, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, llvm@lists.linux.dev Cc: =?UTF-8?q?Christian=20K=C3=B6nig?= Subject: [PATCH V15 2/7] dma-resv: Fix undefined symbol when CONFIG_DMA_SHARED_BUFFER is disabled Date: Sun, 26 Apr 2026 16:29:27 +0530 Message-ID: <20260426105932.2270364-3-mkchauras@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260426105932.2270364-1-mkchauras@gmail.com> References: <20260426105932.2270364-1-mkchauras@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with LLVM=1 for architectures like powerpc where CONFIG_DMA_SHARED_BUFFER is not enabled, the build fails with: ld.lld: error: undefined symbol: dma_resv_reset_max_fences >>> referenced by helpers.c >>> rust/helpers/helpers.o:(rust_helper_dma_resv_unlock) The issue occurs because: 1. CONFIG_DEBUG_MUTEXES=y is enabled 2. CONFIG_DMA_SHARED_BUFFER is not enabled 3. dma_resv_reset_max_fences() is declared in the header when CONFIG_DEBUG_MUTEXES is set 4. But the function is only compiled in drivers/dma-buf/dma-resv.c, which is only built when CONFIG_DMA_SHARED_BUFFER is enabled 5. Rust helpers call dma_resv_unlock() which calls dma_resv_reset_max_fences(), causing an undefined symbol Fix this by compiling `dma-resv.c` file only when CONFIG_DMA_SHARED_BUFFER is enabled. Fixes: 9b836641d3bf ("rust: helpers: Add bindings/wrappers for dma_resv_lock") Reviewed-by: Christian König Signed-off-by: Mukesh Kumar Chaurasiya (IBM) --- rust/helpers/helpers.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c index 625921e27dfb..09ee5cac600d 100644 --- a/rust/helpers/helpers.c +++ b/rust/helpers/helpers.c @@ -57,7 +57,9 @@ #include "cred.c" #include "device.c" #include "dma.c" +#ifdef CONFIG_DMA_SHARED_BUFFER #include "dma-resv.c" +#endif #include "drm.c" #include "err.c" #include "irq.c" -- 2.53.0