Lines Matching full:msi

19 #include <linux/msi.h>
91 struct mobiveil_msi *msi = &rp->msi; in mobiveil_pcie_isr() local
98 * The core provides a single interrupt for both INTx/MSI messages. in mobiveil_pcie_isr()
99 * So we'll read both INTx and MSI status in mobiveil_pcie_isr()
138 /* read extra MSI status register */ in mobiveil_pcie_isr()
141 /* handle MSI interrupts */ in mobiveil_pcie_isr()
147 * once we pop not only the MSI data but also address in mobiveil_pcie_isr()
148 * from MSI hardware FIFO. So keeping these following in mobiveil_pcie_isr()
155 dev_dbg(dev, "MSI registers, data: %08x, addr: %08x:%08x\n", in mobiveil_pcie_isr()
158 virq = irq_find_mapping(msi->dev_domain, msi_data); in mobiveil_pcie_isr()
208 struct mobiveil_msi *msi = &pcie->rp.msi; in mobiveil_pcie_enable_msi() local
210 msi->num_of_vectors = PCI_NUM_MSI; in mobiveil_pcie_enable_msi()
211 msi->msi_pages_phys = (phys_addr_t)msg_addr; in mobiveil_pcie_enable_msi()
367 .name = "Mobiveil PCIe MSI",
387 dev_dbg(&pcie->pdev->dev, "msi#%d address_hi %#x address_lo %#x\n", in mobiveil_compose_msi_msg()
398 .name = "Mobiveil MSI",
408 struct mobiveil_msi *msi = &pcie->rp.msi; in mobiveil_irq_msi_domain_alloc() local
412 mutex_lock(&msi->lock); in mobiveil_irq_msi_domain_alloc()
414 bit = find_first_zero_bit(msi->msi_irq_in_use, msi->num_of_vectors); in mobiveil_irq_msi_domain_alloc()
415 if (bit >= msi->num_of_vectors) { in mobiveil_irq_msi_domain_alloc()
416 mutex_unlock(&msi->lock); in mobiveil_irq_msi_domain_alloc()
420 set_bit(bit, msi->msi_irq_in_use); in mobiveil_irq_msi_domain_alloc()
422 mutex_unlock(&msi->lock); in mobiveil_irq_msi_domain_alloc()
435 struct mobiveil_msi *msi = &pcie->rp.msi; in mobiveil_irq_msi_domain_free() local
437 mutex_lock(&msi->lock); in mobiveil_irq_msi_domain_free()
439 if (!test_bit(d->hwirq, msi->msi_irq_in_use)) in mobiveil_irq_msi_domain_free()
440 dev_err(&pcie->pdev->dev, "trying to free unused MSI#%lu\n", in mobiveil_irq_msi_domain_free()
443 __clear_bit(d->hwirq, msi->msi_irq_in_use); in mobiveil_irq_msi_domain_free()
445 mutex_unlock(&msi->lock); in mobiveil_irq_msi_domain_free()
456 struct mobiveil_msi *msi = &pcie->rp.msi; in mobiveil_allocate_msi_domains() local
458 mutex_init(&msi->lock); in mobiveil_allocate_msi_domains()
459 msi->dev_domain = irq_domain_add_linear(NULL, msi->num_of_vectors, in mobiveil_allocate_msi_domains()
461 if (!msi->dev_domain) { in mobiveil_allocate_msi_domains()
466 msi->msi_domain = pci_msi_create_irq_domain(fwnode, in mobiveil_allocate_msi_domains()
468 msi->dev_domain); in mobiveil_allocate_msi_domains()
469 if (!msi->msi_domain) { in mobiveil_allocate_msi_domains()
470 dev_err(dev, "failed to create MSI domain\n"); in mobiveil_allocate_msi_domains()
471 irq_domain_remove(msi->dev_domain); in mobiveil_allocate_msi_domains()
495 /* setup MSI */ in mobiveil_pcie_init_irq_domain()
507 /* map MSI config resource */ in mobiveil_pcie_integrated_interrupt_init()
513 /* setup MSI hardware registers */ in mobiveil_pcie_integrated_interrupt_init()