All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
To: Dave Jiang <dave.jiang@intel.com>
Cc: <linux-cxl@vger.kernel.org>, <dave@stgolabs.net>,
	<alison.schofield@intel.com>, <vishal.l.verma@intel.com>,
	<ira.weiny@intel.com>, <dan.j.williams@intel.com>,
	Jonathan Cameron <Jonsathan.Cameron@huawei.com>
Subject: Re: [PATCH v3 2/9] cxl: Add helper to detect top of CXL device topology
Date: Thu, 22 May 2025 10:18:27 +0100	[thread overview]
Message-ID: <20250522101827.000012c8@huawei.com> (raw)
In-Reply-To: <58d89978-122f-4c79-ba04-98a1ec6e4418@intel.com>

On Wed, 21 May 2025 11:39:29 -0700
Dave Jiang <dave.jiang@intel.com> wrote:

> On 5/21/25 11:34 AM, Dave Jiang wrote:
> > Add a helper to replace the open code detection of CXL device hierarchy
> > root. The helper will be used for delayed hostbridge port creation later
> > on.
> > 
> > Reviewed-by: Jonathan Cameron <Jonsathan.Cameron@huawei.com>  
> 
> I'll fix the email address. :)

One day I'll grow up and learn to spell my own name ;)
Thanks!

J
(playing is safe :)

> DJ
> 
> > Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> > ---
> >  drivers/cxl/core/port.c | 15 ++++++++++-----
> >  1 file changed, 10 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c
> > index 726bd4a7de27..cafb1b13cba1 100644
> > --- a/drivers/cxl/core/port.c
> > +++ b/drivers/cxl/core/port.c
> > @@ -39,6 +39,15 @@ DECLARE_RWSEM(cxl_region_rwsem);
> >  static DEFINE_IDA(cxl_port_ida);
> >  static DEFINE_XARRAY(cxl_root_buses);
> >  
> > +/*
> > + * The terminal device in PCI is NULL and @platform_bus
> > + * for platform devices (for cxl_test)
> > + */
> > +static bool is_cxl_hierarchy_head(struct device *dev)
> > +{
> > +	return (!dev || dev == &platform_bus);
> > +}
> > +
> >  int cxl_num_decoders_committed(struct cxl_port *port)
> >  {
> >  	lockdep_assert_held(&cxl_region_rwsem);
> > @@ -1642,11 +1651,7 @@ int devm_cxl_enumerate_ports(struct cxl_memdev *cxlmd)
> >  		struct device *uport_dev;
> >  		struct cxl_dport *dport;
> >  
> > -		/*
> > -		 * The terminal "grandparent" in PCI is NULL and @platform_bus
> > -		 * for platform devices
> > -		 */
> > -		if (!dport_dev || dport_dev == &platform_bus)
> > +		if (is_cxl_hierarchy_head(dport_dev))
> >  			return 0;
> >  
> >  		uport_dev = dport_dev->parent;  
> 
> 
> 


  reply	other threads:[~2025-05-22  9:18 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-21 18:34 [PATCH v3 0/9] cxl: Delay HB port and switch dport probing until endpoint dev probe Dave Jiang
2025-05-21 18:34 ` [PATCH v3 1/9] cxl/region: Add decoder check to check_commit_order() Dave Jiang
2025-05-21 18:34 ` [PATCH v3 2/9] cxl: Add helper to detect top of CXL device topology Dave Jiang
2025-05-21 18:39   ` Dave Jiang
2025-05-22  9:18     ` Jonathan Cameron [this message]
2025-05-22  9:43   ` Li Ming
2025-05-21 18:34 ` [PATCH v3 3/9] cxl: Separate out CXL dport->id vs actual dport hardware id Dave Jiang
2025-05-22  9:43   ` Li Ming
2025-05-28 12:53   ` Robert Richter
2025-05-21 18:34 ` [PATCH v3 4/9] cxl: Remove adding of port_num via devm_cxl_add_dport() Dave Jiang
2025-05-21 18:34 ` [PATCH v3 5/9] cxl: Defer hardware dport->port_id assignment and registers probing Dave Jiang
2025-05-22 10:55   ` Li Ming
2025-06-04 15:27   ` Robert Richter
2025-05-21 18:34 ` [PATCH v3 6/9] cxl/test: Add workaround for cxl_test for cxl_core calling mocked functions Dave Jiang
2025-05-21 18:34 ` [PATCH v3 7/9] cxl: Change sslbis handler to only handle single dport Dave Jiang
2025-05-22 11:04   ` Li Ming
2025-05-21 18:34 ` [PATCH v3 8/9] cxl: Create an xarray to tie a host bridge to the cxl_root Dave Jiang
2025-05-21 18:34 ` [PATCH v3 9/9] cxl: Move enumeration of hostbridge ports to the memdev probe path Dave Jiang
2025-05-30 13:51 ` [PATCH v3 0/9] cxl: Delay HB port and switch dport probing until endpoint dev probe Robert Richter
2025-06-03 13:55   ` Dave Jiang
2025-06-04 15:44     ` Robert Richter
2025-06-05 15:17       ` Dave Jiang
2025-06-06  9:44         ` Robert Richter
2025-06-13 15:15           ` Gregory Price
2025-06-13 15:43             ` Dave Jiang
2025-06-17 17:47               ` Robert Richter

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=20250522101827.000012c8@huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=Jonsathan.Cameron@huawei.com \
    --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=linux-cxl@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.