• 周六. 7月 2nd, 2022

5G编程聚合网

5G时代下一个聚合的编程学习网

热门标签

判断pcie卡插在哪个cpu上

admin

11月 28, 2021

判断pcie卡插在哪个cpu上 https://blog.csdn.net/tiantao2012/article/details/78467743

kernel 有个patch https://patchwork.kernel.org/patch/9746541/
diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c
index 4f0e3eb..1082834 100644
--- a/arch/arm64/kernel/pci.c
+++ b/arch/arm64/kernel/pci.c
@@ -108,7 +108,10 @@  int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
 	if (!acpi_disabled) {
 		struct pci_config_window *cfg = bridge->bus->sysdata;
 		struct acpi_device *adev = to_acpi_device(cfg->parent);
+		struct device *bus_dev = &bridge->bus->dev;
+
 		ACPI_COMPANION_SET(&bridge->dev, adev);
+		set_dev_node(bus_dev, acpi_get_node(acpi_device_handle(adev)));
 	}
 
 	return 0;
这个patch的作用很明显,就是在pcie root bridage的时候通过set_dev_node来设置
static inline void set_dev_node(struct device *dev, int node)
{
	dev->numa_node = node;
}


1.内容有错还请在评论区指出哦!谢谢!

发表评论

您的电子邮箱地址不会被公开。