aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu/irq_remapping.c
diff options
context:
space:
mode:
authorJoerg Roedel <joro@8bytes.org>2012-09-26 06:44:49 -0400
committerJoerg Roedel <joro@8bytes.org>2013-01-28 06:42:48 -0500
commit7601384f91be1a5ea60cb4ef6e28cad628e6cd1e (patch)
treec5dd95d5edb2d89aad2f7df7f70f6897c44beec8 /drivers/iommu/irq_remapping.c
parent2976fd8417f5744de3bb9109e4f30f353a36b1c0 (diff)
x86, msi: Introduce x86_msi.compose_msi_msg call-back
This call-back points to the right function for initializing the msi_msg structure. The old code for msi_msg generation was split up into the irq-remapped and the default case. The irq-remapped case just calls into the specific Intel or AMD implementation when the device is behind an IOMMU. Otherwise the default function is called. Signed-off-by: Joerg Roedel <joro@8bytes.org> Acked-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/iommu/irq_remapping.c')
-rw-r--r--drivers/iommu/irq_remapping.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c
index 339260c98cf9..158091b345cb 100644
--- a/drivers/iommu/irq_remapping.c
+++ b/drivers/iommu/irq_remapping.c
@@ -150,6 +150,7 @@ static void __init irq_remapping_modify_x86_ops(void)
150 x86_io_apic_ops.setup_entry = setup_ioapic_remapped_entry; 150 x86_io_apic_ops.setup_entry = setup_ioapic_remapped_entry;
151 x86_msi.setup_msi_irqs = irq_remapping_setup_msi_irqs; 151 x86_msi.setup_msi_irqs = irq_remapping_setup_msi_irqs;
152 x86_msi.setup_hpet_msi = setup_hpet_msi_remapped; 152 x86_msi.setup_hpet_msi = setup_hpet_msi_remapped;
153 x86_msi.compose_msi_msg = compose_remapped_msi_msg;
153} 154}
154 155
155static __init int setup_nointremap(char *str) 156static __init int setup_nointremap(char *str)
@@ -295,10 +296,12 @@ void compose_remapped_msi_msg(struct pci_dev *pdev,
295 unsigned int irq, unsigned int dest, 296 unsigned int irq, unsigned int dest,
296 struct msi_msg *msg, u8 hpet_id) 297 struct msi_msg *msg, u8 hpet_id)
297{ 298{
298 if (!remap_ops || !remap_ops->compose_msi_msg) 299 struct irq_cfg *cfg = irq_get_chip_data(irq);
299 return;
300 300
301 remap_ops->compose_msi_msg(pdev, irq, dest, msg, hpet_id); 301 if (!irq_remapped(cfg))
302 native_compose_msi_msg(pdev, irq, dest, msg, hpet_id);
303 else if (remap_ops && remap_ops->compose_msi_msg)
304 remap_ops->compose_msi_msg(pdev, irq, dest, msg, hpet_id);
302} 305}
303 306
304static int msi_alloc_remapped_irq(struct pci_dev *pdev, int irq, int nvec) 307static int msi_alloc_remapped_irq(struct pci_dev *pdev, int irq, int nvec)