From: Arpit Kumar <arpit1.kumar@samsung.com>
To: Jonathan Cameron <jonathan.cameron@huawei.com>
Cc: qemu-devel@nongnu.org, gost.dev@samsung.com,
linux-cxl@vger.kernel.org, dave@stgolabs.net,
vishak.g@samsung.com, krish.reddy@samsung.com,
a.manzanares@samsung.com, alok.rathore@samsung.com,
arpit.sysdev@gmail.com, cpgs@samsung.com
Subject: Re: [PATCH v4 1/2] hw/cxl: Refactored Identify Switch Device & Get Physical Port State
Date: Fri, 19 Sep 2025 16:33:12 +0530 [thread overview]
Message-ID: <20250919110312.naudjnvhsjmxaxjk@test-PowerEdge-R740xd> (raw)
In-Reply-To: <20250917165535.000021b1@huawei.com>
[-- Attachment #1: Type: text/plain, Size: 4192 bytes --]
On 17/09/25 04:55PM, Jonathan Cameron wrote:
>On Tue, 16 Sep 2025 13:37:35 +0530
>Arpit Kumar <arpit1.kumar@samsung.com> wrote:
>
>> -Storing physical ports info during enumeration.
>> -Refactored changes using physical ports info for
>> Identify Switch Device (Opcode 5100h) & Get Physical Port State
>> (Opcode 5101h) physical switch FM-API command set.
>>
>> Signed-off-by: Arpit Kumar <arpit1.kumar@samsung.com>
>
>Hi Arpit. One question inline, and one comment on code I've moved
>around whilst queue this up. I'll push out a tree to gitlab
>(probably tomorrow) and when I do please check I didn't mess that up!
>
>Jonathan
>
Hi Jonathan,
Thank you for the swift response and review comments.
Sure, will look into gitlab tree once up.
Thanks,
Arpit
>
>> +static CXLRetCode cxl_set_port_type(CXLUpstreamPort *ports, int pnum,
>> + CXLCCI *cci)
>> +{
>> + uint8_t current_port_config_state;
>> + uint8_t connected_device_type;
>> + uint8_t supported_ld_count;
>> + uint16_t lnkcap, lnkcap2, lnksta;
>> + PCIBus *bus;
>> + PCIDevice *port_dev;
>> + PCIEPort *usp = PCIE_PORT(cci->d);
>> +
>> + if (usp->port == pnum) {
>> + port_dev = PCI_DEVICE(usp);
>> + current_port_config_state = CXL_PORT_CONFIG_STATE_USP;
>> + connected_device_type = CXL_PORT_CONNECTED_DEV_TYPE_NONE;
>> + supported_ld_count = 0;
>> + } else {
>> + bus = &PCI_BRIDGE(cci->d)->sec_bus;
>> + port_dev = pcie_find_port_by_pn(bus, pnum);
>> + if (port_dev) { /* DSP */
>> + PCIDevice *ds_dev = pci_bridge_get_sec_bus(PCI_BRIDGE(port_dev))
>> + ->devices[0];
>> + current_port_config_state = CXL_PORT_CONFIG_STATE_DSP;
>> + if (ds_dev) {
>> + if (object_dynamic_cast(OBJECT(ds_dev), TYPE_CXL_TYPE3)) {
>> + /* To-do: controllable */
>
>In what sense controllable? It should always match what the downstream device
>is presenting as. Do you ultimately mean if we mess with the alternate modes
>and reset the port to have it come up as a PCI only device?
>This will need to be more complex as we add different CXL type 3 device support
>of course, but I'd still expect to auto detect it rather that control it directly.
>
This is with respect to your review comment from v1 patch:
https://lore.kernel.org/qemu-devel/20250602135942.2773823-1-arpit1.kumar@samsung.com/T/
As per my understanding, controllable was identification of the specific type of
CXL type 3 device and accordingly initializing connected_device_type. Since you
mention auto-detect, does it mean using object_get_typename() to identify the type
of device and initiliaze it directly to connected_device_type rather than specifying
it explicitly. If yes, then this anyways rules out controllable part, hence the comment
can be removed.
>> + connected_device_type = CXL_PORT_CONNECTED_DEV_TYPE_3_SLD;
>> + } else {
>> + connected_device_type = CXL_PORT_CONNECTED_DEV_TYPE_PCIE;
>> + }
>> + } else {
>> + connected_device_type = CXL_PORT_CONNECTED_DEV_TYPE_NONE;
>> + }
>> + supported_ld_count = 3;
>> + } else {
>> + return CXL_MBOX_INVALID_INPUT;
>> + }
>> + }
>
>> void cxl_initialize_mailbox_swcci(CXLCCI *cci, DeviceState *intf,
>> DeviceState *d, size_t payload_max)
>> {
>> @@ -4691,6 +4706,7 @@ void cxl_initialize_mailbox_swcci(CXLCCI *cci, DeviceState *intf,
>> cci->d = d;
>> cci->intf = intf;
>> cxl_init_cci(cci, payload_max);
>> + cxl_set_phy_port_info(cci);
>> }
>>
>> void cxl_initialize_mailbox_t3(CXLCCI *cci, DeviceState *d, size_t payload_max)
>> @@ -4777,4 +4793,5 @@ void cxl_initialize_usp_mctpcci(CXLCCI *cci, DeviceState *d, DeviceState *intf,
>> cci->d = d;
>> cci->intf = intf;
>> cxl_init_cci(cci, payload_max);
>> + cxl_set_phy_port_info(cci);
>
>I'll shift this to a later patch whilst picking this up for my staging tree.
>I want this ahead of where we introduce cxl_initialize_usp_mctpcci.
>
Okay
>> }
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2025-09-19 11:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20250916080757epcas5p2db403c9648f7818b22413d90acb4fdd4@epcas5p2.samsung.com>
2025-09-16 8:07 ` [PATCH v4 0/2] FM-API Physical Switch Command Set Support Arpit Kumar
2025-09-16 8:07 ` [PATCH v4 1/2] hw/cxl: Refactored Identify Switch Device & Get Physical Port State Arpit Kumar
2025-09-17 15:55 ` Jonathan Cameron
2025-09-19 11:03 ` Arpit Kumar [this message]
2025-09-30 14:26 ` Jonathan Cameron
2025-09-16 8:07 ` [PATCH v4 2/2] hw/cxl: Add Physical Port Control (Opcode 5102h) Arpit Kumar
2025-09-17 16:05 ` Jonathan Cameron
2025-09-19 11:16 ` Arpit Kumar
2025-09-17 16:29 ` Jonathan Cameron
2025-09-19 11:21 ` Arpit Kumar
2026-01-27 15:23 ` [PATCH v4 0/2] FM-API Physical Switch Command Set Support Jonathan Cameron
2026-01-30 12:03 ` Arpit Kumar
2026-01-30 12:31 ` Jonathan Cameron
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=20250919110312.naudjnvhsjmxaxjk@test-PowerEdge-R740xd \
--to=arpit1.kumar@samsung.com \
--cc=a.manzanares@samsung.com \
--cc=alok.rathore@samsung.com \
--cc=arpit.sysdev@gmail.com \
--cc=cpgs@samsung.com \
--cc=dave@stgolabs.net \
--cc=gost.dev@samsung.com \
--cc=jonathan.cameron@huawei.com \
--cc=krish.reddy@samsung.com \
--cc=linux-cxl@vger.kernel.org \
--cc=qemu-devel@nongnu.org \
--cc=vishak.g@samsung.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