RE: [PATCH v4 01/27] cxl: Fix resource.c include path and export cxl_restore_hdm_after_pci_reset

From: Manish Honap

Date: Fri Aug 21 2026 - 21:22:44 EST



> -----Original Message-----
> From: Jonathan Cameron <jic23@xxxxxxxxxx>
> Sent: 22 August 2026 04:23
> To: Manish Honap <mhonap@xxxxxxxxxx>
> Cc: alex@xxxxxxxxxxx; jgg@xxxxxxxx; Ankit Agrawal <ankita@xxxxxxxxxx>;
> dave.jiang@xxxxxxxxx; alejandro.lucero-palau@xxxxxxx; Srirangan Madhavan
> <smadhavan@xxxxxxxxxx>; corbet@xxxxxxx; skhan@xxxxxxxxxxxxxxxxxxx;
> dave@xxxxxxxxxxxx; alison.schofield@xxxxxxxxx; vishal.l.verma@xxxxxxxxx;
> iweiny@xxxxxxxxxx; ming.li@xxxxxxxxxxxx; Yishai Hadas
> <yishaih@xxxxxxxxxx>; Shameer Kolothum Thodi <skolothumtho@xxxxxxxxxx>;
> kevin.tian@xxxxxxxxx; bhelgaas@xxxxxxxxxx; dmatlack@xxxxxxxxxx;
> kees@xxxxxxxxxx; gustavoars@xxxxxxxxxx; Neo Jia <cjia@xxxxxxxxxx>;
> Krishnakant Jaju <kjaju@xxxxxxxxxx>; Vikram Sethi <vsethi@xxxxxxxxxx>;
> Zhi Wang <zhiw@xxxxxxxxxx>; linux-doc@xxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx; kvm@xxxxxxxxxxxxxxx; linux-cxl@xxxxxxxxxxxxxxx;
> linux-pci@xxxxxxxxxxxxxxx; linux-kselftest@xxxxxxxxxxxxxxx; linux-
> hardening@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH v4 01/27] cxl: Fix resource.c include path and
> export cxl_restore_hdm_after_pci_reset
>
> External email: Use caution opening links or attachments
>
>
> On Thu, 13 Aug 2026 15:06:05 +0530
> <mhonap@xxxxxxxxxx> wrote:
>
> > From: Manish Honap <mhonap@xxxxxxxxxx>
> >
> > The vfio-cxl Type-2 driver restores the endpoint HDM decoder after a
> > D3hot->D0 soft reset by calling cxl_restore_hdm_after_pci_reset(), so
> > export it to the CXL namespace. While here, correct the resource.c
> > include of the CXL PCI definitions from <cxlpci.h> to <cxl/pci.h>.
>
> Why? + if this makes sense (I haven't checked) please make that a
> separate patch (for now) + make sure to call it out in review of
> Srirangan Madhavan series where this file comes from and which hasn't
> merged yet. I think it is in patch 5.
>
> Jonathan

Hello Jonathan,

My patch series is dependent on Alejandro's v30 "type2-device-basic-support" which
moves the CXL_REGLOC_RBI_COMPONENT from cxlpci.h to cxl/pci.h; this series is accepted
but not yet available on the commit I tested/sent current series.

This should get resolved when Srirangan rebases his code to kernel latest.
I will drop this patch once Srirangan updates this in CXL-Reset series.

I will also update on Srirangan's series regarding the export symbol.

>
> >
> > Signed-off-by: Manish Honap <mhonap@xxxxxxxxxx>
> > ---
> > drivers/cxl/core/resource.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/cxl/core/resource.c b/drivers/cxl/core/resource.c
> > index daa5e7fa2509..492ffe8e3576 100644
> > --- a/drivers/cxl/core/resource.c
> > +++ b/drivers/cxl/core/resource.c
> > @@ -16,7 +16,7 @@
> > #include <linux/pci.h>
> > #include <linux/slab.h>
> >
> > -#include <cxlpci.h>
> > +#include <cxl/pci.h>
> >
> > #include "cxl.h"
> > #include "core.h"
> > @@ -850,6 +850,7 @@ int cxl_restore_hdm_after_pci_reset(struct pci_dev
> > *pdev)
> >
> > return cxl_reset_save_restored_state(pdev, command); }
> > +EXPORT_SYMBOL_NS_GPL(cxl_restore_hdm_after_pci_reset, "CXL");
> >
> > static void cxl_hdm_range_context_init(struct cxl_hdm_range_context
> *ctx)
> > {
>