summaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2020-08-26 14:16:46 +0300
committerThomas Gleixner <tglx@linutronix.de>2020-09-16 17:52:35 +0300
commit3b9c1d377d67072d1d8a2373b4969103cca00dab (patch)
treebf9aa6dbe439906e75149bc7ccf30938a6771fc2 /arch/x86
parentdfb9eb7cf6cd0c0b0f2a1111fcc47b0a297b097d (diff)
downloadlinux-3b9c1d377d67072d1d8a2373b4969103cca00dab.tar.xz
x86/msi: Consolidate MSI allocation
Convert the interrupt remap drivers to retrieve the pci device from the msi descriptor and use info::hwirq. This is the first step to prepare x86 for using the generic MSI domain ops. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Wei Liu <wei.liu@kernel.org> Acked-by: Joerg Roedel <jroedel@suse.de> Link: https://lore.kernel.org/r/20200826112332.466405395@linutronix.de
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/include/asm/hw_irq.h8
-rw-r--r--arch/x86/kernel/apic/msi.c7
2 files changed, 3 insertions, 12 deletions
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
index dd0b479ad980..a4aeeaace040 100644
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
@@ -86,14 +86,6 @@ struct irq_alloc_info {
union {
struct ioapic_alloc_info ioapic;
struct uv_alloc_info uv;
-
- int unused;
-#ifdef CONFIG_PCI_MSI
- struct {
- struct pci_dev *msi_dev;
- irq_hw_number_t msi_hwirq;
- };
-#endif
};
};
diff --git a/arch/x86/kernel/apic/msi.c b/arch/x86/kernel/apic/msi.c
index 6d7655b07f84..6b490d9a2537 100644
--- a/arch/x86/kernel/apic/msi.c
+++ b/arch/x86/kernel/apic/msi.c
@@ -188,7 +188,6 @@ int native_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
init_irq_alloc_info(&info, NULL);
info.type = X86_IRQ_ALLOC_TYPE_PCI_MSI;
- info.msi_dev = dev;
domain = irq_remapping_get_irq_domain(&info);
if (domain == NULL)
@@ -207,7 +206,7 @@ void native_teardown_msi_irq(unsigned int irq)
static irq_hw_number_t pci_msi_get_hwirq(struct msi_domain_info *info,
msi_alloc_info_t *arg)
{
- return arg->msi_hwirq;
+ return arg->hwirq;
}
int pci_msi_prepare(struct irq_domain *domain, struct device *dev, int nvec,
@@ -217,7 +216,6 @@ int pci_msi_prepare(struct irq_domain *domain, struct device *dev, int nvec,
struct msi_desc *desc = first_pci_msi_entry(pdev);
init_irq_alloc_info(arg, NULL);
- arg->msi_dev = pdev;
if (desc->msi_attrib.is_msix) {
arg->type = X86_IRQ_ALLOC_TYPE_PCI_MSIX;
} else {
@@ -231,7 +229,8 @@ EXPORT_SYMBOL_GPL(pci_msi_prepare);
void pci_msi_set_desc(msi_alloc_info_t *arg, struct msi_desc *desc)
{
- arg->msi_hwirq = pci_msi_domain_calc_hwirq(desc);
+ arg->desc = desc;
+ arg->hwirq = pci_msi_domain_calc_hwirq(desc);
}
EXPORT_SYMBOL_GPL(pci_msi_set_desc);