summaryrefslogtreecommitdiffstats
path: root/drivers/pci/bus.c
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2009-02-11 22:27:02 +1100
committerJesse Barnes <jbarnes@hobbes.lan>2009-03-19 19:29:34 -0700
commitb5fbf53324f65646154e172af350674d5a2a1629 (patch)
tree6310f1629c3112e240b151862b7f0b357045649e /drivers/pci/bus.c
parent35e1801ea637810830e653ffe7ff62c7048ae03a (diff)
PCI/MSI: Allow arch code to return the number of MSI-X available
There is code in msix_capability_init() which, when the requested number of MSI-X couldn't be allocated, calculates how many MSI-X /could/ be allocated and returns that to the driver. That allows the driver to then make a second request, with a number of MSIs that should succeed. The current code requires the arch code to setup as many msi_descs as it can, and then return to the generic code. On some platforms the arch code may already know how many MSI-X it can allocate, before it sets up any of the msi_descs. So change the logic such that if the arch code returns a positive error code, that is taken to be the number of MSI-X that could be allocated. If the error code is negative we still calculate the number available using the old method. Because it's a little subtle, make sure the error return code from arch_setup_msi_irq() is always negative. That way only implementations of arch_setup_msi_irqs() need to be careful about returning a positive error code. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/bus.c')
0 files changed, 0 insertions, 0 deletions