linux-brain/kernel/irq
Dexuan Cui 4a3d966299 irqdomain: Add the missing assignment of domain->fwnode for named fwnode
[ Upstream commit 711419e504 ]

Recently device pass-through stops working for Linux VM running on Hyper-V.

git-bisect shows the regression is caused by the recent commit
467a3bb974 ("PCI: hv: Allocate a named fwnode ..."), but the root cause
is that the commit d59f6617ee forgets to set the domain->fwnode for
IRQCHIP_FWNODE_NAMED*, and as a result:

1. The domain->fwnode remains to be NULL.

2. irq_find_matching_fwspec() returns NULL since "h->fwnode == fwnode" is
false, and pci_set_bus_msi_domain() sets the Hyper-V PCI root bus's
msi_domain to NULL.

3. When the device is added onto the root bus, the device's dev->msi_domain
is set to NULL in pci_set_msi_domain().

4. When a device driver tries to enable MSI-X, pci_msi_setup_msi_irqs()
calls arch_setup_msi_irqs(), which uses the native MSI chip (i.e.
arch/x86/kernel/apic/msi.c: pci_msi_controller) to set up the irqs, but
actually pci_msi_setup_msi_irqs() is supposed to call
msi_domain_alloc_irqs() with the hbus->irq_domain, which is created in
hv_pcie_init_irq_domain() and is associated with the Hyper-V chip
hv_msi_irq_chip. Consequently, the irq line is not properly set up, and
the device driver can not receive any interrupt.

Fixes: d59f6617ee ("genirq: Allow fwnode to carry name information only")
Fixes: 467a3bb974 ("PCI: hv: Allocate a named fwnode instead of an address-based one")
Reported-by: Lili Deng <v-lide@microsoft.com>
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/PU1P153MB01694D9AF625AC335C600C5FBFBE0@PU1P153MB0169.APCP153.PROD.OUTLOOK.COM
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-27 14:46:45 +01:00
..
Kconfig genirq: Add handle_fasteoi_{level,edge}_irq flow handlers 2017-08-18 11:21:41 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
affinity.c genirq/affinity: Don't return with empty affinity masks on error 2019-01-13 10:01:02 +01:00
autoprobe.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
chip.c genirq: Respect IRQCHIP_SKIP_SET_WAKE in irq_chip_set_wake_parent() 2019-04-17 08:37:53 +02:00
cpuhotplug.c genirq/cpuhotplug: Add sanity check for effective affinity mask 2017-10-09 13:26:48 +02:00
debug.h genirq: Guard handle_bad_irq log messages 2018-03-03 10:24:31 +01:00
debugfs.c genirq/debugfs: Triggering of interrupts from userspace 2017-08-18 10:36:24 +02:00
devres.c irq/generic-chip: Provide devm_irq_setup_generic_chip() 2017-06-21 15:53:11 +02:00
dummychip.c Merge branch 'linus' into irq/core 2015-06-05 22:25:01 +02:00
generic-chip.c genirq: generic chip: remove irq_gc_mask_disable_reg_and_ack() 2017-10-13 16:31:05 +01:00
handle.c There has been a fair amount of activity in the docs tree this time 2017-07-03 21:13:25 -07:00
internals.h genirq: Avoid summation loops for /proc/stat 2019-04-05 22:31:35 +02:00
ipi.c genirq/ipi: Fixup checks against nr_cpu_ids 2017-08-20 10:49:05 +02:00
irq_sim.c genirq/irq_sim: Add a devres variant of irq_sim_init() 2017-08-16 16:40:02 +02:00
irqdesc.c genirq: Properly pair kobject_del() with kobject_add() 2019-08-29 08:26:44 +02:00
irqdomain.c irqdomain: Add the missing assignment of domain->fwnode for named fwnode 2020-01-27 14:46:45 +01:00
manage.c genirq: Prevent use-after-free and work list corruption 2019-05-10 17:53:13 +02:00
migration.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
msi.c genirq/msi: Fix populating multiple interrupts 2017-09-06 11:41:20 +02:00
pm.c genirq/PM: Properly pretend disabled state when force resuming interrupts 2017-07-17 22:32:20 +02:00
proc.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
resend.c genirq: Prevent NULL pointer dereference in resend_irqs() 2019-09-19 09:08:04 +02:00
settings.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
spurious.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
timings.c genirq/timings: Add infrastructure for estimating the next interrupt arrival time 2017-06-24 11:44:39 +02:00