Re: [PATCH v10 01/12] cxl: Move HDM decoder programming helpers

Alison Schofield <[email protected]>
Newsgroups org.kernel.vger.linux-kernel,org.kernel.vger.linux-cxl,org.kernel.vger.linux-pci,org.kernel.vger.linux-tegra
Message-ID <[email protected]>
On Tue, Aug 04, 2026 at 07:29:47PM +0000, Srirangan Madhavan wrote:
> Move the low-level HDM decoder programming helpers from hdm.c into
> resource.c so they can be shared by later reset restore code.
> 
> Keep the existing decoder commit flow and register programming sequence
> unchanged. This patch is intended to be a mechanical move. Follow-on
> patches update the helper interface for reset restore.
> 
> Signed-off-by: Srirangan Madhavan <[email protected]>
> ---
>  drivers/cxl/Kconfig         |   4 ++
>  drivers/cxl/core/Makefile   |   1 +
>  drivers/cxl/core/core.h     |   2 +
>  drivers/cxl/core/hdm.c      | 124 +-------------------------------
>  drivers/cxl/core/resource.c | 138 ++++++++++++++++++++++++++++++++++++
>  drivers/cxl/cxl.h           |  41 -----------
>  include/cxl/cxl.h           |  45 +++++++++++-
>  tools/testing/cxl/Kbuild    |   1 +
>  8 files changed, 191 insertions(+), 165 deletions(-)
>  create mode 100644 drivers/cxl/core/resource.c
> 

Hi Srirangan,

A bit of deja-vu here but on a different file this time.


snip

> diff --git a/drivers/cxl/core/Makefile b/drivers/cxl/core/Makefile
> index ce7213818d3c..0df4178bbbaa 100644
> --- a/drivers/cxl/core/Makefile
> +++ b/drivers/cxl/core/Makefile
> @@ -1,5 +1,6 @@
>  # SPDX-License-Identifier: GPL-2.0
>  obj-$(CONFIG_CXL_BUS) += cxl_core.o
> +obj-$(CONFIG_CXL_HDM) += resource.o
>  obj-$(CONFIG_CXL_SUSPEND) += suspend.o

We can't add resource.o to both the built-in set above, and to
cxl_core-y below. The mock cxl_core.ko must not build an object
that is already in vmlinux. resource.o gets compiled twice and
modpost rejects the duplicate exports like this-

$ make M=tools/testing/cxl/
ERROR: modpost: cxl_core: 'cxl_rwsem' exported twice. Previous export was in vmlinux
ERROR: modpost: cxl_core: 'cxl_commit_start' exported twice. Previous export was in vmlinux
ERROR: modpost: cxl_core: 'cxl_commit_wait' exported twice. Previous export was in vmlinux
ERROR: modpost: cxl_core: 'cxl_hdm_decode_decoder' exported twice. Previous export was in vmlinux

So, remove from tools/testing/cxl/Kbuild below.

To catch this, run the mock build after any change to
drivers/cxl/core/Makefile or tools/testing/cxl/Kbuild:
  $ make vmlinux modules
  $ make M=tools/testing/cxl/

> diff --git a/tools/testing/cxl/Kbuild b/tools/testing/cxl/Kbuild
> index 2be1df80fcc9..6c09932587ce 100644
> --- a/tools/testing/cxl/Kbuild
> +++ b/tools/testing/cxl/Kbuild
> @@ -60,6 +60,7 @@ cxl_core-y += $(CXL_CORE_SRC)/memdev.o
>  cxl_core-y += $(CXL_CORE_SRC)/mbox.o
>  cxl_core-y += $(CXL_CORE_SRC)/pci.o
>  cxl_core-y += $(CXL_CORE_SRC)/hdm.o
> +cxl_core-y += $(CXL_CORE_SRC)/resource.o
>  cxl_core-y += $(CXL_CORE_SRC)/pmu.o
>  cxl_core-y += $(CXL_CORE_SRC)/cdat.o
>  cxl_core-$(CONFIG_TRACING) += $(CXL_CORE_SRC)/trace.o
> -- 
> 2.43.0
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.