android_kernel_xiaomi_sm8350/arch/powerpc/platforms/pseries
Michael Ellerman 448e2ca0e3 powerpc/pseries: Implement a quota system for MSIs
There are hardware limitations on the number of available MSIs,
which firmware expresses using a property named "ibm,pe-total-#msi".
This property tells us how many MSIs are available for devices below
the point in the PCI tree where we find the property.

For old firmwares which don't have the property, we assume there are
8 MSIs available per "partitionable endpoint" (PE). The PE can be
found using existing EEH code, which uses the methods described in
PAPR. For our purposes we want the parent of the node that's
identified using this method.

When a driver requests n MSIs for a device, we first establish where
the "ibm,pe-total-#msi" property above that device is, or we find the
PE if the property is not found. In both cases we call this node
the "pe_dn".

We then count all non-bridge devices below the pe_dn, to establish
how many devices in total may need MSIs. The quota is then simply the
total available divided by the number of devices, if the request is
less than or equal to the quota, the request is fine and we're done.

If the request is greater than the quota, we try to determine if there
are any "spare" MSIs which we can give to this device. Spare MSIs are
found by looking for other devices which can never use their full
quota, because their "req#msi(-x)" property is less than the quota.

If we find any spare, we divide the spares by the number of devices
that could request more than their quota. This ensures the spare
MSIs are spread evenly amongst all over-quota requestors.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-02-23 15:53:03 +11:00
..
cmm.c powerpc: Add reboot notifier to Collaborative Memory Manager 2008-12-21 14:21:15 +11:00
eeh_cache.c
eeh_driver.c powerpc/eeh: Only disable/enable LSI interrupts in EEH 2009-02-11 16:00:08 +11:00
eeh_event.c
eeh_sysfs.c
eeh.c powerpc/eeh: Make EEH device add/remove more robust 2008-11-06 09:25:15 +11:00
firmware.c
hotplug-cpu.c powerpc/pseries: Fix cpu hotplug 2008-12-23 15:13:27 +11:00
hotplug-memory.c powerpc: Add missing sparsemem.h include 2009-02-10 14:39:09 +11:00
hvCall_inst.c
hvCall.S
hvconsole.c
hvcserver.c
iommu.c powerpc: Change u64/s64 to a long long integer type 2009-01-13 14:47:59 +11:00
Kconfig powerpc: Disable Collaborative Memory Manager for kdump 2008-12-21 14:21:15 +11:00
kexec.c
lpar.c
Makefile
msi.c powerpc/pseries: Implement a quota system for MSIs 2009-02-23 15:53:03 +11:00
nvram.c
pci_dlpar.c powerpc/pseries: Remove write only variable in PCI DLPAR 2009-02-11 13:37:59 +11:00
pci.c
phyp_dump.c powerpc: Printing fix for l64 to ll64 conversion: phyp_dump.c 2009-01-28 17:15:51 +11:00
plpar_wrappers.h
power.c
pseries.h
ras.c
reconfig.c powerpc: Check rc of notifier chain for memory remove 2008-09-15 11:07:52 -07:00
rtasd.c "Tree RCU": scalable classic RCU implementation 2008-12-18 21:56:04 +01:00
scanlog.c
setup.c Remove asm/a.out.h files for all architectures without a.out support. 2008-09-06 19:30:24 +01:00
smp.c powerpc: Use cpu_thread_in_core in smp_init for of_spin_map 2008-10-21 15:19:12 +11:00
xics.c Merge branch 'cpus4096-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-01-02 11:44:09 -08:00
xics.h powerpc/xics: Consolidate ipi message encode and decode 2008-10-13 16:24:16 +11:00