]> git.baikalelectronics.ru Git - kernel.git/commit
PCI/MSI: Set pci_dev::msi[x]_enabled early
authorThomas Gleixner <tglx@linutronix.de>
Fri, 10 Dec 2021 22:18:44 +0000 (23:18 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 16 Dec 2021 21:16:37 +0000 (22:16 +0100)
commita102ead78daff33d1cac7eeff3b8f98efa2ba1c3
tree28875c97c098bc901ba9dbb75031a7338d4c4b51
parent8cdf264cbdb58c1adad19cf2fd297150be7acf9b
PCI/MSI: Set pci_dev::msi[x]_enabled early

There are quite some places which retrieve the first MSI descriptor to
evaluate whether the setup is for MSI or MSI-X. That's required because
pci_dev::msi[x]_enabled is only set when the setup completed successfully.

There is no real reason why msi[x]_enabled can't be set at the beginning of
the setup sequence and cleared in case of a failure.

Implement that so the MSI descriptor evaluations can be converted to simple
property queries.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Michael Kelley <mikelley@microsoft.com>
Tested-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20211210221813.250049810@linutronix.de
drivers/pci/msi/msi.c