[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250414151950.00001823@huawei.com>
Date: Mon, 14 Apr 2025 15:19:50 +0100
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: Ira Weiny <ira.weiny@...el.com>
CC: Dave Jiang <dave.jiang@...el.com>, Fan Ni <fan.ni@...sung.com>, "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-cxl@...r.kernel.org>,
<nvdimm@...ts.linux.dev>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v9 01/19] cxl/mbox: Flag support for Dynamic Capacity
Devices (DCD)
On Sun, 13 Apr 2025 17:52:09 -0500
Ira Weiny <ira.weiny@...el.com> wrote:
> Per the CXL 3.1 specification software must check the Command Effects
> Log (CEL) for dynamic capacity command support.
>
> Detect support for the DCD commands while reading the CEL, including:
>
> Get DC Config
> Get DC Extent List
> Add DC Response
> Release DC
>
> Based on an original patch by Navneet Singh.
>
> Signed-off-by: Ira Weiny <ira.weiny@...el.com>
> +
> +static bool cxl_verify_dcd_cmds(struct cxl_memdev_state *mds, unsigned long *cmds_seen)
It's not immediately obvious to me what the right behavior
from something called cxl_verify_dcd_cmds() is. A comment might help with that.
I think all it does right now is check if any bits are set. In my head
it was going to check that all bits needed for a useful implementation were
set. I did have to go check what a 'logical and' of a bitmap was defined as
because that bit of the bitmap_and() return value wasn't obvious to me either!
> +{
> + DECLARE_BITMAP(all_cmds, CXL_DCD_ENABLED_MAX);
> + DECLARE_BITMAP(dst, CXL_DCD_ENABLED_MAX);
> +
> + bitmap_fill(all_cmds, CXL_DCD_ENABLED_MAX);
> + return bitmap_and(dst, cmds_seen, all_cmds, CXL_DCD_ENABLED_MAX);
> +}
> +
Powered by blists - more mailing lists