From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-a7-smtp.messagingengine.com (fhigh-a7-smtp.messagingengine.com [103.168.172.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 550893A6B74; Mon, 30 Mar 2026 14:08:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.158 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774879713; cv=none; b=XeN4n7Gu92lZxktheH3FVVx4QZumU6eIqBftRy4LL+s8a0p1597DW1ZDcx+wpUulqrOmej7LAPpXcpdt3sEk/b4eu2H4kW+V+8aCv1/CEHdUAy46ir0EhUKVTWVGDDGt98be6fjqcdA7/3zyvacce4acNlyAqQPAxyf/sODoPZk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774879713; c=relaxed/simple; bh=hFayC9XGARLt59gT4kaWnR1VbNh1fXsz2EkVwo5VaTs=; h=MIME-Version:Date:From:To:Cc:Message-Id:In-Reply-To:References: Subject:Content-Type; b=IwNiR34bp3gYmbmNiFNHPPgykFPiBJaAiTWf87OG4QJLH00+2VT0b+F3H7wyrLt+u2+5uKL3lmiQolPOYvnFdakIJLKkbgN3vbeAs6dMHG+C+/+T2VNCPgpt3orl7CoJZRLnWLPMZKGfjMRLmJBZ9jP38bD8hm1LcKAmXmhHrQ0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=Ujeq4gq/; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=OiJnLNge; arc=none smtp.client-ip=103.168.172.158 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="Ujeq4gq/"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="OiJnLNge" Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id 8BE6514001F0; Mon, 30 Mar 2026 10:08:31 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-04.internal (MEProxy); Mon, 30 Mar 2026 10:08:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1774879711; x=1774966111; bh=YA2cMrzAK0doTuah/ZCPF1VdfdHNuVkolPMJyy3xMrQ=; b= Ujeq4gq/WEs1p9vSUxQnl4+BgdpSA/BJwX+UH36sE3cUoUl9NbUK5T0px/WkCtxb AwPrvEM08tMl+HQtlW0+xJx9OvoTyVDQHdmWP0fH8zCmHP93Ap7+9E/ZlIJv2WOq hXY2kCz9eOMBNjxbAZeTXb74tp10sTkzbchdrZQp5RBjKaKQ7RkNjyDmGNYVqnKY oyK2MOPMa7k4FVcOg12UdYjm3boVAnFHavWlADt+b0vi423d9VekEQ6T+6D8y5hp /L4jqAJrjINdAEIiKYH3+ridXSRE+g8i2LyhgSvnAKBfuiY47ckWBIXLHmE7W6r3 FgYpZVCLDZnvutw1A1AcIQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1774879711; x= 1774966111; bh=YA2cMrzAK0doTuah/ZCPF1VdfdHNuVkolPMJyy3xMrQ=; b=O iJnLNgetz8UVAbcu0pFZAzaN+3Gvgj1w1+eHn5O7QkgSkE87J0zC7ufehTfbtTaP kFnlO567bSql9dIy/f3pQTS8pRYtMjBXQ0NVO+LnOwdiDb7PdceMOwBEv8nya4f1 8dBwovee+IXOVRnI2p0iHx+MwivIp/49fbYwDruHvncvKc8T60MrO9ReBgjvUbFh 5FT+f7gwwkwjoRUpb5QPFZAucPMP4if/gZy+HBQ5nKAtlb8W9cna1YA0MV5LYpxn b0vxswo0d1PA9lFEGbjajCKzv44cTeUz4lXTBWMRAYregAK+K5bZsqUv1X8T5jan q3wJ7z5ShFtCm4MzJ9m5w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdeffeeludekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvfevkfgjfhfutgfgsehtjeertdertddtnecuhfhrohhmpedftehrnhgu uceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrthhtvg hrnhepfefhheetffduvdfgieeghfejtedvkeetkeejfeekkeelffejteevvdeghffhiefh necuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpegrrhhnugesrghrnhgusgdruggvpdhnsggprhgt phhtthhopeduhedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheplhhinhhugiesrg hrmhhlihhnuhigrdhorhhgrdhukhdprhgtphhtthhopehrmhhkodhkvghrnhgvlhesrghr mhhlihhnuhigrdhorhhgrdhukhdprhgtphhtthhopehsihhmohhnrdhhohhrmhgrnhestg horhhighhinhgvrdgtohhmpdhrtghpthhtohepuggrvhgvmhesuggrvhgvmhhlohhfthdr nhgvthdprhgtphhtthhopegvughumhgriigvthesghhoohhglhgvrdgtohhmpdhrtghpth htoheprghrnhgusehkvghrnhgvlhdrohhrghdprhgtphhtthhopehkuhgsrgeskhgvrhhn vghlrdhorhhgpdhrtghpthhtohepihhorghnrgdrtghiohhrnhgvihesnhigphdrtghomh dprhgtphhtthhopehvlhgrughimhhirhdrohhlthgvrghnsehngihprdgtohhm X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 84D97700069; Mon, 30 Mar 2026 10:08:30 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ThreadId: AsXllcCpWoG- Date: Mon, 30 Mar 2026 16:08:10 +0200 From: "Arnd Bergmann" To: "Vladimir Oltean" , "Arnd Bergmann" , "Ioana Ciornei" Cc: "David S . Miller" , "Eric Dumazet" , "Jakub Kicinski" , "Paolo Abeni" , "Simon Horman" , "Russell King" , "Russell King" , "Josua Mayer" , "Wolfram Sang" , "Sean Anderson" , Netdev , linux-kernel@vger.kernel.org Message-Id: In-Reply-To: <20230725205933.yqvdy3h7hewbjosy@skbuf> References: <20230725204004.3366679-1-arnd@kernel.org> <20230725204004.3366679-1-arnd@kernel.org> <20230725205933.yqvdy3h7hewbjosy@skbuf> Subject: Re: [PATCH] [v2] dpaa: avoid linking objects into multiple modules Content-Type: text/plain Content-Transfer-Encoding: 7bit On Tue, Jul 25, 2023, at 22:59, Vladimir Oltean wrote: > On Tue, Jul 25, 2023 at 10:39:40PM +0200, Arnd Bergmann wrote: >> From: Arnd Bergmann >> >> Each object file contains information about which module it gets linked >> into, so linking the same file into multiple modules now causes a warning: A recent change broke my earlier patch, and I noticed I had this version sitting in my randconfig tree for multiple years now, so I refreshed it now, sorry for dropping the ball earlier. >> scripts/Makefile.build:254: drivers/net/ethernet/freescale/dpaa2/Makefile: dpaa2-mac.o is added to multiple modules: fsl-dpaa2-eth fsl-dpaa2-switch >> scripts/Makefile.build:254: drivers/net/ethernet/freescale/dpaa2/Makefile: dpmac.o is added to multiple modules: fsl-dpaa2-eth fsl-dpaa2-switch >> >> Chang the way that dpaa2 is built by moving the two common files into a >> separate module with exported symbols instead. >> >> To avoid a link failure when the switch driver is built-in, but the dpio driver >> is a loadable module, add the same dependency in there that exists for >> the ethernet driver. > > Unrelated change should be separate. This was fixed independently and is gone from v3 > There was a previous attempt at this before, by Alexander Lobakin: > https://patchwork.kernel.org/project/netdevbpf/patch/20221119225650.1044591-16-alobakin@pm.me/ > > but it seems he wasn't persistent enough with it. > > Something which I liked better in his proposal was the naming of the > config option (FSL_DPAA2_MAC) and of the new module (fsl-dpaa2-mac). I renamed the module, but did not introduce a Kconfig symbol. The same thing can be done either using Kconfig or Makefile logic, and I just kept my previous approach here. >> -obj-$(CONFIG_FSL_DPAA2_ETH) += fsl-dpaa2-eth.o >> +obj-$(CONFIG_FSL_DPAA2_ETH) += fsl-dpaa2-eth.o fsl-dpaa2-common.o >> obj-$(CONFIG_FSL_DPAA2_PTP_CLOCK) += fsl-dpaa2-ptp.o >> -obj-$(CONFIG_FSL_DPAA2_SWITCH) += fsl-dpaa2-switch.o >> +obj-$(CONFIG_FSL_DPAA2_SWITCH) += fsl-dpaa2-switch.o fsl-dpaa2-common.o > > I am not completely sure how this works. Can fsl-dpaa2-common appear > both in obj-y (added by $(CONFIG_FSL_DPAA2_ETH)) and in obj-m (added by > $(CONFIG_FSL_DPAA2_SWITCH))? Olek proposed the introduction of a new, > hidden and selectable tristate FSL_DPAA2_MAC. At least I understand how > that works. Yes, this is a Kbuild feature: if a module is both obj-y and obj-m, it is built into the kernel and the second one is dropped. The effect is exactly equivalent to having a silent Kconfig symbol FSL_DPAA2_MAC that is selected by both others. >> + >> +MODULE_LICENSE("GPL"); >> +MODULE_DESCRIPTION("DPAA2 Ethernet core library"); > > s/core/MAC/ everywhere Done. Arnd