mirror-linux/drivers/pci/msi
Himanshu Madhani 68ea85df15 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: d5124a9957 ("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
2025-07-10 23:41:08 +02:00
..
Makefile PCI/MSI: Move pci_disable_msi() to api.c 2022-11-17 15:15:20 +01:00
api.c PCI/MSI: Use bool for MSI enable state tracking 2025-05-21 21:28:53 +02:00
irqdomain.c PCI/MSI: Size device MSI domain with the maximum number of vectors 2025-06-04 11:19:25 +02:00
legacy.c PCI/MSI: Prevent UAF in error path 2022-01-21 02:14:46 +01:00
msi.c PCI/MSI: Prevent recursive locking in pci_msix_write_tph_tag() 2025-07-10 23:41:08 +02:00
msi.h PCI/MSI: Size device MSI domain with the maximum number of vectors 2025-06-04 11:19:25 +02:00
pcidev_msi.c