Re: [PATCH v4 19/28] cxl/mem: Configure dynamic capacity interrupts

Ira Weiny
2024-10-24T03:09:40Z

Fan Ni wrote:
> On Mon, Oct 07, 2024 at 06:16:25PM -0500, ira.weiny@intel.com wrote:
> > From: Navneet Singh <navneet.singh@intel.com>
> >

[snip]

> >
> > +static int cxl_irqsetup(struct cxl_memdev_state *mds,
> > + struct cxl_event_interrupt_policy *policy,
> > + bool native_cxl)
> > +{
> > + struct cxl_dev_state *cxlds = &mds->cxlds;
> > + int rc;
> > +
> > + if (native_cxl) {
> > + rc = cxl_event_irqsetup(mds, policy);
> > + if (rc)
> > + return rc;
> > + }
> > +
> > + if (cxl_dcd_supported(mds)) {
> > + rc = cxl_event_req_irq(cxlds, policy->dcd_settings);
> > + if (rc) {
> > + dev_err(cxlds->dev, "Failed to get interrupt for DCD event log\n");
> > + cxl_disable_dcd(mds);
> > + return rc;
>
> If the device has both static and dynamic capacity, return an error code
> here will cause cxl_event_config() return early, and
> cxl_mem_get_event_records() will not be called, will it be an issue?

Good catch as it was not my intent to fail the device probe. Rather to
disable DCD. In practice however, the device would be broken because it
should not be advertising DCD support without allowing for the proper irq
setup.

Current support will fail the probe if event configuration fails. So the
error here is probably bothering to try to disable future DCD processing.

At this point I'm not sure which way to go...

Ira