Skip to content

Commit 9a958e1

Browse files
nxpfrankliKAGA-KOKO
authored andcommitted
platform-msi: Add msi_remove_device_irq_domain() in platform_device_msi_free_irqs_all()
platform_device_msi_init_and_alloc_irqs() performs two tasks: allocating the MSI domain for a platform device, and allocate a number of MSIs in that domain. platform_device_msi_free_irqs_all() only frees the MSIs, and leaves the MSI domain alive. Given that platform_device_msi_init_and_alloc_irqs() is the sole tool a platform device has to allocate platform MSIs, it makes sense for platform_device_msi_free_irqs_all() to teardown the MSI domain at the same time as the MSIs. This avoids warnings and unexpected behaviours when a driver repeatedly allocates and frees MSIs. Signed-off-by: Frank Li <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 0af2f6b commit 9a958e1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/base/platform-msi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,6 @@ EXPORT_SYMBOL_GPL(platform_device_msi_init_and_alloc_irqs);
9595
void platform_device_msi_free_irqs_all(struct device *dev)
9696
{
9797
msi_domain_free_irqs_all(dev, MSI_DEFAULT_DOMAIN);
98+
msi_remove_device_irq_domain(dev, MSI_DEFAULT_DOMAIN);
9899
}
99100
EXPORT_SYMBOL_GPL(platform_device_msi_free_irqs_all);

0 commit comments

Comments
 (0)