From: Alison Schofield <alison.schofield@intel.com>
To: Gregory Price <gourry@gourry.net>
Cc: <linux-cxl@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<kernel-team@meta.com>, <dave@stgolabs.net>,
<jonathan.cameron@huawei.com>, <dave.jiang@intel.com>,
<vishal.l.verma@intel.com>, <ira.weiny@intel.com>,
<dan.j.williams@intel.com>
Subject: Re: [PATCH v2 1/3] drivers/cxl: introduce cxl_region_driver field for cxl_region
Date: Wed, 14 Jan 2026 10:15:28 -0800 [thread overview]
Message-ID: <aWfdQESLWEKDlBL_@aschofie-mobl2.lan> (raw)
In-Reply-To: <20260113202138.3021093-1-gourry@gourry.net>
On Tue, Jan 13, 2026 at 03:21:36PM -0500, Gregory Price wrote:
> The CXL driver presently has 3 modes of managing a cxl_region:
> - no specific driver (bios-onlined SystemRAM)
> - dax_region (all other RAM regions, for now)
> - pmem_region (all PMEM regions)
>
> Formalize these into specific "region drivers".
>
> enum cxl_region_driver {
> CXL_REGION_DRIVER_NONE,
> CXL_REGION_DRIVER_DAX,
> CXL_REGION_DRIVER_PMEM
> };
>
> $cat regionN/region_driver
> [none,dax,pmem]
>
> The intent is to clarify how to to add additional drivers (sysram,
> dynamic_capacity, etc) in the future, and to allow switching the
> driver selection via a sysfs entry `regionN/region_driver`.
Needs description in Documentation/ABI/testing/sysfs-bus-cxl
I think that will help me understand the switching we expect
to support.
> All RAM regions will be defaulted to CXL_CONTROL_DAX.
CXL_CONTROL_DAX ?
>
> Auto-regions will either be static sysram (BIOS-onlined) and has no
> region controller associated with it - or if the SP bit was set a
> DAX device will be created. This will be discovered at probe time.
>
> Signed-off-by: Gregory Price <gourry@gourry.net>
snip
> +static ssize_t region_driver_store(struct device *dev,
> + struct device_attribute *attr,
> + const char *buf, size_t len)
> +{
> + struct cxl_region *cxlr = to_cxl_region(dev);
> + struct cxl_region_params *p = &cxlr->params;
> + int rc;
> +
> + ACQUIRE(rwsem_write_kill, rwsem)(&cxl_rwsem.region);
> + if ((rc = ACQUIRE_ERR(rwsem_write_kill, &rwsem)))
> + return rc;
> +
> + if (p->state >= CXL_CONFIG_COMMIT)
> + return -EBUSY;
> +
> + /* PMEM drivers cannot be changed */
> + if (cxlr->mode == CXL_PARTMODE_PMEM)
> + return -EBUSY;
why isn't above "if (cxlr->driver == CXL_REGION_DRIVER_PMEM)"
> +
> + /* NONE type is not a valid selection for manually probed regions */
> + if (sysfs_streq(buf, "dax"))
> + cxlr->driver = CXL_REGION_DRIVER_DAX;
> + else
> + return -EINVAL;
> +
> + return len;
> +}
next prev parent reply other threads:[~2026-01-14 18:15 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-13 20:21 [PATCH v2 1/3] drivers/cxl: introduce cxl_region_driver field for cxl_region Gregory Price
2026-01-13 20:21 ` [PATCH v2 2/3] cxl/core/region: move pmem region driver logic into pmem_region Gregory Price
2026-01-13 21:18 ` Dave Jiang
2026-01-20 17:20 ` Fabio M. De Francesco
2026-01-13 20:21 ` [PATCH v2 3/3] cxl/core/region: move dax region driver logic into dax_region Gregory Price
2026-01-13 21:18 ` Dave Jiang
2026-01-20 17:26 ` Fabio M. De Francesco
2026-01-29 19:16 ` Davidlohr Bueso
2026-01-13 21:16 ` [PATCH v2 1/3] drivers/cxl: introduce cxl_region_driver field for cxl_region Dave Jiang
2026-01-14 18:15 ` Alison Schofield [this message]
2026-01-14 18:22 ` Gregory Price
2026-01-20 18:39 ` Fabio M. De Francesco
2026-01-21 22:27 ` Ira Weiny
2026-01-21 23:44 ` Gregory Price
2026-01-22 2:12 ` Gregory Price
2026-01-29 19:10 ` Davidlohr Bueso
2026-01-29 20:43 ` Gregory Price
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aWfdQESLWEKDlBL_@aschofie-mobl2.lan \
--to=alison.schofield@intel.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=gourry@gourry.net \
--cc=ira.weiny@intel.com \
--cc=jonathan.cameron@huawei.com \
--cc=kernel-team@meta.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vishal.l.verma@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox