genirq/msi: Ensure deactivation on teardown
authorBixuan Cui <cuibixuan@huawei.com>
Tue, 18 May 2021 03:31:17 +0000 (11:31 +0800)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 10 Aug 2021 13:55:19 +0000 (15:55 +0200)
commitdbbc93576e03fbe24b365fab0e901eb442237a8a
treebe4713c7417a084e95e0b5e63dec6d339ce6e9df
parentb9cc7d8a4656a6e815852c27ab50365009cb69c1
genirq/msi: Ensure deactivation on teardown

msi_domain_alloc_irqs() invokes irq_domain_activate_irq(), but
msi_domain_free_irqs() does not enforce deactivation before tearing down
the interrupts.

This happens when PCI/MSI interrupts are set up and never used before being
torn down again, e.g. in error handling pathes. The only place which cleans
that up is the error handling path in msi_domain_alloc_irqs().

Move the cleanup from msi_domain_alloc_irqs() into msi_domain_free_irqs()
to cure that.

Fixes: f3b0946d629c ("genirq/msi: Make sure PCI MSIs are activated early")
Signed-off-by: Bixuan Cui <cuibixuan@huawei.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20210518033117.78104-1-cuibixuan@huawei.com
kernel/irq/msi.c