]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
PCI/MSI: Prevent recursive locking in pci_msix_write_tph_tag()
authorHimanshu Madhani <himanshu.madhani@oracle.com>
Tue, 8 Jul 2025 22:25:30 +0000 (22:25 +0000)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 10 Jul 2025 21:41:08 +0000 (23:41 +0200)
commit68ea85df15d111d82fc474cbe104174791169355
tree37debc5017299a084aed7409a9e26e0cfed47476
parentd7b8f8e20813f0179d8ef519541a3527e7661d3a
PCI/MSI: Prevent recursive locking in pci_msix_write_tph_tag()

pci_msix_write_tph_tag() takes the per device MSI descriptor mutex and then
invokes msi_domain_get_virq(), which takes the same mutex again. That
obviously results in a system hang which is exposed by a softlockup or
lockdep warning.

Move the lock guard after the invocation of msi_domain_get_virq() to fix
this.

[ tglx: Massage changelog by adding a proper explanation and removing the
   not really useful stacktrace ]

Fixes: d5124a9957b2 ("PCI/MSI: Provide a sane mechanism for TPH")
Reported-by: Jorge Lopez <jorge.jo.lopez@oracle.com>
Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Jorge Lopez <jorge.jo.lopez@oracle.com>
Link: https://lore.kernel.org/all/20250708222530.1041477-1-himanshu.madhani@oracle.com
drivers/pci/msi/msi.c