]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
cxl/pci: Rename cxl_setup_parent_dport() and cxl_dport_map_regs()
authorLi Ming <ming4.li@intel.com>
Fri, 30 Aug 2024 06:13:06 +0000 (06:13 +0000)
committerDave Jiang <dave.jiang@intel.com>
Tue, 3 Sep 2024 22:29:33 +0000 (15:29 -0700)
The name of cxl_setup_parent_dport() function is not clear, the function
is used to initialize AER and RAS capabilities on a dport, therefore,
rename the function to cxl_dport_init_ras_reporting(), it is easier for
user to understand what the function does. Besides, adjust the order of
the function parameters, the subject of cxl_dport_init_ras_reporting()
is a cxl dport, so a struct cxl_dport as the first parameter of the
function should be better.

cxl_dport_map_regs() is used to map CXL RAS capability on a cxl dport,
using cxl_dport_map_ras() as the function name.

Signed-off-by: Li Ming <ming4.li@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://patch.msgid.link/20240830061308.2327065-1-ming4.li@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
drivers/cxl/core/pci.c
drivers/cxl/cxl.h
drivers/cxl/mem.c
tools/testing/cxl/Kbuild
tools/testing/cxl/test/mock.c

index 4725e37d90fb10f3962c486fa327771c73272f45..cca078068a05feca70d1b4c6ad609c3fe1f622cc 100644 (file)
@@ -787,7 +787,7 @@ static void cxl_dport_map_rch_aer(struct cxl_dport *dport)
        dport->regs.dport_aer = dport_aer;
 }
 
-static void cxl_dport_map_regs(struct cxl_dport *dport)
+static void cxl_dport_map_ras(struct cxl_dport *dport)
 {
        struct cxl_register_map *map = &dport->reg_map;
        struct device *dev = dport->dport_dev;
@@ -831,7 +831,12 @@ static void cxl_disable_rch_root_ints(struct cxl_dport *dport)
        }
 }
 
-void cxl_setup_parent_dport(struct device *host, struct cxl_dport *dport)
+/**
+ * cxl_dport_init_ras_reporting - Setup CXL RAS report on this dport
+ * @dport: the cxl_dport that needs to be initialized
+ * @host: host device for devm operations
+ */
+void cxl_dport_init_ras_reporting(struct cxl_dport *dport, struct device *host)
 {
        struct device *dport_dev = dport->dport_dev;
 
@@ -843,12 +848,12 @@ void cxl_setup_parent_dport(struct device *host, struct cxl_dport *dport)
        }
 
        dport->reg_map.host = host;
-       cxl_dport_map_regs(dport);
+       cxl_dport_map_ras(dport);
 
        if (dport->rch)
                cxl_disable_rch_root_ints(dport);
 }
-EXPORT_SYMBOL_NS_GPL(cxl_setup_parent_dport, CXL);
+EXPORT_SYMBOL_NS_GPL(cxl_dport_init_ras_reporting, CXL);
 
 static void cxl_handle_rdport_cor_ras(struct cxl_dev_state *cxlds,
                                          struct cxl_dport *dport)
index 84cf3b4d60a183440f35b4c17a9cb148d0b7c1ca..2890f7e2aad5dcb0215cd0d83a6c15fcf9a62804 100644 (file)
@@ -763,9 +763,10 @@ struct cxl_dport *devm_cxl_add_rch_dport(struct cxl_port *port,
 
 #ifdef CONFIG_PCIEAER_CXL
 void cxl_setup_parent_dport(struct device *host, struct cxl_dport *dport);
+void cxl_dport_init_ras_reporting(struct cxl_dport *dport, struct device *host);
 #else
-static inline void cxl_setup_parent_dport(struct device *host,
-                                         struct cxl_dport *dport) { }
+static inline void cxl_dport_init_ras_reporting(struct cxl_dport *dport,
+                                               struct device *host) { }
 #endif
 
 struct cxl_decoder *to_cxl_decoder(struct device *dev);
index ae94018a01bdf69dced3c21b21ef877c35c93a2d..a9fd5cd5a0d2f97f60a4d4d82d3d94848adafb9e 100644 (file)
@@ -166,7 +166,7 @@ static int cxl_mem_probe(struct device *dev)
        else
                endpoint_parent = &parent_port->dev;
 
-       cxl_setup_parent_dport(dev, dport);
+       cxl_dport_init_ras_reporting(dport, dev);
 
        scoped_guard(device, endpoint_parent) {
                if (!endpoint_parent->driver) {
index 3d1ca9e38b1fa9d2633b5c38ea41021a2865cc7c..b1256fee3567fc7743812ee14bc46e09b7c8ba9b 100644 (file)
@@ -14,7 +14,7 @@ ldflags-y += --wrap=cxl_dvsec_rr_decode
 ldflags-y += --wrap=devm_cxl_add_rch_dport
 ldflags-y += --wrap=cxl_rcd_component_reg_phys
 ldflags-y += --wrap=cxl_endpoint_parse_cdat
-ldflags-y += --wrap=cxl_setup_parent_dport
+ldflags-y += --wrap=cxl_dport_init_ras_reporting
 
 DRIVERS := ../../../drivers
 CXL_SRC := $(DRIVERS)/cxl
index d619672faa497a02c3ea71efd2f3f66144050805..bbd7d938156d91408f2d7757269e5d0af2837999 100644 (file)
@@ -299,17 +299,17 @@ void __wrap_cxl_endpoint_parse_cdat(struct cxl_port *port)
 }
 EXPORT_SYMBOL_NS_GPL(__wrap_cxl_endpoint_parse_cdat, CXL);
 
-void __wrap_cxl_setup_parent_dport(struct device *host, struct cxl_dport *dport)
+void __wrap_cxl_dport_init_ras_reporting(struct cxl_dport *dport, struct device *host)
 {
        int index;
        struct cxl_mock_ops *ops = get_cxl_mock_ops(&index);
 
        if (!ops || !ops->is_mock_port(dport->dport_dev))
-               cxl_setup_parent_dport(host, dport);
+               cxl_dport_init_ras_reporting(dport, host);
 
        put_cxl_mock_ops(index);
 }
-EXPORT_SYMBOL_NS_GPL(__wrap_cxl_setup_parent_dport, CXL);
+EXPORT_SYMBOL_NS_GPL(__wrap_cxl_dport_init_ras_reporting, CXL);
 
 MODULE_LICENSE("GPL v2");
 MODULE_IMPORT_NS(ACPI);