Re: [PATCH v13 06/15] cxl: Make HDM reset helpers available to built-in PCI code

From: Jonathan Cameron

Date: Wed Sep 23 2026 - 22:51:22 EST


On Wed, 23 Sep 2026 16:40:05 -0500
"Cheatham, Benjamin" <benjamin.cheatham@xxxxxxx> wrote:

> On 9/22/2026 3:39 AM, Srirangan Madhavan wrote:
> > PCI can be built in while CXL_BUS is modular, so PCI reset code cannot
> > depend on helpers provided by the cxl_core module.
> >
> > Build the HDM resource helpers under CONFIG_CXL_RESET and restrict their
> > exports to cxl_core.
> >
>
> I think you should squash this patch into 3/15. Having this earlier does two things:
> 1) it makes it more clear why you're moving everything earlier in the set, and 2)
> bisects across the pass 3 patches will all result in the same configuration.
>
> An alternative option would be to refactor the preceding 3 patches in-place and then
> move all of the helpers to this file in this patch, either would work.

There may indeed be some better orderings that make it easier to review
still - though this is already a great improvement on the earlier versions.

>
> > Signed-off-by: Srirangan Madhavan <smadhavan@xxxxxxxxxx>
> > ---

> > diff --git a/drivers/cxl/core/Makefile b/drivers/cxl/core/Makefile
> > index 57995777af0d..30470799e059 100644
> > --- a/drivers/cxl/core/Makefile
> > +++ b/drivers/cxl/core/Makefile
> > @@ -1,12 +1,12 @@
> > # SPDX-License-Identifier: GPL-2.0
> > obj-$(CONFIG_CXL_BUS) += cxl_core.o
> > +obj-$(CONFIG_CXL_RESET) += resource.o
>
> This file should probably be called reset.c instead of resource.c to match the
> Kconfig functionality.

I'm not keen on that change because the functions are core CXL stuff
that just happens to also be useful in reset. You could change the object
name via some Kconfig magic so that matches, but the c file itself
wants to remain with some generic name.


> > obj-$(CONFIG_CXL_SUSPEND) += suspend.o
> >
> > ccflags-y += -I$(srctree)/drivers/cxl
> > CFLAGS_trace.o = -DTRACE_INCLUDE_PATH=. -I$(src)
> >
> > cxl_core-y := port.o
> > -cxl_core-y += resource.o
> > cxl_core-y += pmem.o
> > cxl_core-y += regs.o
> > cxl_core-y += memdev.o