From: Dave Jiang <dave.jiang@intel.com>
To: Alison Schofield <alison.schofield@intel.com>
Cc: linux-cxl@vger.kernel.org, dave@stgolabs.net, jic23@kernel.org,
vishal.l.verma@intel.com, ira.weiny@intel.com, djbw@kernel.org
Subject: Re: [PATCH 3/7] cxl/test: Refactor platform device enumerations
Date: Thu, 7 May 2026 16:36:30 -0700 [thread overview]
Message-ID: <73b149b7-9af2-41c6-9ca3-1ff6bc3ece28@intel.com> (raw)
In-Reply-To: <afrHW-6Rn9TEbwIj@aschofie-mobl2.lan>
On 5/5/26 9:45 PM, Alison Schofield wrote:
> On Wed, Apr 22, 2026 at 04:02:33PM -0700, Dave Jiang wrote:
>> Split all the host bridges, rootports, upstream and downstream ports
>> enumerations to separate helper functions. This should make adding
>> type2 hierarchy easier later on.
>>
>> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
>> ---
>> tools/testing/cxl/test/cxl.c | 327 +++++++++++++++++++++++------------
>> 1 file changed, 217 insertions(+), 110 deletions(-)
>>
>> diff --git a/tools/testing/cxl/test/cxl.c b/tools/testing/cxl/test/cxl.c
>> index 903223013e41..5fd73f0634c6 100644
>> --- a/tools/testing/cxl/test/cxl.c
>> +++ b/tools/testing/cxl/test/cxl.c
>
> snip
>
>> +static void cxl_usps_remove(void)
>> +{
>> + for (int i = ARRAY_SIZE(cxl_switch_dport) - 1; i >= 0; i--) {
>> + struct platform_device *pdev = cxl_switch_dport[i];
>> +
>> + if (!pdev)
>> + break;
>> +
>> + platform_device_unregister(cxl_switch_dport[i]);
>> + }
>> +}
>
> snip
>
>
>> +
>> +static void cxl_dsps_remove(void)
>> +{
>> + for (int i = ARRAY_SIZE(cxl_switch_uport) - 1; i >= 0; i--) {
>> + struct platform_device *pdev = cxl_switch_uport[i];
>> +
>> + if (!pdev)
>> + break;
>> +
>> + platform_device_unregister(cxl_switch_uport[i]);
>> + }
>> +}
>
> The bodies of cxl_usps_remove() and cxl_dsps_remove() appear swapped.
> ie the Usps one iterates the Dport and the Dsps one iterates the Uport.
> I think these above need a switcheroo, and then the call order below
> needs reversing:
ok will fix
>
>> +static void cxl_switches_remove(void)
>> +{
>> + cxl_usps_remove();
>> + cxl_dsps_remove();
>> +}
>
> skip to end
>
>
next prev parent reply other threads:[~2026-05-07 23:36 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-22 23:02 [PATCH 0/7] cxl: Add CXL type2 accelerator support for cxl_test Dave Jiang
2026-04-22 23:02 ` [PATCH 1/7] cxl/test: Refactor mock_init_hdm_decoder() to prep for type2 decoder Dave Jiang
2026-05-06 4:31 ` Alison Schofield
2026-05-07 23:35 ` Dave Jiang
2026-04-22 23:02 ` [PATCH 2/7] cxl/test: Add type2 support for mock CFMWS0 Dave Jiang
2026-05-06 4:38 ` Alison Schofield
2026-05-07 23:36 ` Dave Jiang
2026-04-22 23:02 ` [PATCH 3/7] cxl/test: Refactor platform device enumerations Dave Jiang
2026-05-06 4:45 ` Alison Schofield
2026-05-07 23:36 ` Dave Jiang [this message]
2026-04-22 23:02 ` [PATCH 4/7] cxl/test: Add hierarchy enumeration support for type2 device Dave Jiang
2026-05-06 5:05 ` Alison Schofield
2026-05-07 23:37 ` Dave Jiang
2026-04-22 23:02 ` [PATCH 5/7] cxl/test: Fixup hdm init for auto region to support type2 Dave Jiang
2026-05-06 5:07 ` Alison Schofield
2026-04-22 23:02 ` [PATCH 6/7] cxl/test: Add cxl_test accelerator driver Dave Jiang
2026-05-06 5:19 ` Alison Schofield
2026-05-07 23:41 ` Dave Jiang
2026-04-22 23:02 ` [PATCH 7/7] cxl: Fix double unregistration of CXL regions for type2 devices Dave Jiang
2026-04-23 7:10 ` Alejandro Lucero Palau
2026-04-23 14:36 ` Dave Jiang
2026-04-29 23:45 ` Dan Williams (nvidia)
2026-04-23 7:16 ` [PATCH 0/7] cxl: Add CXL type2 accelerator support for cxl_test Alejandro Lucero Palau
2026-05-06 4:20 ` Alison Schofield
2026-05-06 14:59 ` 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=73b149b7-9af2-41c6-9ca3-1ff6bc3ece28@intel.com \
--to=dave.jiang@intel.com \
--cc=alison.schofield@intel.com \
--cc=dave@stgolabs.net \
--cc=djbw@kernel.org \
--cc=ira.weiny@intel.com \
--cc=jic23@kernel.org \
--cc=linux-cxl@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.