Linux CXL
 help / color / mirror / Atom feed
From: Gregory Price <gourry@gourry.net>
To: Ira Weiny <ira.weiny@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,
	alison.schofield@intel.com, vishal.l.verma@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, 21 Jan 2026 21:12:18 -0500	[thread overview]
Message-ID: <aXGHgtAHNVWJsZbo@gourry-fedora-PF4VCD3F> (raw)
In-Reply-To: <aXFk2pr7mFw4eqMK@gourry-fedora-PF4VCD3F>

> > :-/
> > 
> > I'm not opposed to this idea but I'm worried that this adds to the already
> > very implicit nature of the CXL subsystem.
> > 
> 

Took me a bit, but i follow this now.

The current flow of things:

   echo region0 > cxl/drivers/cxl_region/bind
      cxl_region_probe()
        - devm_cxl_add_dax_region()
        - dax_region is created and probed

      cxl_dax_region_probe()
        - devm_create_dev_dax(&data));
	  dax0.0 is created with IORESOURCE_DAX_KMEM

      dax/bus.c discovery
        - dax bus discovers new dev_dax
	- dax bus auto-sets driver type to dax_kmem
	  dax_bus_match() -> dax_match_type() 
          if (dev_dax->region->res.flags & IORESOURCE_DAX_KMEM)
                type = DAXDRV_KMEM_TYPE;
        - dax_bus_probe() calls dax_drv->probe() unconditionally
	  
      dev_dax_kmem_probe()
        - kmem driver starts memory hotplug procedure


So to my (your? our?) point - the following is implicit in cxl:

	if (IS_ENABLED(CONFIG_DEV_DAX_KMEM))
		create_ram_region  ===>  dax_kmem
	else
		create_ram_region  ===>  device_dax


What would have been nice:

echo region0 > decoder0.0/create_ram_region
  - region0 is created
  - program decoders

echo region0 > cxl/drivers/dax_region/bind
  - dax_region0 is created
  - dax_region0 creates dax0.0
  - dax/bus.c *does not* auto-probe the driver type
  - user configures dax0.0

echo dax0.0 > dax/drivers/kmem/bind
  - dax/kmem.c does the whole hotplug song and dance

But in an effort to make auto-onlining capacity user-friendly,
the middle piece was automated away.

I don't see how we dig ourself out of the former flow without either:

1) Breaking the current auto-config flow by adding:

      cxl/drivers/[xxx_region]/bind

2) Adding something akin to `region0/region_driver` which is basically
   used to replace the `echo region0 > cxl/drivers/[xxx_region]/bind

   you just get
   switch (region->region_driver) {
   case dax: do_dax_thing(); break;
   case sysram: do_sysram_thing(); break;
   ...
   }

   do_dax_thing() is otherwise just dax_region_probe()
   do_sysram_thing() is otherwise just sysram_region_probe()


~Gregory

  reply	other threads:[~2026-01-22  2:12 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
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 [this message]
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=aXGHgtAHNVWJsZbo@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