Linux CXL
 help / color / mirror / Atom feed
From: Alison Schofield <alison.schofield@intel.com>
To: Li Ming <ming.li@zohomail.com>
Cc: linux-cxl@vger.kernel.org, Davidlohr Bueso <dave@stgolabs.net>,
	Jonathan Cameron <jonathan.cameron@huawei.com>,
	Dave Jiang <dave.jiang@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Ira Weiny <ira.weiny@intel.com>,
	Dan Williams <dan.j.williams@intel.com>
Subject: Re: [PATCH] cxl/region: Allow 6 & 12 way regions on 3-way HB interleaves
Date: Thu, 6 Mar 2025 14:15:16 -0800	[thread overview]
Message-ID: <Z8oedHttovc0ydY_@aschofie-mobl2.lan> (raw)
In-Reply-To: <71f703fc-5171-46ad-86b5-f74432a728ae@zohomail.com>

On Wed, Feb 26, 2025 at 03:12:46PM +0800, Li Ming wrote:
> On 2/25/2025 7:58 AM, alison.schofield@intel.com wrote:
> > From: Alison Schofield <alison.schofield@intel.com>

snip

> >
> > +static int gran_multiple(struct cxl_region *cxlr)
> > +{
> > +	struct cxl_root_decoder *cxlrd = to_cxl_root_decoder(cxlr->dev.parent);
> > +	int root_decoder_gran = cxlrd->cxlsd.cxld.interleave_granularity;
> > +	int region_gran = cxlr->params.interleave_granularity;
> > +
> > +	/*
> > +	 * In regions built upon 3-way HB interleaves, the root decoder
> > +	 * granularity can be a multiple of the region granularity. The
> > +	 * multiple value is used in sorting and distance calculations.
> > +	 */
> > +	if (cxlrd->cxlsd.cxld.interleave_ways != 3 || !root_decoder_gran)
> > +		return 1;
> 
> Hi Alison,
> 
> 
> root decoder granularity is possible to be 0 here? I checked the code, the minimal value of it should be 256(CXL_DECODER_MIN_GRANULARITY), it was set in __cxl_parse_cfmws().
> 
> maybe this '!root_decoder_gran' checking is not needed?

Thanks for looking that up. I imagine I had some divide by zero concern,
which would have been wrong too.

Removed check in v2.

-- Alison

> 
> 
> Ming
> 
> [snip]
> 
> 

      reply	other threads:[~2025-03-06 22:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-24 23:58 [PATCH] cxl/region: Allow 6 & 12 way regions on 3-way HB interleaves alison.schofield
2025-02-25  0:41 ` Dave Jiang
2025-02-25  2:27   ` Alison Schofield
2025-02-25 15:41     ` Dave Jiang
2025-02-25  5:02 ` kernel test robot
2025-02-26  7:12 ` Li Ming
2025-03-06 22:15   ` Alison Schofield [this message]

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=Z8oedHttovc0ydY_@aschofie-mobl2.lan \
    --to=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=linux-cxl@vger.kernel.org \
    --cc=ming.li@zohomail.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