@@ -93,7 +93,7 @@ struct pci_controller {
void *iommu;
int segment;
int node; /* nearest node with memory or NUMA_NO_NODE for global allocation */
-
+ struct msi_controller *msi_ctrl;
void *platform_data;
};
@@ -101,6 +101,7 @@ struct pci_controller {
#define PCI_CONTROLLER(busdev) ((struct pci_controller *) busdev->sysdata)
#define pci_domain_nr(busdev) (PCI_CONTROLLER(busdev)->segment)
+extern struct msi_controller ia64_msi_ctrl;
extern struct pci_ops pci_root_ops;
static inline int pci_proc_domain(struct pci_bus *bus)
@@ -42,7 +42,7 @@ static int ia64_set_msi_irq_affinity(struct irq_data *idata,
}
#endif /* CONFIG_SMP */
-int ia64_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
+int __ia64_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
{
struct msi_msg msg;
unsigned long dest_phys_id;
@@ -77,7 +77,7 @@ int ia64_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
return 0;
}
-void ia64_teardown_msi_irq(unsigned int irq)
+void __ia64_teardown_msi_irq(unsigned int irq)
{
destroy_irq(irq);
}
@@ -111,23 +111,35 @@ static struct irq_chip ia64_msi_chip = {
.irq_retrigger = ia64_msi_retrigger_irq,
};
+struct msi_controller *pcibios_msi_controller(struct pci_bus *bus)
+{
+ struct pci_controller *ctrl = bus->sysdata;
+
+ return ctrl->msi_ctrl;
+}
-int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
+static int ia64_setup_msi_irq(struct msi_controller *ctrl,
+ struct pci_dev *pdev, struct msi_desc *desc)
{
if (platform_setup_msi_irq)
return platform_setup_msi_irq(pdev, desc);
- return ia64_setup_msi_irq(pdev, desc);
+ return __ia64_setup_msi_irq(pdev, desc);
}
-void arch_teardown_msi_irq(unsigned int irq)
+static void ia64_teardown_msi_irq(struct msi_controller *ctrl, unsigned int irq)
{
if (platform_teardown_msi_irq)
return platform_teardown_msi_irq(irq);
- return ia64_teardown_msi_irq(irq);
+ return __ia64_teardown_msi_irq(irq);
}
+struct msi_controller ia64_msi_ctrl = {
+ .setup_irq = ia64_setup_msi_irq,
+ .teardown_irq = ia64_teardown_msi_irq,
+};
+
#ifdef CONFIG_INTEL_IOMMU
#ifdef CONFIG_SMP
static int dmar_msi_set_affinity(struct irq_data *data,
@@ -437,6 +437,7 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
controller->companion = device;
controller->node = acpi_get_node(device->handle);
+ controller->msi_ctrl = &ia64_msi_ctrl;
info = kzalloc(sizeof(*info), GFP_KERNEL);
if (!info) {
Use MSI controller framework instead of arch MSI functions to configure MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework. Signed-off-by: Yijing Wang <wangyijing@huawei.com> --- arch/ia64/include/asm/pci.h | 3 ++- arch/ia64/kernel/msi_ia64.c | 24 ++++++++++++++++++------ arch/ia64/pci/pci.c | 1 + 3 files changed, 21 insertions(+), 7 deletions(-)