]> git.itanic.dy.fi Git - linux-stable/commit
genirq/msi: Ensure deactivation on teardown
authorBixuan Cui <cuibixuan@huawei.com>
Tue, 18 May 2021 03:31:17 +0000 (11:31 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Aug 2021 06:59:15 +0000 (08:59 +0200)
commit355754194b483275d6a5378bfe49a6a4d73327cb
tree507133bbb4836b0d9b4daf90ab01466c37088194
parentf0736bed18fb13f7509ded58c7d9c6ab50583038
genirq/msi: Ensure deactivation on teardown

commit dbbc93576e03fbe24b365fab0e901eb442237a8a upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/irq/msi.c