# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: architecture/powerpc64/package/*/0090-spu-enum-shared-param.patch # Copyright (C) 2023 The T2 SDE Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This patch file is dual-licensed. It is available under the license the # patched project is licensed under, as long as it is an OpenSource license # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms # of the GNU General Public License version 2 as used by the T2 SDE. # --- T2-COPYRIGHT-NOTE-END --- --- a/arch/powerpc/include/asm/spu.h 2012-03-01 01:32:49.000000000 +0100 +++ b/arch/powerpc/include/asm/spu.h 2012-03-05 17:49:44.083370504 +0100 @@ -198,6 +198,8 @@ extern struct cbe_spu_info cbe_spu_info[]; +extern int spu_enum_shared(void); + void spu_init_channels(struct spu *spu); void spu_irq_setaffinity(struct spu *spu, int cpu); --- a/arch/powerpc/platforms/cell/spu_base.c 2018-12-26 17:25:07.982026754 +0100 +++ b/arch/powerpc/platforms/cell/spu_base.c 2018-12-26 17:28:29.346588750 +0100 @@ -39,6 +39,11 @@ #include #include #include +#include + +static int enum_shared = 0; +module_param(enum_shared, int, S_IRUGO); +MODULE_PARM_DESC(enum_shared, "Enumerate shared SPUs"); const struct spu_management_ops *spu_management_ops; EXPORT_SYMBOL_GPL(spu_management_ops); @@ -450,6 +455,12 @@ free_irq(spu->irqs[2], spu); } +int spu_enum_shared(void) +{ + return enum_shared; +} +EXPORT_SYMBOL_GPL(spu_enum_shared); + void spu_init_channels(struct spu *spu) { static const struct { --- a/arch/powerpc/platforms/ps3/spu.c 2012-03-01 01:32:49.000000000 +0100 +++ b/arch/powerpc/platforms/ps3/spu.c 2012-03-05 17:54:01.800664787 +0100 @@ -421,7 +421,7 @@ if (result) break; - if (resource_type == PS3_SPU_RESOURCE_TYPE_EXCLUSIVE) { + if (resource_type == PS3_SPU_RESOURCE_TYPE_EXCLUSIVE || spu_enum_shared()) { result = fn((void*)(unsigned long)resource_id); if (result)