From: Srirangan Madhavan <smadhavan@nvidia.com>
To: Alison Schofield <alison.schofield@intel.com>
Cc: Dave Jiang <dave.jiang@intel.com>,
Bjorn Helgaas <bhelgaas@google.com>,
Davidlohr Bueso <dave@stgolabs.net>,
Ira Weiny <ira.weiny@intel.com>,
Jonathan Cameron <jic23@kernel.org>,
Vishal Verma <vishal.l.verma@intel.com>,
linux-cxl@vger.kernel.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org,
Alex Williamson <alex.williamson@redhat.com>,
vsethi@nvidia.com, alwilliamson@nvidia.com,
Sai Yashwanth Reddy Kancherla <skancherla@nvidia.com>,
Vishal Aslot <vaslot@nvidia.com>,
Manish Honap <mhonap@nvidia.com>, Jiandi An <jan@nvidia.com>,
Richard Cheng <icheng@nvidia.com>,
linux-tegra@vger.kernel.org
Subject: Re: [PATCH v14 10/16] cxl: Cache endpoint HDM state during PCI enumeration
Date: Sat, 10 Oct 2026 19:45:34 -0700 [thread overview]
Message-ID: <a5ab7bd0-a732-4009-9ad9-b60ea8d52a15@nvidia.com> (raw)
In-Reply-To: <asafh2lu2PJ465gF@aschofie-mobl2.lan>
On 10/7/26 12:37 PM, Alison Schofield wrote:
>> In general I'm noticing a few functions that takes a 'struct pci_dev' that does not need that in resource.c. In the future, I would like to extend cxl_test to this core code in order to cover most of the functions in resource.c and the reset mechanism. Do you mind taking a look at if things can be reorganized? I did a quick refactor of your series using LLM [1]. See if the shaping of that is acceptable for you. Essentially I had it organize into 3 parts. drivers/cxl/core/hdm_regs.c, drivers/cxl/core/hdm_state.c, and drivers/pci/cxl.c. Feel free to use any or none of the changes.
>
> Srirangan,
>
> Agree with Dave on this point. We should avoid carrying struct pci_dev down
> into helpers that don't otherwise need to know about PCI.
>
> There are a few more examples later in the series where this starts to spread
> through the HDM/range handling. I'll call those out on patch 12/16.
>
> -- Alison
>
>
>> ┌─────┬──────────────────┬───────────────────────────────────────────────┐
>> │ # │ Patch │ Change │
>> ├─────┼──────────────────┼───────────────────────────────────────────────┤
>> │ 1-4 │ unchanged │ Same commit objects, all Reviewed-by tags │
>> │ │ │ kept │
>> ├─────┼──────────────────┼───────────────────────────────────────────────┤
>> │ │ Introduce │ target_or_skip_reg_val replaced by an │
>> │ 5 │ reusable HDM │ endpoint-only settings struct with skip; │
>> │ │ decoder settings │ switch commit takes the target list directly; │
>> │ │ │ endpoints write the DPA Skip registers again │
>> ├─────┼──────────────────┼───────────────────────────────────────────────┤
>> │ │ Move HDM decoder │ New built-in hdm_regs.c, built with │
>> │ 6 │ helpers to │ obj-$(subst m,y,$(CONFIG_CXL_BUS)), so │
>> │ │ built-in code │ linking cxl_core no longer depends on │
>> │ │ │ CONFIG_CXL_RESET │
>> ├─────┼──────────────────┼───────────────────────────────────────────────┤
>> │ │ Share HDM │ Unpacks the common config only; Target List │
>> │ 7 │ decoder register │ and DPA Skip are read where they're used │
>> │ │ unpacking │ again │
>> ├─────┼──────────────────┼───────────────────────────────────────────────┤
>> │ │ Reject │ │
>> │ 8 │ overflowing HDM │ Rebased only │
>> │ │ decoder ranges │ │
>> ├─────┼──────────────────┼───────────────────────────────────────────────┤
>> │ │ Refresh cached │ Endpoint decoders only; CONFIG_CXL_RESET │
>> │ 9 │ PCI HDM decoder │ introduced here; two bug fixes (below) │
>> │ │ settings │ │
>> ├─────┼──────────────────┼───────────────────────────────────────────────┤
>> │ │ Cache endpoint │ PCI-side code moved to the new │
>> │ 10 │ HDM state during │ drivers/pci/cxl.c; cache and cxl_rwsem in the │
>> │ │ enumeration │ new built-in hdm_state.c │
>> ├─────┼──────────────────┼───────────────────────────────────────────────┤
>> │ 11 │ Add CXL Device │ Moved to drivers/pci/cxl.c, otherwise │
>> │ │ Reset sequencing │ identical │
>> ├─────┼──────────────────┼───────────────────────────────────────────────┤
>> │ │ Validate and │ │
>> │ 12 │ synchronize HDM │ Region-quiesce API in hdm_state.c, so the PCI │
>> │ │ ranges around │ core never takes cxl_rwsem directly │
>> │ │ reset │ │
>> ├─────┼──────────────────┼───────────────────────────────────────────────┤
>> │ 13, │ Reject unsafe │ │
>> │ 15 │ scope / Expose │ Rebased only │
>> │ │ CXL Reset │ │
>> ├─────┼──────────────────┼───────────────────────────────────────────────┤
>> │ │ Restore CXL │ Decoder restore split into hdm_regs.c, which │
>> │ 14 │ state after PCI │ needs no pci_dev │
>> │ │ reset │ │
>> ├─────┼──────────────────┼───────────────────────────────────────────────┤
>> │ │ Restore CXL │ │
>> │ 16 │ state after CXL │ Race fix. Found through testing. │
>> │ │ bus reset │ │
>> ├─────┼──────────────────┼───────────────────────────────────────────────┤
>>
>> [1]:https://git.kernel.org/pub/scm/linux/kernel/git/djiang/linux.git/log/?
>> h=cxl-type2-reset
Hi Alison, Dave,
I've adopted the structure from Dave's reference branch in v15:
PCI discovery and reset sequencing are in drivers/pci/cxl.c. Generic HDM
register and state helpers are in hdm_regs.c and hdm_state.c.
v15 series also incorporates the other pieces like cache fixes and
decoder refresh during bus-reset restoration from Dave's branch.
Thank you for the refactor.
--
Regards,
Srirangan
next prev parent reply other threads:[~2026-10-11 2:45 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-01 9:22 [PATCH v14 00/16] PCI/CXL: Add CXL reset support for Type 2 devices Srirangan Madhavan
2026-10-01 9:22 ` [PATCH v14 01/16] cxl: Drop stale decoder interleave limit comment Srirangan Madhavan
2026-10-02 9:33 ` Richard Cheng
2026-10-07 12:07 ` Li Ming
2026-10-01 9:22 ` [PATCH v14 02/16] cxl: Share CXL port upstream PCI device lookup Srirangan Madhavan
2026-10-02 9:48 ` Richard Cheng
2026-10-07 12:22 ` Li Ming
2026-10-11 2:54 ` Srirangan Madhavan
2026-10-01 9:22 ` [PATCH v14 03/16] cxl: Move decoder declarations to shared header Srirangan Madhavan
2026-10-02 9:49 ` Richard Cheng
2026-10-07 12:29 ` Li Ming
2026-10-01 9:22 ` [PATCH v14 04/16] cxl: Embed decoder configuration in a standalone structure Srirangan Madhavan
2026-10-02 10:17 ` Richard Cheng
2026-10-11 2:38 ` Srirangan Madhavan
2026-10-02 19:07 ` Dave Jiang
2026-10-07 12:34 ` Li Ming
2026-10-01 9:22 ` [PATCH v14 05/16] cxl: Introduce reusable HDM decoder settings Srirangan Madhavan
2026-10-02 19:59 ` Dave Jiang
2026-10-07 13:12 ` Li Ming
2026-10-07 16:23 ` Dave Jiang
2026-10-08 13:18 ` Li Ming
2026-10-08 15:19 ` Dave Jiang
2026-10-09 14:41 ` Li Ming
2026-10-11 2:48 ` Srirangan Madhavan
2026-10-01 9:22 ` [PATCH v14 06/16] cxl: Move HDM decoder helpers to built-in resource code Srirangan Madhavan
2026-10-05 21:42 ` Dave Jiang
2026-10-01 9:22 ` [PATCH v14 07/16] cxl: Share HDM decoder register unpacking Srirangan Madhavan
2026-10-02 21:46 ` Dave Jiang
2026-10-01 9:22 ` [PATCH v14 08/16] cxl: Reject overflowing HDM decoder ranges Srirangan Madhavan
2026-10-02 21:50 ` Dave Jiang
2026-10-01 9:22 ` [PATCH v14 09/16] cxl: Refresh cached PCI HDM decoder settings Srirangan Madhavan
2026-10-02 23:57 ` Dave Jiang
2026-10-11 2:52 ` Srirangan Madhavan
2026-10-01 9:22 ` [PATCH v14 10/16] cxl: Cache endpoint HDM state during PCI enumeration Srirangan Madhavan
2026-10-06 15:39 ` Dave Jiang
2026-10-07 19:37 ` Alison Schofield
2026-10-11 2:45 ` Srirangan Madhavan [this message]
2026-10-01 9:22 ` [PATCH v14 11/16] cxl: Add CXL Device Reset sequencing Srirangan Madhavan
2026-10-01 9:22 ` [PATCH v14 12/16] cxl: Validate and synchronize HDM ranges around reset Srirangan Madhavan
2026-10-02 8:06 ` Richard Cheng
2026-10-11 2:35 ` Srirangan Madhavan
2026-10-07 19:44 ` Alison Schofield
2026-10-01 9:22 ` [PATCH v14 13/16] PCI/CXL: Reject reset with unsafe function scope Srirangan Madhavan
2026-10-08 23:33 ` Bjorn Helgaas
2026-10-01 9:22 ` [PATCH v14 14/16] cxl: Restore CXL state after PCI reset Srirangan Madhavan
2026-10-07 19:49 ` Alison Schofield
2026-10-01 9:22 ` [PATCH v14 15/16] PCI/CXL: Expose CXL Reset as a PCI reset method Srirangan Madhavan
2026-10-01 9:22 ` [PATCH v14 16/16] PCI/CXL: Restore CXL state after CXL bus reset Srirangan Madhavan
2026-10-08 23:35 ` Bjorn Helgaas
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=a5ab7bd0-a732-4009-9ad9-b60ea8d52a15@nvidia.com \
--to=smadhavan@nvidia.com \
--cc=alex.williamson@redhat.com \
--cc=alison.schofield@intel.com \
--cc=alwilliamson@nvidia.com \
--cc=bhelgaas@google.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=icheng@nvidia.com \
--cc=ira.weiny@intel.com \
--cc=jan@nvidia.com \
--cc=jic23@kernel.org \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=mhonap@nvidia.com \
--cc=skancherla@nvidia.com \
--cc=vaslot@nvidia.com \
--cc=vishal.l.verma@intel.com \
--cc=vsethi@nvidia.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®