Thread (89 messages) 89 messages, 6 authors, 2025-01-22

Re: [PATCH v9 05/27] cxl: move pci generic code

flat view

From: Dan Williams <hidden>
Date: 2025-01-18 01:43:15
Also in: linux-cxl

alejandro.lucero-palau@ wrote:
quoted hunk ↗ jump to hunk
From: Alejandro Lucero <redacted>

Inside cxl/core/pci.c there are helpers for CXL PCIe initialization
meanwhile cxl/pci.c implements the functionality for a Type3 device
initialization.

Move helper functions from cxl/pci.c to cxl/core/pci.c in order to be
exported and shared with CXL Type2 device initialization.

Signed-off-by: Alejandro Lucero <redacted>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Ben Cheatham <redacted>
Reviewed-by: Fan Ni <redacted>
---
 drivers/cxl/core/pci.c | 73 ++++++++++++++++++++++++++++++++++++++++++
 drivers/cxl/cxlpci.h   |  3 ++
 drivers/cxl/pci.c      | 71 ----------------------------------------
 3 files changed, 76 insertions(+), 71 deletions(-)
diff --git a/drivers/cxl/core/pci.c b/drivers/cxl/core/pci.c
index 57318cdc368a..5821d582c520 100644
--- a/drivers/cxl/core/pci.c
+++ b/drivers/cxl/core/pci.c
@@ -1034,6 +1034,79 @@ bool cxl_endpoint_decoder_reset_detected(struct cxl_port *port)
 }
 EXPORT_SYMBOL_NS_GPL(cxl_endpoint_decoder_reset_detected, "CXL");
 
+/*
+ * Assume that any RCIEP that emits the CXL memory expander class code
+ * is an RCD
+ */
+bool is_cxl_restricted(struct pci_dev *pdev)
+{
+	return pci_pcie_type(pdev) == PCI_EXP_TYPE_RC_END;
+}
+EXPORT_SYMBOL_NS_GPL(is_cxl_restricted, "CXL");
ok, so v9 is missing my v8 comments:

http://lore.kernel.org/677e0af67788e_2aff429448@dwillia2-xfh.jf.intel.com.notmuch (local)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help