PCI: plda: Switch to msi_create_parent_irq_domain()
Switch to msi_create_parent_irq_domain() from pci_msi_create_irq_domain() which was using legacy MSI domain setup. Signed-off-by: Nam Cao <namcao@linutronix.de> [mani: reworded commit message] Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> [bhelgaas: rebase on dev_fwnode() conversion, drop fwnode local var] Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Link: https://patch.msgid.link/1279fe6500a1d8135d8f5feb2f055df008746c88.1750858083.git.namcao@linutronix.de
This commit is contained in:
@@ -5,6 +5,7 @@ menu "PLDA-based PCIe controllers"
|
||||
|
||||
config PCIE_PLDA_HOST
|
||||
bool
|
||||
select IRQ_MSI_LIB
|
||||
|
||||
config PCIE_MICROCHIP_HOST
|
||||
tristate "Microchip AXI PCIe controller"
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <linux/align.h>
|
||||
#include <linux/bitfield.h>
|
||||
#include <linux/irqchip/chained_irq.h>
|
||||
#include <linux/irqchip/irq-msi-lib.h>
|
||||
#include <linux/irqdomain.h>
|
||||
#include <linux/msi.h>
|
||||
#include <linux/pci_regs.h>
|
||||
@@ -134,42 +135,41 @@ static const struct irq_domain_ops msi_domain_ops = {
|
||||
.free = plda_irq_msi_domain_free,
|
||||
};
|
||||
|
||||
static struct irq_chip plda_msi_irq_chip = {
|
||||
.name = "PLDA PCIe MSI",
|
||||
.irq_ack = irq_chip_ack_parent,
|
||||
.irq_mask = pci_msi_mask_irq,
|
||||
.irq_unmask = pci_msi_unmask_irq,
|
||||
};
|
||||
#define PLDA_MSI_FLAGS_REQUIRED (MSI_FLAG_USE_DEF_DOM_OPS | \
|
||||
MSI_FLAG_USE_DEF_CHIP_OPS | \
|
||||
MSI_FLAG_NO_AFFINITY)
|
||||
#define PLDA_MSI_FLAGS_SUPPORTED (MSI_GENERIC_FLAGS_MASK | \
|
||||
MSI_FLAG_PCI_MSIX)
|
||||
|
||||
static struct msi_domain_info plda_msi_domain_info = {
|
||||
.flags = MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS |
|
||||
MSI_FLAG_NO_AFFINITY | MSI_FLAG_PCI_MSIX,
|
||||
.chip = &plda_msi_irq_chip,
|
||||
static const struct msi_parent_ops plda_msi_parent_ops = {
|
||||
.required_flags = PLDA_MSI_FLAGS_REQUIRED,
|
||||
.supported_flags = PLDA_MSI_FLAGS_SUPPORTED,
|
||||
.chip_flags = MSI_CHIP_FLAG_SET_ACK,
|
||||
.bus_select_token = DOMAIN_BUS_PCI_MSI,
|
||||
.prefix = "PLDA-",
|
||||
.init_dev_msi_info = msi_lib_init_dev_msi_info,
|
||||
};
|
||||
|
||||
static int plda_allocate_msi_domains(struct plda_pcie_rp *port)
|
||||
{
|
||||
struct device *dev = port->dev;
|
||||
struct fwnode_handle *fwnode = dev_fwnode(dev);
|
||||
struct plda_msi *msi = &port->msi;
|
||||
|
||||
mutex_init(&port->msi.lock);
|
||||
|
||||
msi->dev_domain = irq_domain_create_linear(NULL, msi->num_vectors, &msi_domain_ops, port);
|
||||
struct irq_domain_info info = {
|
||||
.fwnode = dev_fwnode(dev),
|
||||
.ops = &msi_domain_ops,
|
||||
.host_data = port,
|
||||
.size = msi->num_vectors,
|
||||
};
|
||||
|
||||
msi->dev_domain = msi_create_parent_irq_domain(&info, &plda_msi_parent_ops);
|
||||
if (!msi->dev_domain) {
|
||||
dev_err(dev, "failed to create IRQ domain\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
msi->msi_domain = pci_msi_create_irq_domain(fwnode,
|
||||
&plda_msi_domain_info,
|
||||
msi->dev_domain);
|
||||
if (!msi->msi_domain) {
|
||||
dev_err(dev, "failed to create MSI domain\n");
|
||||
irq_domain_remove(msi->dev_domain);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -563,7 +563,6 @@ static void plda_pcie_irq_domain_deinit(struct plda_pcie_rp *pcie)
|
||||
irq_set_chained_handler_and_data(pcie->msi_irq, NULL, NULL);
|
||||
irq_set_chained_handler_and_data(pcie->intx_irq, NULL, NULL);
|
||||
|
||||
irq_domain_remove(pcie->msi.msi_domain);
|
||||
irq_domain_remove(pcie->msi.dev_domain);
|
||||
|
||||
irq_domain_remove(pcie->intx_domain);
|
||||
|
||||
@@ -164,7 +164,6 @@ struct plda_pcie_host_ops {
|
||||
|
||||
struct plda_msi {
|
||||
struct mutex lock; /* Protect used bitmap */
|
||||
struct irq_domain *msi_domain;
|
||||
struct irq_domain *dev_domain;
|
||||
u32 num_vectors;
|
||||
u64 vector_phy;
|
||||
|
||||
Reference in New Issue
Block a user