From: Gregory Price <gourry@gourry.net>
To: Richard Cheng <icheng@nvidia.com>
Cc: Dave Jiang <dave.jiang@intel.com>,
dave@stgolabs.net, jic23@kernel.org, alison.schofield@intel.com,
vishal.l.verma@intel.com, djbw@kernel.org,
danwilliams@nvidia.com, iweiny@kernel.org, ming.li@zohomail.com,
rrichter@amd.com, linux-cxl@vger.kernel.org,
linux-kernel@vger.kernel.org, sreddym@nvidia.com,
smadhavan@nvidia.com, kaihengf@nvidia.com, kobak@nvidia.com,
newtonl@nvidia.com, kristinc@nvidia.com, mochs@nvidia.com
Subject: Re: [PATCH] cxl/region: Restore passthrough decoder enable on region re-assembly
Date: Tue, 28 Jul 2026 00:14:18 -0400 [thread overview]
Message-ID: <amgqJDkOyyzMau2R@gourry-fedora-PF4VCD3F> (raw)
In-Reply-To: <amgQUnkQ1VjyXtzx@MWDK4CY14F>
On Tue, Jul 28, 2026 at 11:03:37AM +0800, Richard Cheng wrote:
> On Mon, Jul 27, 2026 at 01:25:48PM +0800, Dave Jiang wrote:
>
> I think this part is talking about physical remove/insert ? sorry maybe I commit message was too vague about the scenario.
> The case here is a SW-only teardown via sysfs, this is what I did.
>
> """
> $ echo 1 > /sys/bus/pci/devices/$BDF/remove
> $ echo 1 > /sys/bus/pci/devices/$BDF/rescan
> """
>
> No physical removal, no power cycle, no link-down, no reset. Linux drops and re-enumerates the same device, which never stopped running.
> The endpoint HDM decoder is still committed.
>
> The device is byte-identical before and after, the kernel doesn't clear it either, the decoder is locked and cxl_decoder_reset() returns
> early for CXL_DECODER_F_LOCK before touching any register. The memory keeps decoding.
>
> I don't think anything needs re-programming here? the only thing lost is kernel-side bookkeeping on the passthrough decoder, which is
> freed with port and reallocated with F_ENABLE clear on rescan. The endpoint recovers its state from HW.
> The passthrough decoder has no HW to recover from, that asymmetry is the bug.
>
Being a passthrough decoder is just a special state of a switch decoder,
it doesn't necessarily imply programmability (Enable, Commit, Lock all
technically still apply, it's just ambiguous what they should be).
Wonder if we're just not setting these intermediate decoders up sanely.
If the endpoint is locked / not reprogrammable (commit / lock) on the
first go around, maybe the intermediate decoders should be force-locked
and not have F_ENABLE cleared on teardown? It's not like this actually
changes anything on the hardware, it's just bookkeeping.
(although i will say it's been a bit since i looked at the flag state
machine here, so i could be misremembering what the rules around ENABLE
are i this context).
Curious - what happens if you fully unload cxl_pci between
remove/rescan?
~Gregory
next prev parent reply other threads:[~2026-07-28 4:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 10:37 Richard Cheng
2026-07-27 20:25 ` Dave Jiang
2026-07-28 3:03 ` Richard Cheng
2026-07-28 4:14 ` Gregory Price [this message]
2026-07-31 9:13 ` Richard Cheng
2026-07-28 14:25 ` Dave Jiang
2026-08-05 6:21 ` Richard Cheng
2026-08-05 6:55 ` 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=amgqJDkOyyzMau2R@gourry-fedora-PF4VCD3F \
--to=gourry@gourry.net \
--cc=alison.schofield@intel.com \
--cc=danwilliams@nvidia.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=djbw@kernel.org \
--cc=icheng@nvidia.com \
--cc=iweiny@kernel.org \
--cc=jic23@kernel.org \
--cc=kaihengf@nvidia.com \
--cc=kobak@nvidia.com \
--cc=kristinc@nvidia.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.li@zohomail.com \
--cc=mochs@nvidia.com \
--cc=newtonl@nvidia.com \
--cc=rrichter@amd.com \
--cc=smadhavan@nvidia.com \
--cc=sreddym@nvidia.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
all inboxes | Powered by JetHome®