Linux Kernel 6.0 CXL Core pci.c 详解 首先,仍然是是一个PCI 设备驱动模型,根据 pci_device_id 中的 Class 去匹配设备,匹配成功调用probe 函数 staticconststructpci_device_idcxl_mem_pci_tbl[]={/* PCI class code for CXL.mem Type-3 Devices */{PCI_DEVICE_CLASS((PCI_CLASS_MEMORY_CXL<<8|CXL_M...
4. CXL HDM Decoder Capability Structure // linux-6.0\drivers\cxl\core\regs.c// SPDX-License-Identifier: GPL-2.0-only/* Copyright(c) 2020 Intel Corporation. */#include<linux/io-64-nonatomic-lo-hi.h>#include<linux/device.h>#include<linux/slab.h>#include<linux/pci.h>#include<cxlmem.h>...
PCI bus scan and are instead discovered using system firmware, ACPI in this case.[1] The downstream port is implemented as a Root Complex Register Block (RCRB). The RCRB is a 4k memory block containing PCIe registers based on the PCIe root port.[2] The RCRB includes AER extended ...
static int cxl_mem_probe(struct pci_dev *pdev, const struct pci_device_id *id) { struct cxl_memdev *cxlmd; struct cxl_mem *cxlm; int rc; @@ -1607,7 +1611,14 @@ static int cxl_mem_probe(struct pci_dev *pdev, const struct pci_device_id *id) if (rc) return rc; return cxl...
> > +++ b/drivers/cxl/pci.c > > @@ -874,6 +874,10 @@ static int cxl_pci_probe(struct pci_dev *pdev, const > > struct pci_device_id *id) > > if (rc) > > return rc; > > > > + rc = cxl_dev_dynamic_capacity_identify(mds); ...
> diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c > index 3a60cd66263e..f7f03599bc83 100644 > --- a/drivers/cxl/pci.c > +++ b/drivers/cxl/pci.c > @@ -874,6 +874,10 @@ static int cxl_pci_probe(struct pci_dev *pdev, const > struct pci_device_id *id) > if (...
__cxl_driver_register()函数,驱动注册,会遍历设备链表,匹配ID,匹配成功调用 probe 函数 // Path : linux-6.3\drivers\cxl\core\port.c/*** __cxl_driver_register - register a driver for the cxl bus* @cxl_drv: cxl driver structure to attach* @owner: owning module/driver* @modname: KBUILD_MO...
@@ -708,6 +708,10 @@ static int cxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) if (rc) return rc; rc = cxl_set_timestamp(cxlds); if (rc) return rc; rc = cxl_dev_state_identify(cxlds); if (rc) return rc; 0 comments on commit fa88434 Please sig...
Kernel driver in use: cxl_pci dmesg查看cxl设备驱动 dmesg | grep cxl [ 10.953256] cxl_pci 0000:0d:00.0: enabling device (0000 -> 0002) [ 10.980827] cxl_mem mem0: Media not active (-16) [ 10.982005] cxl_mem: probe of mem0 failed with error -16 ...
#include <linux/pci.h> #include "cxl.h"struct cxl_walk_context { struct device *dev; struct pci_bus *root; struct cxl_port *port; int error; int count; };static int match_add_root_ports(struct pci_dev *pdev, void *data)