Linux CXL
 help / color / mirror / Atom feed
From: Alison Schofield <alison.schofield@intel.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Davidlohr Bueso <dave@stgolabs.net>,
	Dave Jiang <dave.jiang@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Ira Weiny <iweiny@kernel.org>, "Li Ming" <ming.li@zohomail.com>,
	Robert Richter <rrichter@amd.com>, <linux-cxl@vger.kernel.org>,
	Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Subject: Re: [PATCH v5 4/7] cxo_ol/region: Name the interleave locals in cxl_port_setup_targets()
Date: Fri, 18 Sep 2026 17:42:59 -0700	[thread overview]
Message-ID: <aq3ak2bSyo95N72s@aschofie-mobl2.lan> (raw)
In-Reply-To: <20260908005049.32763a31@jic23-huawei>

On Tue, Sep 08, 2026 at 12:50:49AM +0100, Jonathan Cameron wrote:
> On Thu,  3 Sep 2026 16:23:46 -0700
> Alison Schofield <alison.schofield@intel.com> wrote:
> 
> > cxl_port_setup_targets() derives the interleave granularity of one decoder
> > from the granularity and ways of the decoder above it, and takes that
> > decoder's own ways from the topology below it. The values from the level
> > above are named parent_iw and parent_ig, but the values being derived are
> > the bare iw and ig, so the reader has to work out which level each one
> > describes.
> > 
> > Rename iw and ig to child_iw and child_ig to match the parent_ prefix used
> > for the level above.
> > 
> > No functional change.
> > 
> > Suggested-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
> > Signed-off-by: Alison Schofield <alison.schofield@intel.com>
> 
> I was wondering a bit about having ceig and ceiw but those would be
> very local so I guess not worth it.
> 
> Given how often we use ways_to_eiw() not to make the conversion
> but just to check if it is possible, I wonder if a ways_valid()
> helper is useful?
> 
> static inline int ways_valid(unsigned int ways)
> {
> 	u8 eiw;
> 
> 	return ways_to_eiw(ways, &eiw);
> }
> 
> Maybe similar for granularity.  Would remove some confusion over whether
> we actually want the encoded values or not, making this function more
> readable. I didn't look for whether it was helpful elsewhere.

I like your suggestion!

Since it makes this patchsets code more beautiful, I'm going to add it
as a pre-patch in this series. However, I will watch it, along with
the other prepatch, and will ask DaveJ to merge it ahead of the series
if it gathers tags.

There are 7 check-only call sites, 3 want ways_valid(), 3 want
granularity-valid() and one needs a eig_valid().

The impact is where you were reading. cxl_port_setup_targets() has
4 check only sites, and we can clean out 4 locals by using the new
helpers!


> Anyhow this change is good
> 
> Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>

  reply	other threads:[~2026-09-19  0:43 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-03 23:23 [PATCH v5 0/7] cxl: Support mixed-granularity region interleaves Alison Schofield
2026-09-03 23:23 ` [PATCH v5 1/7] Documentation/cxl: Describe mixed-granularity regions Alison Schofield
2026-09-07 23:23   ` Jonathan Cameron
2026-09-16 11:51   ` Robert Richter
2026-09-18 20:48     ` Alison Schofield
2026-09-03 23:23 ` [PATCH v5 2/7] cxl/region: Warn on user region position mismatch Alison Schofield
2026-09-16 12:05   ` Robert Richter
2026-09-18 21:18     ` Alison Schofield
2026-09-25  0:30   ` Alison Schofield
2026-09-03 23:23 ` [PATCH v5 3/7] cxl/region: Generalize endpoint position mapping Alison Schofield
2026-09-07 23:42   ` Jonathan Cameron
2026-09-18 23:01     ` Alison Schofield
2026-09-16 14:15   ` Robert Richter
2026-09-18 23:20     ` Alison Schofield
2026-09-03 23:23 ` [PATCH v5 4/7] cxl/region: Name the interleave locals in cxl_port_setup_targets() Alison Schofield
2026-09-07 23:50   ` [PATCH v5 4/7] cxo_ol/region: " Jonathan Cameron
2026-09-19  0:42     ` Alison Schofield [this message]
2026-09-16 14:34   ` [PATCH v5 4/7] cxl/region: " Robert Richter
2026-09-16 17:45     ` Robert Richter
2026-09-19  0:58       ` Alison Schofield
2026-09-19  0:55     ` Alison Schofield
2026-09-03 23:23 ` [PATCH v5 5/7] cxl/region: Support mixed-granularity auto regions Alison Schofield
2026-09-08  0:02   ` Jonathan Cameron
2026-09-16 18:03   ` Robert Richter
2026-09-03 23:23 ` [PATCH v5 6/7] cxl/region: Support mixed-granularity user created regions Alison Schofield
2026-09-08  0:03   ` Jonathan Cameron
2026-09-16 18:13   ` Robert Richter
2026-09-03 23:23 ` [PATCH v5 7/7] cxl/test: Add a topology to test mixed-granularity regions Alison Schofield
2026-09-08  0:10   ` Jonathan Cameron
2026-09-16 18:19 ` [PATCH v5 0/7] cxl: Support mixed-granularity region interleaves Robert Richter
2026-09-18 19:49   ` Alison Schofield
2026-09-29 22:48 ` Dave Jiang

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=aq3ak2bSyo95N72s@aschofie-mobl2.lan \
    --to=alison.schofield@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=iweiny@kernel.org \
    --cc=jic23@kernel.org \
    --cc=jonathan.cameron@oss.qualcomm.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=ming.li@zohomail.com \
    --cc=rrichter@amd.com \
    --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