mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Koralahalli Channabasappa, Smita" <skoralah@amd.com>
To: Dan Williams <dan.j.williams@intel.com>,
	Smita Koralahalli <Smita.KoralahalliChannabasappa@amd.com>,
	linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Alison Schofield <alison.schofield@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Ira Weiny <ira.weiny@intel.com>,
	Jonathan Cameron <jonathan.cameron@huawei.com>,
	Yazen Ghannam <yazen.ghannam@amd.com>,
	Dave Jiang <dave.jiang@intel.com>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Terry Bowman <terry.bowman@amd.com>,
	Robert Richter <rrichter@amd.com>,
	Benjamin Cheatham <benjamin.cheatham@amd.com>
Subject: Re: [PATCH] cxl/hdm: Avoid DVSEC fallback after region teardown
Date: Thu, 12 Mar 2026 13:55:13 -0700	[thread overview]
Message-ID: <972d610d-e6b6-4c82-b5d3-85cfff9071e5@amd.com> (raw)
In-Reply-To: <69b31741a3945_21321008f@dwillia2-mobl4.notmuch>

On 3/12/2026 12:42 PM, Dan Williams wrote:
> Koralahalli Channabasappa, Smita wrote:
> [..]
>>> "do not teardown auto regions" should squash this crop of setup bugs.
>>
>> Looking at this more closely for patch 2, if I'm not wrong, I think the
>> problem is that cxl_setup_hdm_decoder_from_dvsec() is not setting up the
>> interleave_granularity on the decoder. It inherits the default PAGE_SIZE
>> (4096) from cxl_decoder_init(), and construct_region() then copies that
>> stale value into the region params.
>>
>> So even in a DVSEC emulation case, the IG would be whatever
>> cxl_decoder_init() defaulted to, not what the actual configuration is right?
> 
> Remember that CXL 1.1 DVSEC range registers do not support interleave.
> Interleaving was a CXL 2.0 feature.
> 
> So in the case where HDM decoders are actually disabled and DVSEC Range
> registers are sufficient, the bug is in cxl_port_setup_targets().
> Specifically, when interleave_ways == 1 then interleave_granularity does
> not matter. It is ok for CFMWS and the region granularity numbers to
> mismatch in that case.
> 
> So I would not expect that ig mismatch matters after:
> 
> ce32b0c9c522 cxl: core/region - ignore interleave granularity when ways=1
> 
> ...did that miss an additional location where we are doing granularity
> checks?

What's actually triggering my error is likely the disabled decoder flag. 
The log shows:

[] cxl region0: pci0000:e0:port1 cxl_port_setup_targets expected iw: 1 
ig: 4096 [mem 0x850000000-0x284fffffff flags 0x200]
[] cxl region0: pci0000:e0:port1 cxl_port_setup_targets got iw: 1 ig: 
256 state: disabled 0x850000000:0x284fffffff

The decoder is in disabled state because cxl_decoder_reset() clears 
CXL_DECODER_F_ENABLE during region teardown.

So ce32b0c9c522 is handling the IG issue correctly and Im probably 
hitting failing condition with the disabled flag. I will spend some more 
time confirming this.

> 
>> Is the second patch about fixing cxl_setup_hdm_decoder_from_dvsec() to
>> properly set the interleave granularity?
> 
> I would say just clean up the changelog per the feedback and we can
> start a separate thread to fixup DVSEC support.
> 
> With the suggested changelog updates you can also add:
> 
> Reviewed-by: Dan Williams <dan.j.williams@intel.com>

Sure thanks on this. I will send out v2 just with these changes and 
rewriting the commit message.

Thanks
Smita


      reply	other threads:[~2026-03-12 20:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-12 22:38 Smita Koralahalli
2026-02-13  4:32 ` Alison Schofield
2026-02-17 21:27   ` Koralahalli Channabasappa, Smita
2026-02-17 22:29 ` Dave Jiang
2026-03-11  1:59 ` Alison Schofield
2026-03-11  3:22 ` Dan Williams
2026-03-12 17:37   ` Koralahalli Channabasappa, Smita
2026-03-12 19:42     ` Dan Williams
2026-03-12 20:55       ` Koralahalli Channabasappa, Smita [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=972d610d-e6b6-4c82-b5d3-85cfff9071e5@amd.com \
    --to=skoralah@amd.com \
    --cc=Smita.KoralahalliChannabasappa@amd.com \
    --cc=alison.schofield@intel.com \
    --cc=benjamin.cheatham@amd.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=linux-kernel@vger.kernel.org \
    --cc=rrichter@amd.com \
    --cc=terry.bowman@amd.com \
    --cc=vishal.l.verma@intel.com \
    --cc=yazen.ghannam@amd.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

all inboxes | Powered by JetHome®