From: Arpit Kumar <arpit1.kumar@samsung.com>
To: ALOK TIWARI <alok.a.tiwari@oracle.com>
Cc: qemu-devel@nongnu.org, gost.dev@samsung.com,
linux-cxl@vger.kernel.org, dave@stgolabs.net,
Jonathan.Cameron@huawei.com, vishak.g@samsung.com,
krish.reddy@samsung.com, a.manzanares@samsung.com,
alok.rathore@samsung.com, cpgs@samsung.com
Subject: Re: [PATCH v3 2/2] hw/cxl: Add Physical Port Control (Opcode 5102h)
Date: Mon, 8 Sep 2025 18:33:03 +0530 [thread overview]
Message-ID: <20250908130303.hxqdq5yldwpguojo@test-PowerEdge-R740xd> (raw)
In-Reply-To: <2d731c30-bf0c-49c6-b519-4b558d794b08@oracle.com>
[-- Attachment #1: Type: text/plain, Size: 3487 bytes --]
On 05/09/25 02:18PM, ALOK TIWARI wrote:
>
>>@@ -4791,6 +4907,28 @@ void cxl_initialize_usp_mctpcci(CXLCCI *cci, DeviceState *d, DeviceState *intf,
>> cxl_copy_cci_commands(cci, cxl_cmd_set_usp_mctp);
>> cci->d = d;
>> cci->intf = intf;
>>+ CXLUpstreamPort *pp;
>>+ int pn = 0;
>> cxl_init_cci(cci, payload_max);
>> cxl_set_phy_port_info(cci);
>>+ /* physical port control */
>>+ pp = CXL_USP(cci->d);
>>+ for (int byte_index = 0; byte_index < (CXL_MAX_PHY_PORTS / BITS_PER_BYTE);
>>+ byte_index++) {
>>+ unsigned char byte = pp->pports.active_port_bitmask[byte_index];
>>+
>>+ for (int bit_index = 0; bit_index < 8; bit_index++, pn++) {
>>+ if (((byte) & (1 << bit_index)) != 0) {
>>+ qemu_mutex_init(&pp->pports.perst[pn].lock);
>>+ pp->pports.perst[pn].issued_assert_perst = false;
>>+ /*
>>+ * Assert PERST involves physical port to be in
>>+ * hold reset phase for minimum 100ms. No other
>>+ * physcial port control requests are entertained
>
>typo physcial -> physical
>
Thanks for pointing out!
>>+ * until Deassert PERST command.
>>+ */
>>+ pp->pports.perst[pn].asrt_time = ASSERT_WAIT_TIME_MS;
>>+ }
>>+ }
>>+ }
>> }
>>diff --git a/include/hw/cxl/cxl_device.h b/include/hw/cxl/cxl_device.h
>>index 9fc720ec10..033d9bf11a 100644
>>--- a/include/hw/cxl/cxl_device.h
>>+++ b/include/hw/cxl/cxl_device.h
>>@@ -130,6 +130,7 @@
>> (1 << 16))
>> #define CXL_MAX_PHY_PORTS 256
>>+#define ASSERT_WAIT_TIME_MS 100 /* Assert - Deassert PERST */
>> /* physical port control info - CXL r3.2 table 7-19 */
>> #define CXL_PORT_CONFIG_STATE_DISABLED 0x0
>>@@ -196,6 +197,14 @@ typedef struct CXLPhyPortInfo {
>> uint8_t supported_ld_count;
>> } QEMU_PACKED CXLPhyPortInfo;
>>+/* Assert - Deassert PERST */
>>+typedef struct CXLPhyPortPerst {
>>+ bool issued_assert_perst;
>>+ QemuMutex lock; /* protecting assert-deassert reset request */
>>+ uint64_t asrt_time;
>>+ QemuThread asrt_thread; /* thread for 100ms delay */
>>+} CXLPhyPortPerst;
>>+
>> /* CXL r3.1 Table 8-34: Command Return Codes */
>> typedef enum {
>> CXL_MBOX_SUCCESS = 0x0,
>>diff --git a/include/hw/cxl/cxl_mailbox.h b/include/hw/cxl/cxl_mailbox.h
>>index 5c918c53a9..5c31023590 100644
>>--- a/include/hw/cxl/cxl_mailbox.h
>>+++ b/include/hw/cxl/cxl_mailbox.h
>>@@ -88,6 +88,7 @@ enum {
>> PHYSICAL_SWITCH = 0x51,
>> #define IDENTIFY_SWITCH_DEVICE 0x0
>> #define GET_PHYSICAL_PORT_STATE 0x1
>>+ #define PHYSICAL_PORT_CONTROL 0X2
>
>use 0X2 -> 0x2
>
Thanks for pointing out the typo's, will update the same in v4.
>> TUNNEL = 0x53,
>> #define MANAGEMENT_COMMAND 0x0
>> MHD = 0x55,
>>diff --git a/include/hw/pci-bridge/cxl_upstream_port.h b/include/hw/pci-bridge/cxl_upstream_port.h
>>index 3b7e72bfe0..4b9da87d77 100644
>>--- a/include/hw/pci-bridge/cxl_upstream_port.h
>>+++ b/include/hw/pci-bridge/cxl_upstream_port.h
>>@@ -30,6 +30,7 @@ typedef struct CXLUpstreamPort {
>> uint8_t num_ports;
>> uint8_t active_port_bitmask[CXL_MAX_PHY_PORTS / BITS_PER_BYTE];
>> CXLPhyPortInfo pport_info[CXL_MAX_PHY_PORTS];
>>+ CXLPhyPortPerst perst[CXL_MAX_PHY_PORTS];
>> } pports;
>> } CXLUpstreamPort;
>>-- 2.34.1
>>
>
>Thanks,
>Alok
>
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2025-09-08 13:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20250904131926epcas5p2a363cf0604a4801038d32e7da5397da1@epcas5p2.samsung.com>
2025-09-04 13:19 ` [PATCH v3 0/2] FM-API Physical Switch Command Set Support Arpit Kumar
2025-09-04 13:19 ` [PATCH v3 1/2] hw/cxl: Refactored Identify Switch Device & Get Physical Port State Arpit Kumar
2025-09-05 15:59 ` Jonathan Cameron
2025-09-08 13:48 ` Arpit Kumar
2025-09-09 15:07 ` Jonathan Cameron
2025-09-04 13:19 ` [PATCH v3 2/2] hw/cxl: Add Physical Port Control (Opcode 5102h) Arpit Kumar
2025-09-05 8:48 ` ALOK TIWARI
2025-09-08 13:03 ` Arpit Kumar [this message]
2025-09-05 16:12 ` [PATCH v3 0/2] FM-API Physical Switch Command Set Support Jonathan Cameron
2025-09-08 13:22 ` Arpit Kumar
2025-09-09 15:03 ` 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=20250908130303.hxqdq5yldwpguojo@test-PowerEdge-R740xd \
--to=arpit1.kumar@samsung.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=a.manzanares@samsung.com \
--cc=alok.a.tiwari@oracle.com \
--cc=alok.rathore@samsung.com \
--cc=cpgs@samsung.com \
--cc=dave@stgolabs.net \
--cc=gost.dev@samsung.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