Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

cxl/pci: Rename cxl_setup_parent_dport() and cxl_dport_map_regs()

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>

authored by

Li Ming and committed by
Dave Jiang
577a6766 91c0e9d6

+17 -11
+9 -4
drivers/cxl/core/pci.c
··· 787 787 dport->regs.dport_aer = dport_aer; 788 788 } 789 789 790 - static void cxl_dport_map_regs(struct cxl_dport *dport) 790 + static void cxl_dport_map_ras(struct cxl_dport *dport) 791 791 { 792 792 struct cxl_register_map *map = &dport->reg_map; 793 793 struct device *dev = dport->dport_dev; ··· 831 831 } 832 832 } 833 833 834 - void cxl_setup_parent_dport(struct device *host, struct cxl_dport *dport) 834 + /** 835 + * cxl_dport_init_ras_reporting - Setup CXL RAS report on this dport 836 + * @dport: the cxl_dport that needs to be initialized 837 + * @host: host device for devm operations 838 + */ 839 + void cxl_dport_init_ras_reporting(struct cxl_dport *dport, struct device *host) 835 840 { 836 841 struct device *dport_dev = dport->dport_dev; 837 842 ··· 848 843 } 849 844 850 845 dport->reg_map.host = host; 851 - cxl_dport_map_regs(dport); 846 + cxl_dport_map_ras(dport); 852 847 853 848 if (dport->rch) 854 849 cxl_disable_rch_root_ints(dport); 855 850 } 856 - EXPORT_SYMBOL_NS_GPL(cxl_setup_parent_dport, CXL); 851 + EXPORT_SYMBOL_NS_GPL(cxl_dport_init_ras_reporting, CXL); 857 852 858 853 static void cxl_handle_rdport_cor_ras(struct cxl_dev_state *cxlds, 859 854 struct cxl_dport *dport)
+3 -2
drivers/cxl/cxl.h
··· 763 763 764 764 #ifdef CONFIG_PCIEAER_CXL 765 765 void cxl_setup_parent_dport(struct device *host, struct cxl_dport *dport); 766 + void cxl_dport_init_ras_reporting(struct cxl_dport *dport, struct device *host); 766 767 #else 767 - static inline void cxl_setup_parent_dport(struct device *host, 768 - struct cxl_dport *dport) { } 768 + static inline void cxl_dport_init_ras_reporting(struct cxl_dport *dport, 769 + struct device *host) { } 769 770 #endif 770 771 771 772 struct cxl_decoder *to_cxl_decoder(struct device *dev);
+1 -1
drivers/cxl/mem.c
··· 166 166 else 167 167 endpoint_parent = &parent_port->dev; 168 168 169 - cxl_setup_parent_dport(dev, dport); 169 + cxl_dport_init_ras_reporting(dport, dev); 170 170 171 171 scoped_guard(device, endpoint_parent) { 172 172 if (!endpoint_parent->driver) {
+1 -1
tools/testing/cxl/Kbuild
··· 14 14 ldflags-y += --wrap=devm_cxl_add_rch_dport 15 15 ldflags-y += --wrap=cxl_rcd_component_reg_phys 16 16 ldflags-y += --wrap=cxl_endpoint_parse_cdat 17 - ldflags-y += --wrap=cxl_setup_parent_dport 17 + ldflags-y += --wrap=cxl_dport_init_ras_reporting 18 18 19 19 DRIVERS := ../../../drivers 20 20 CXL_SRC := $(DRIVERS)/cxl
+3 -3
tools/testing/cxl/test/mock.c
··· 299 299 } 300 300 EXPORT_SYMBOL_NS_GPL(__wrap_cxl_endpoint_parse_cdat, CXL); 301 301 302 - void __wrap_cxl_setup_parent_dport(struct device *host, struct cxl_dport *dport) 302 + void __wrap_cxl_dport_init_ras_reporting(struct cxl_dport *dport, struct device *host) 303 303 { 304 304 int index; 305 305 struct cxl_mock_ops *ops = get_cxl_mock_ops(&index); 306 306 307 307 if (!ops || !ops->is_mock_port(dport->dport_dev)) 308 - cxl_setup_parent_dport(host, dport); 308 + cxl_dport_init_ras_reporting(dport, host); 309 309 310 310 put_cxl_mock_ops(index); 311 311 } 312 - EXPORT_SYMBOL_NS_GPL(__wrap_cxl_setup_parent_dport, CXL); 312 + EXPORT_SYMBOL_NS_GPL(__wrap_cxl_dport_init_ras_reporting, CXL); 313 313 314 314 MODULE_LICENSE("GPL v2"); 315 315 MODULE_IMPORT_NS(ACPI);