aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/xen/platform-pci.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw@amazon.co.uk>2023-01-18 12:22:38 +0000
committerJuergen Gross <jgross@suse.com>2023-02-13 06:53:20 +0100
commit3e8cd711c3da6c3d724076048038cd666bdbb2b5 (patch)
tree2385785636ed13b98e818f64874b996ecead55a8 /drivers/xen/platform-pci.c
parentx86/xen/time: prefer tsc as clocksource when it is invariant (diff)
downloadwireguard-linux-3e8cd711c3da6c3d724076048038cd666bdbb2b5.tar.xz
wireguard-linux-3e8cd711c3da6c3d724076048038cd666bdbb2b5.zip
xen: Allow platform PCI interrupt to be shared
When we don't use the per-CPU vector callback, we ask Xen to deliver event channel interrupts as INTx on the PCI platform device. As such, it can be shared with INTx on other PCI devices. Set IRQF_SHARED, and make it return IRQ_HANDLED or IRQ_NONE according to whether the evtchn_upcall_pending flag was actually set. Now I can share the interrupt: 11: 82 0 IO-APIC 11-fasteoi xen-platform-pci, ens4 Drop the IRQF_TRIGGER_RISING. It has no effect when the IRQ is shared, and besides, the only effect it was having even beforehand was to trigger a debug message in both I/OAPIC and legacy PIC cases: [ 0.915441] genirq: No set_type function for IRQ 11 (IO-APIC) [ 0.951939] genirq: No set_type function for IRQ 11 (XT-PIC) Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Reviewed-by: Juergen Gross <jgross@suse.com> Link: https://lore.kernel.org/r/f9a29a68d05668a3636dd09acd94d970269eaec6.camel@infradead.org Signed-off-by: Juergen Gross <jgross@suse.com>
Diffstat (limited to 'drivers/xen/platform-pci.c')
-rw-r--r--drivers/xen/platform-pci.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c
index cd07e3fed0fa..fcc819131572 100644
--- a/drivers/xen/platform-pci.c
+++ b/drivers/xen/platform-pci.c
@@ -64,14 +64,13 @@ static uint64_t get_callback_via(struct pci_dev *pdev)
static irqreturn_t do_hvm_evtchn_intr(int irq, void *dev_id)
{
- xen_hvm_evtchn_do_upcall();
- return IRQ_HANDLED;
+ return xen_hvm_evtchn_do_upcall();
}
static int xen_allocate_irq(struct pci_dev *pdev)
{
return request_irq(pdev->irq, do_hvm_evtchn_intr,
- IRQF_NOBALANCING | IRQF_TRIGGER_RISING,
+ IRQF_NOBALANCING | IRQF_SHARED,
"xen-platform-pci", pdev);
}