[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zsewcfl5alK4mvZS@fan>
Date: Thu, 22 Aug 2024 14:41:05 -0700
From: Fan Ni <nifan.cxl@...il.com>
To: Ira Weiny <ira.weiny@...el.com>
Cc: Dave Jiang <dave.jiang@...el.com>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Navneet Singh <navneet.singh@...el.com>, Chris Mason <clm@...com>,
Josef Bacik <josef@...icpanda.com>, David Sterba <dsterba@...e.com>,
Petr Mladek <pmladek@...e.com>,
Steven Rostedt <rostedt@...dmis.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Jonathan Corbet <corbet@....net>,
Andrew Morton <akpm@...ux-foundation.org>,
Dan Williams <dan.j.williams@...el.com>,
Davidlohr Bueso <dave@...olabs.net>,
Alison Schofield <alison.schofield@...el.com>,
Vishal Verma <vishal.l.verma@...el.com>,
linux-btrfs@...r.kernel.org, linux-cxl@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
nvdimm@...ts.linux.dev
Subject: Re: [PATCH v3 15/25] cxl/pci: Factor out interrupt policy check
On Fri, Aug 16, 2024 at 09:44:23AM -0500, Ira Weiny wrote:
> Dynamic Capacity Devices (DCD) require event interrupts to process
> memory addition or removal. BIOS may have control over non-DCD event
> processing. DCD interrupt configuration needs to be separate from
> memory event interrupt configuration.
>
> Factor out event interrupt setting validation.
>
> Reviewed-by: Dave Jiang <dave.jiang@...el.com>
> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>
> Signed-off-by: Ira Weiny <ira.weiny@...el.com>
>
Reviewed-by: Fan Ni <fan.ni@...sung.com>
> ---
> Changes:
> [iweiny: reword commit message]
> [iweiny: keep review tags on simple patch]
> ---
> drivers/cxl/pci.c | 23 ++++++++++++++++-------
> 1 file changed, 16 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c
> index 17bea49bbf4d..370c74eae323 100644
> --- a/drivers/cxl/pci.c
> +++ b/drivers/cxl/pci.c
> @@ -738,6 +738,21 @@ static bool cxl_event_int_is_fw(u8 setting)
> return mode == CXL_INT_FW;
> }
>
> +static bool cxl_event_validate_mem_policy(struct cxl_memdev_state *mds,
> + struct cxl_event_interrupt_policy *policy)
> +{
> + if (cxl_event_int_is_fw(policy->info_settings) ||
> + cxl_event_int_is_fw(policy->warn_settings) ||
> + cxl_event_int_is_fw(policy->failure_settings) ||
> + cxl_event_int_is_fw(policy->fatal_settings)) {
> + dev_err(mds->cxlds.dev,
> + "FW still in control of Event Logs despite _OSC settings\n");
> + return false;
> + }
> +
> + return true;
> +}
> +
> static int cxl_event_config(struct pci_host_bridge *host_bridge,
> struct cxl_memdev_state *mds, bool irq_avail)
> {
> @@ -760,14 +775,8 @@ static int cxl_event_config(struct pci_host_bridge *host_bridge,
> if (rc)
> return rc;
>
> - if (cxl_event_int_is_fw(policy.info_settings) ||
> - cxl_event_int_is_fw(policy.warn_settings) ||
> - cxl_event_int_is_fw(policy.failure_settings) ||
> - cxl_event_int_is_fw(policy.fatal_settings)) {
> - dev_err(mds->cxlds.dev,
> - "FW still in control of Event Logs despite _OSC settings\n");
> + if (!cxl_event_validate_mem_policy(mds, &policy))
> return -EBUSY;
> - }
>
> rc = cxl_event_config_msgnums(mds, &policy);
> if (rc)
>
> --
> 2.45.2
>
Powered by blists - more mailing lists