]> www.infradead.org Git - users/dwmw2/linux.git/commit
genirq/msi: Activate Multi-MSI early when MSI_FLAG_ACTIVATE_EARLY is set
authorMarc Zyngier <maz@kernel.org>
Sat, 23 Jan 2021 12:27:59 +0000 (12:27 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Feb 2021 08:21:07 +0000 (09:21 +0100)
commit2bc9ccf2cdfdbd1e2bcab4114d44a09b61d59a7a
tree40c46e81945756e52e6049b847c9468934aea0ce
parente0d7f2f9d11c441f060da4d7509f42a8ce6bf5bc
genirq/msi: Activate Multi-MSI early when MSI_FLAG_ACTIVATE_EARLY is set

commit 4c457e8cb75eda91906a4f89fc39bde3f9a43922 upstream.

When MSI_FLAG_ACTIVATE_EARLY is set (which is the case for PCI),
__msi_domain_alloc_irqs() performs the activation of the interrupt (which
in the case of PCI results in the endpoint being programmed) as soon as the
interrupt is allocated.

But it appears that this is only done for the first vector, introducing an
inconsistent behaviour for PCI Multi-MSI.

Fix it by iterating over the number of vectors allocated to each MSI
descriptor. This is easily achieved by introducing a new
"for_each_msi_vector" iterator, together with a tiny bit of refactoring.

Fixes: f3b0946d629c ("genirq/msi: Make sure PCI MSIs are activated early")
Reported-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20210123122759.1781359-1-maz@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/msi.h
kernel/irq/msi.c