]> git.baikalelectronics.ru Git - kernel.git/commit
irqchip/gic-v3-its: Align PCI Multi-MSI allocation on their size
authorMarc Zyngier <marc.zyngier@arm.com>
Fri, 18 Jan 2019 14:08:59 +0000 (14:08 +0000)
committerMarc Zyngier <marc.zyngier@arm.com>
Fri, 18 Jan 2019 14:35:38 +0000 (14:35 +0000)
commit4bb6efb877b6d7b4775069588a0c24c8c8257ebf
tree3c0040c5daa79535e29bf09346b180336c620ec1
parent5606c9c11bd02f65fc08073e5a9c938680694ad5
irqchip/gic-v3-its: Align PCI Multi-MSI allocation on their size

The way we allocate events works fine in most cases, except
when multiple PCI devices share an ITS-visible DevID, and that
one of them is trying to use MultiMSI allocation.

In that case, our allocation is not guaranteed to be zero-based
anymore, and we have to make sure we allocate it on a boundary
that is compatible with the PCI Multi-MSI constraints.

Fix this by allocating the full region upfront instead of iterating
over the number of MSIs. MSI-X are always allocated one by one,
so this shouldn't change anything on that front.

Fixes: 0a9c56540c117 ("irqchip: GICv3: ITS: MSI support")
Cc: stable@vger.kernel.org
Reported-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
drivers/irqchip/irq-gic-v3-its.c