Re: [PATCH v10 10/31] cxl/mem: Configure dynamic capacity interrupts
From: Anisa Su
Date: Thu Jun 11 2026 - 14:20:03 EST
On Wed, Jun 10, 2026 at 09:57:35AM -0700, Dave Jiang wrote:
>
>
> On 6/8/26 1:16 AM, Anisa Su wrote:
> > On Thu, May 28, 2026 at 09:21:59AM -0700, Dave Jiang wrote:
> >>
> >>
> >> On 5/23/26 2:43 AM, Anisa Su wrote:
> >>> From: Ira Weiny <ira.weiny@xxxxxxxxx>
> >>>
> >>> Dynamic Capacity Devices (DCD) support extent change notifications
> >>> through the event log mechanism. The interrupt mailbox commands were
> >>> extended in CXL 3.1 to support these notifications. Firmware can't
> >>> configure DCD events to be FW controlled but can retain control of
> >>> memory events.
> >>>
> >>> Configure DCD event log interrupts on devices supporting dynamic
> >>> capacity. Disable DCD if interrupts are not supported.
> >>>
> >>> Care is taken to preserve the interrupt policy set by the FW if FW first
> >>> has been selected by the BIOS.
> >>>
> >>> Accept the 4-byte CXL 2.0 reply on GET Event Interrupt Policy by setting
> >>> min_out to CXL_EVENT_INT_POLICY_BASE_SIZE; pre-CXL 3.1 firmware omits
> >>> dcd_settings and would otherwise fail the size check.
> >>>
> >>> Based on an original patch by Navneet Singh.
> >>>
> >>> Signed-off-by: Ira Weiny <ira.weiny@xxxxxxxxx>
> >>> Signed-off-by: Anisa Su <anisa.su@xxxxxxxxxxx>
> >>>
> >>> ---
> >>> Changes:
> >>> [anisa: rebase]
> >>> [anisa: accept 4-byte CXL 2.0 GET reply via min_out]
> >>> [anisa: drop Reviewed-by tags now that the patch carries new changes]
> >>> ---
[snip]
> >>> static int cxl_event_config(struct pci_host_bridge *host_bridge,
> >>> struct cxl_memdev_state *mds, bool irq_avail)
> >>> {
> >>> - struct cxl_event_interrupt_policy policy;
> >>> + struct cxl_event_interrupt_policy policy = { 0 };
> >>> + bool native_cxl = host_bridge->native_cxl_error;
> >>> int rc;
> >>>
> >>> /*
> >>> * When BIOS maintains CXL error reporting control, it will process
> >>> * event records. Only one agent can do so.
> >>> + *
> >>> + * If BIOS has control of events and DCD is not supported skip event
> >>> + * configuration.
> >>> */
> >>> - if (!host_bridge->native_cxl_error)
> >>> + if (!native_cxl && !cxl_dcd_supported(mds))
> >>> return 0;
> >>>
> >>> if (!irq_avail) {
> >>> dev_info(mds->cxlds.dev, "No interrupt support, disable event processing.\n");
> >>> + if (cxl_dcd_supported(mds)) {
> >>> + dev_info(mds->cxlds.dev, "DCD requires interrupts, disable DCD\n");
> >>> + cxl_disable_dcd(mds);
> >>> + }
> >>> return 0;
> >>> }
> >>>
> >>> @@ -676,10 +721,10 @@ static int cxl_event_config(struct pci_host_bridge *host_bridge,
> >>> if (rc)
> >>> return rc;
> >>>
> >>> - if (!cxl_event_validate_mem_policy(mds, &policy))
> >>> + if (native_cxl && !cxl_event_validate_mem_policy(mds, &policy))
> >>> return -EBUSY;
> >>>
> >>> - rc = cxl_event_config_msgnums(mds, &policy);
> >>> + rc = cxl_event_config_msgnums(mds, &policy, native_cxl);
> >>> if (rc)
> >>> return rc;
> >>>
> >>> @@ -687,12 +732,16 @@ static int cxl_event_config(struct pci_host_bridge *host_bridge,
> >>> if (rc)
> >>> return rc;
> >>>
> >>> - rc = cxl_event_irqsetup(mds, &policy);
> >>> + rc = cxl_irqsetup(mds, &policy, native_cxl);
> >>> if (rc)
> >>> return rc;
> >>>
> >>> cxl_mem_get_event_records(mds, CXLDEV_EVENT_STATUS_ALL);
> >>
> >> Issue that was always there probably, should this check native_cxl so the BIOS owned events are not retrieved?
> >>
> >> if (native_cxl)
> >> cxl_mem_get_event_records(mds, CXLDEV_EVENT_STATUS_ALL);
> >>
> >>
> > That makes sense. Would you prefer the fix as a separate patch?
>
> Yes please.
>
> DJ
>
Oops I was wrong; the issue wasn't there before. This function used to return 0
if !native_cxl at the top of the function but this patchset added
&& !cxl_dcd_supported() to the condition.
Added the fix to this commit.
Thanks,
Anisa