linux_dsm_epyc7002/drivers/pci
Alexander Gordeev 65f6ae66a6 PCI: Allocate only as many MSI vectors as requested by driver
Because of the encoding of the "Multiple Message Capable" and "Multiple
Message Enable" fields, a device can only advertise that it's capable of a
power-of-two number of vectors, and the OS can only enable a power-of-two
number.

For example, a device that's limited internally to using 18 vectors would
have to advertise that it's capable of 32.  The 14 extra vectors consume
vector numbers and IRQ descriptors even though the device can't actually
use them.

This fix introduces a 'msi_desc::nvec_used' field to address this issue.
When non-zero, it is the actual number of MSIs the device will send, as
requested by the device driver.  This value should be used by architectures
to set up and tear down only as many interrupt resources as the device will
actually use.

Note, although the existing 'msi_desc::multiple' field might seem
redundant, in fact it is not.  The number of MSIs advertised need not be
the smallest power-of-two larger than the number of MSIs the device will
send.  Thus, it is not always possible to derive the former from the
latter, so we need to keep them both to handle this case.

[bhelgaas: changelog, rename to "nvec_used"]
Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2013-05-28 11:31:16 -06:00
..
hotplug PCI changes for the v3.10 merge window: 2013-04-29 09:30:25 -07:00
pcie PCI changes for the v3.10 merge window: 2013-04-29 09:30:25 -07:00
access.c
ats.c
bus.c PCI: Delay final fixups until resources are assigned 2013-05-07 14:35:44 -06:00
host-bridge.c
hotplug-pci.c
htirq.c
ioapic.c
iov.c pci: Add SRIOV helper function to determine if VFs are assigned to guest 2013-04-24 19:31:58 -07:00
irq.c
Kconfig
Makefile
msi.c PCI: Allocate only as many MSI vectors as requested by driver 2013-05-28 11:31:16 -06:00
of.c
pci-acpi.c PCI changes for the v3.10 merge window: 2013-04-29 09:30:25 -07:00
pci-driver.c
pci-label.c
pci-stub.c
pci-sysfs.c
pci.c Merge branch 'pci/rafael-pm' into next 2013-04-17 10:43:16 -06:00
pci.h PCI: Remove "extern" from function declarations 2013-04-17 10:21:17 -06:00
probe.c PCI updates for v3.10: 2013-05-09 10:21:44 -07:00
proc.c proc: Supply a function to remove a proc entry by PDE 2013-05-01 17:29:46 -04:00
quirks.c PCI: Clean up quirk_io_region 2013-04-15 14:30:44 -06:00
remove.c
rom.c
search.c
setup-bus.c PCI: Warn about failures instead of "must_check" functions 2013-04-17 10:21:12 -06:00
setup-irq.c
setup-res.c
slot.c PCI: Warn about failures instead of "must_check" functions 2013-04-17 10:21:12 -06:00
syscall.c
vpd.c
xen-pcifront.c