MSI Capability Register 的内容由系统软件填充,在 Linux 中通过在 PCI 驱动中调用 pci_enable_msi 函数对 MSI Capability Register 的 MSI Message Address 和 MSI Message Data Register 进行设置,具体流程如上图. __irq_domain_alloc_irqs 函数分配了 MSI 所使用的 Vector,__irq_msi_compose_msg 函数构建了 ...
[ msi_domain_alloc_irqs ] 中循环每一个中断号,最终调用 __pci_write_msi_msg int msi_domain_alloc_irqs(struct irq_domain *domain, struct device *dev, int nvec) { int i, ret, virq; for_each_msi_entry(desc, dev) { virq = desc->irq;// 中断号 irq_data = irq_domain_get_irq_...
// irq_chip对应的是pci_msi_create_irq_domain中关联的its_msi_irq_chip +-> data->chip->irq_write_msi_msg(data, msg);+-> pci_msi_domain_write_msg() 从这个流程可以看出,MSI是通过irq_write_msi_msg往一个地址发一个消息来激活一个中断。 4. 设备怎么使用MSI/MSI-x中断? 传统中断在系统初始...
EXPORT_SYMBOL_GPL(cdx_msi_domain_alloc_irqs); int cdx_enable_msi(struct cdx_device *cdx_dev) { struct cdx_controller *cdx = cdx_dev->cdx; struct cdx_device_config dev_config; int ret; dev_config.type = CDX_DEV_MSI_ENABLE; dev_config.msi_enable = true; ret = cdx->ops->dev_conf...
* msi_create_irq_domain() and related interfaces * * @msi_check, @msi_prepare, @msi_finish, @set_desc and @handle_error * are callbacks used by msi_domain_alloc_irqs() and related * interfaces which are based on msi_desc. * * @domain_alloc_irqs, @domain_free_irqs can be...
Here is my source for the function call:num_vectors = pci_alloc_irq_vectors(pci_dev, 1, msi_config->total_vectors, PCI_IRQ_MSI | PCI_IRQ_MSIX); And here is my .config file, at the IRQ subsystem: ## IRQ subsystem#CONFIG_GENERIC_IRQ_PROBE=yCONFIG_GENERIC_IRQ_SHOW=yCONFIG_GENERIC_...
nr_irqs_gsi: 24Allocating PCI resources starting at d0000000 (gap: d0000000:28000000)setup_percpu: NR_CPUS:8 nr_cpumask_bits:8 nr_cpu_ids:8 nr_node_ids:1PERCPU: Embedded 25 pages/cpu @ffff880028200000 s73304 r8192 d20904u262144pcpu-alloc: s73304 r8192 d20904 u262144 alloc=1*...
2136 2136 struct mlx5dv_dr_domain *dmn); 2137 2137 2138 + struct mlx5dv_devx_msi_vector { 2139 + int vector; 2140 + int fd; 2141 + }; 2142 + 2143 + struct mlx5dv_devx_msi_vector * 2144 + mlx5dv_devx_alloc_msi_vector(struct ibv_context *ibctx); 2145 + ...
__irq_msi_compose_msg 函数可以很详细的看出 MSI Message Address 和 Message Data 的构造过程,可以看出 MSI 中断是边缘触发,vector 则是 __irq_domain_alloc_irqs 函数获得的. __pci_write_msi_msg 函数描述了内核将 MSI Message Address/Data 数据写入到 PCI 设备的配置空间的技术细节,对应 MSI 中断使用的...
irqdomain.h irqdomain_defs.h irqflags.h irqflags_types.h irqhandler.h irqnr.h irqreturn.h isa-dma.h isa.h isapnp.h iscsi_boot_sysfs.h iscsi_ibft.h ism.h iversion.h jbd2.h jhash.h jiffies.h journal-head.h joystick.h jump_label.h jump_label_ratelimit.h jz4740-adc...