From: Gregory Price <gourry@gourry.net>
To: Alison Schofield <alison.schofield@intel.com>
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 13:22:50 -0500 [thread overview]
Message-ID: <aWfe-r7uEV-ajfhX@gourry-fedora-PF4VCD3F> (raw)
In-Reply-To: <aWfdQESLWEKDlBL_@aschofie-mobl2.lan>
On Wed, Jan 14, 2026 at 10:15:28AM -0800, Alison Schofield wrote:
> 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.
>
Can do.
> > + /* PMEM drivers cannot be changed */
> > + if (cxlr->mode == CXL_PARTMODE_PMEM)
> > + return -EBUSY;
>
> why isn't above "if (cxlr->driver == CXL_REGION_DRIVER_PMEM)"
>
I wanted to future-proof against someone trying to do something silly
like changing PMEM to come up as REGION_DRIVER_NONE and then scootching
past the check here. But I can change to
if (cxlr->mode == CXL_PARTMODE_PMEM ||
cxlr->driver CXL_REGION_DRIVER_PMEM)
to make this even more explicit.
~Gregory
next prev parent reply other threads:[~2026-01-14 18:23 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
2026-01-14 18:22 ` Gregory Price [this message]
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=aWfe-r7uEV-ajfhX@gourry-fedora-PF4VCD3F \
--to=gourry@gourry.net \
--cc=alison.schofield@intel.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.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