android_kernel_xiaomi_sm8350/arch/powerpc/platforms
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
..
8xx
40x powerpc: Introduce ppc_pci_flags accessors 2008-12-16 15:53:16 +11:00
44x powerpc/44x: Warp patches for the new NDFC driver 2009-01-20 08:17:21 -05:00
52xx powerpc/5200: Add support for the digsy MTC board. 2009-02-04 13:39:17 -07:00
82xx arch/powerpc: Eliminate double sizeof 2009-02-06 10:44:28 -06:00
83xx powerpc/83xx: Add PCI-E support for all MPC83xx boards with PCI-E 2009-01-28 18:16:48 -06:00
85xx powerpc/85xx: Add local_irq_restore in error handling code 2008-12-30 11:35:30 -06:00
86xx powerpc/86xx: Extend GE Fanuc GPIO driver for the SBC310 2009-01-28 23:05:58 -06:00
512x powerpc/mpc5121: fix NULL test in mpc5121_clk_get utility function. 2009-01-09 15:49:04 -07:00
amigaone powerpc/amigaone: Add platform support for AmigaOne 2009-02-11 16:00:08 +11:00
cell powerpc/cell: Fix dependency in cpufreq 2009-02-23 15:53:02 +11:00
chrp powerpc: Disable mv643xx Ethernet port 0 on Pegasos 2009-02-11 16:00:08 +11:00
embedded6xx powerpc: Remove default kexec/crash_kernel ops assignments 2008-12-23 15:13:28 +11:00
iseries powerpc: Change u64/s64 to a long long integer type 2009-01-13 14:47:59 +11:00
maple powerpc: Remove default kexec/crash_kernel ops assignments 2008-12-23 15:13:28 +11:00
pasemi powerpc: Fix cpufreq drivers after cpufreq core changes 2009-01-11 21:32:01 -08:00
powermac powerpc/powermac: Fix occasional SMP boot failure 2009-01-13 14:48:03 +11:00
prep
ps3 powerpc/ps3: Move ps3_mm_add_memory to device_initcall 2009-02-13 16:37:45 +11:00
pseries powerpc/pseries: Implement a quota system for MSIs 2009-02-23 15:53:03 +11:00
fsl_uli1575.c powerpc: Fix the ide suspend function in uli1575 2009-01-07 09:18:52 -06:00
Kconfig powerpc/cell: Fix dependency in cpufreq 2009-02-23 15:53:02 +11:00
Kconfig.cputype powerpc/book-3e: Introduce concept of Book-3e MMU 2009-02-12 16:51:33 -06:00
Makefile powerpc/amigaone: Add platform support for AmigaOne 2009-02-11 16:00:08 +11:00