PCI/sysfs: Explicitly show first MSI IRQ for 'irq'
authorBarry Song <song.bao.hua@hisilicon.com>
Wed, 25 Aug 2021 10:26:35 +0000 (18:26 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 18 Oct 2021 21:43:04 +0000 (16:43 -0500)
commitac8e3cef588c5affc6dfa7b693ec64bbf3cead6a
tree8b9d253df4a93854c420ebf903aaf2f9f53620b0
parent5e3be666f46b43169e80041657c4b63eaf1ae8de
PCI/sysfs: Explicitly show first MSI IRQ for 'irq'

The sysfs "irq" file contains the legacy INTx IRQ.  Or, if the device has
MSI enabled, it contains the first MSI IRQ instead.

Previously this file showed the pci_dev.irq value directly.  But we'd
prefer to use pci_dev.irq only for the INTx IRQ and decouple that from any
MSI or MSI-X IRQs.

If the device has MSI enabled, explicitly look up and show the first MSI
IRQ in the sysfs "irq" file.  Otherwise, show the INTx IRQ.

This removes the requirement that msi_capability_init() set pci_dev.irq to
the first MSI IRQ when enabling MSI and pci_msi_shutdown() restore the INTx
IRQ when disabling MSI.

[bhelgaas: commit log]
Link: https://lore.kernel.org/r/20210825102636.52757-3-21cnbao@gmail.com
Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pci-sysfs.c