s390/pci: Allow allocation of more than 1 MSI interrupt
authorGerd Bayer <gbayer@linux.ibm.com>
Thu, 11 Jul 2024 13:45:27 +0000 (15:45 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 23 Jul 2024 13:54:58 +0000 (15:54 +0200)
commitab42fcb511fd9d241bbab7cc3ca04e34e9fc0666
tree79b06e7d3f4b228b8a65151df380f526069eb324
parent5fd11b96b43708f2f6e3964412c301c1bd20ec0f
s390/pci: Allow allocation of more than 1 MSI interrupt

On a PCI adapter that provides up to 8 MSI interrupt sources the s390
implementation of PCI interrupts rejected to accommodate them, although
the underlying hardware is able to support that.

For MSI-X it is sufficient to allocate a single irq_desc per msi_desc,
but for MSI multiple irq descriptors are attached to and controlled by
a single msi descriptor. Add the appropriate loops to maintain multiple
irq descriptors and tie/untie them to/from the appropriate AIBV bit, if
a device driver allocates more than 1 MSI interrupt.

Common PCI code passes on requests to allocate a number of interrupt
vectors based on the device drivers' demand and the PCI functions'
capabilities. However, the root-complex of s390 systems support just a
limited number of interrupt vectors per PCI function.
Produce a kernel log message to inform about any architecture-specific
capping that might be done.

With this change, we had a PCI adapter successfully raising
interrupts to its device driver via all 8 sources.

Fixes: a384c8924a8b ("s390/PCI: Fix single MSI only check")
Signed-off-by: Gerd Bayer <gbayer@linux.ibm.com>
Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/pci/pci_irq.c