Lines Matching full:msi

19 #include <linux/msi.h>
88 struct mobiveil_msi *msi = &rp->msi; in mobiveil_pcie_isr() local
95 * The core provides a single interrupt for both INTx/MSI messages. in mobiveil_pcie_isr()
96 * So we'll read both INTx and MSI status in mobiveil_pcie_isr()
134 /* read extra MSI status register */ in mobiveil_pcie_isr()
137 /* handle MSI interrupts */ in mobiveil_pcie_isr()
143 * once we pop not only the MSI data but also address in mobiveil_pcie_isr()
144 * from MSI hardware FIFO. So keeping these following in mobiveil_pcie_isr()
151 dev_dbg(dev, "MSI registers, data: %08x, addr: %08x:%08x\n", in mobiveil_pcie_isr()
154 generic_handle_domain_irq(msi->dev_domain, msi_data); in mobiveil_pcie_isr()
202 struct mobiveil_msi *msi = &pcie->rp.msi; in mobiveil_pcie_enable_msi() local
204 msi->num_of_vectors = PCI_NUM_MSI; in mobiveil_pcie_enable_msi()
205 msi->msi_pages_phys = (phys_addr_t)msg_addr; in mobiveil_pcie_enable_msi()
357 .name = "Mobiveil PCIe MSI",
377 dev_dbg(&pcie->pdev->dev, "msi#%d address_hi %#x address_lo %#x\n", in mobiveil_compose_msi_msg()
382 .name = "Mobiveil MSI",
391 struct mobiveil_msi *msi = &pcie->rp.msi; in mobiveil_irq_msi_domain_alloc() local
395 mutex_lock(&msi->lock); in mobiveil_irq_msi_domain_alloc()
397 bit = find_first_zero_bit(msi->msi_irq_in_use, msi->num_of_vectors); in mobiveil_irq_msi_domain_alloc()
398 if (bit >= msi->num_of_vectors) { in mobiveil_irq_msi_domain_alloc()
399 mutex_unlock(&msi->lock); in mobiveil_irq_msi_domain_alloc()
403 set_bit(bit, msi->msi_irq_in_use); in mobiveil_irq_msi_domain_alloc()
405 mutex_unlock(&msi->lock); in mobiveil_irq_msi_domain_alloc()
418 struct mobiveil_msi *msi = &pcie->rp.msi; in mobiveil_irq_msi_domain_free() local
420 mutex_lock(&msi->lock); in mobiveil_irq_msi_domain_free()
422 if (!test_bit(d->hwirq, msi->msi_irq_in_use)) in mobiveil_irq_msi_domain_free()
423 dev_err(&pcie->pdev->dev, "trying to free unused MSI#%lu\n", in mobiveil_irq_msi_domain_free()
426 __clear_bit(d->hwirq, msi->msi_irq_in_use); in mobiveil_irq_msi_domain_free()
428 mutex_unlock(&msi->lock); in mobiveil_irq_msi_domain_free()
439 struct mobiveil_msi *msi = &pcie->rp.msi; in mobiveil_allocate_msi_domains() local
441 mutex_init(&msi->lock); in mobiveil_allocate_msi_domains()
442 msi->dev_domain = irq_domain_add_linear(NULL, msi->num_of_vectors, in mobiveil_allocate_msi_domains()
444 if (!msi->dev_domain) { in mobiveil_allocate_msi_domains()
449 msi->msi_domain = pci_msi_create_irq_domain(fwnode, in mobiveil_allocate_msi_domains()
451 msi->dev_domain); in mobiveil_allocate_msi_domains()
452 if (!msi->msi_domain) { in mobiveil_allocate_msi_domains()
453 dev_err(dev, "failed to create MSI domain\n"); in mobiveil_allocate_msi_domains()
454 irq_domain_remove(msi->dev_domain); in mobiveil_allocate_msi_domains()
478 /* setup MSI */ in mobiveil_pcie_init_irq_domain()
490 /* map MSI config resource */ in mobiveil_pcie_integrated_interrupt_init()
496 /* setup MSI hardware registers */ in mobiveil_pcie_integrated_interrupt_init()