Hi Steve,

Thanks for looking into this.

Regarding (a), I personally ran those experiments on the hardware and reviewed 
the results.

The purpose of the testing was to determine whether the two non-coherent core 
groups of the Mali-T628 can be used together safely, whether doing so provides 
a meaningful performance benefit, and whether any correctness issues can be 
controlled through userspace scheduling rules.

The accuracy and performance comparison was performed on the same board and 
software stack at 600 MHz under three conditions:

  Control A : job placement equivalent to upstream behaviour, using only core 
group 0 (4 cores)
  Control B : both core groups enabled, with the additional userspace filtering 
rules disabled
  Filtered  : both core groups enabled, with userspace filtering of known-risk 
jobs

Control A achieved 25.68 GFLOPS. Enabling both core groups increased throughput 
to 37.67 GFLOPS in Control B and 37.56 GFLOPS in Filtered, corresponding to 
roughly a 1.46x-1.47x speedup.

However, Control B also reproduced all three previously observed hazard classes:

  - Read-modify-write test (D8): lost updates in 10/10 runs
  - TLS spill-related test: incorrect results in 2/5 runs
  - CLBlast FP64 replay (P16): 56/56 replayed program executions produced 
mismatches
  - GPU faults: 1

With userspace filtering enabled, performance remained essentially unchanged 
while all observed correctness failures and GPU faults were reduced to zero.

Regarding (d), my measurements are consistent with your explanation that the 
hardware effectively ANDs the job affinity with the powered shader cores.

With core group 1 powered off, writing an affinity of 0x3f still resulted in 
only 0x0f of shader cores being active during execution. Performance and output 
correctness were also unchanged. Based on that result, I agree that patch 3/4 
does not provide a practical benefit by itself, and I am withdrawing 3/4.

Regarding (b), I also agree that 4/4 effectively subsumes the intent of 3/4. If 
affinity is explicitly programmed on a per-job basis, there is no need for the 
change proposed in 3/4.

For (c), the measurements suggest that support for the second core group can 
provide a substantial performance benefit, but a kernel-side opt-in alone is 
not sufficient.

Without additional scheduling rules, D8, TLS and P16 workloads can produce 
incorrect results and GPU faults. With filtering enabled, the same performance 
gain is retained while the observed failures disappear.

Therefore, my current view is that a kernel-side opt-in is only meaningful when 
accompanied by corresponding userspace rules that decide which workloads may be 
dispatched to both core groups. The userspace side is outside the scope of this 
kernel series, so I am not proposing such a policy as part of these patches.

If there is interest in supporting this configuration further, I would be happy 
to share the measurement methodology and observations behind these results.

Best Regards,
YJ

-- 
Young-Jun Hong from Hiworks



------------Original Message------------
Subject : Re: [PATCH 3/4] drm/panfrost: only put powered shader cores in the 
job affinity
Date : 2026-11-24 00:38:00
From : Steven Price <[email protected]>
To : Young-Jun Hong <[email protected]>
Cc : Boris Brezillon <[email protected]>, Rob Herring 
<[email protected]>, Adrián Larumbe <[email protected]>, Maarten 
Lankhorst <[email protected]>, Maxime Ripard 
<[email protected]>, Thomas Zimmermann <[email protected]>, David Airlie 
<[email protected]>, Simona Vetter <[email protected]>, Alexey Sheplyakov 
<[email protected]>, "Vadim V. Vlasov" <[email protected]>, 
[email protected], [email protected]
On 06/11/2026 05:41, Young-Jun Hong wrote:
> On GPUs with more than one L2 (core group), panfrost powers only the
> first core group (panfrost_get_core_mask()), but the job affinity is
> written from shader_present, i.e. it also names the cores of the second,
> unpowered group (Mali-T628 MP6 on Exynos 5422: l2_present 0x11, 4+2
> cores, affinity 0x3f while only 0x0f is powered).
> 
> Write the affinity from the same mask that was powered, so a job never
> names cores that are off.
> 
> Tested on Samsung ARTIK 10 (Exynos 5422), Mali-T628 MP6.
> 
> The analysis, the code and this changelog were produced with Claude
> Code (Anthropic), a coding assistant.
> 
> Fixes: 6e55d273708b ("drm/panfrost: initial dual core group GPUs support")
> Signed-off-by: Young-Jun Hong <[email protected]>

So this patch might be a valid fix. But:

a) It's AI generated and I'm not sure whether any human thought has gone
into it.

b) The next patch in the series basically undoes the change.

The T628 is an awkward beast because it has these two (non-coherent)
core groups. So far there hasn't been much appetite for trying to
support it well because it's pretty rare and AFAIK it's the only GPU
which has this setup.

My own understanding is that this patch is also irrelevant in that the
GPU hardware will effectively AND the affinity with the powered on
shaders. Hence I'd want to see an actual user report (not an AI-report)
that this "fix" actually helps. Sadly I don't have hardware to test this.

Thanks,
Steve

> ---
>  drivers/gpu/drm/panfrost/panfrost_gpu.c | 6 ++++++
>  drivers/gpu/drm/panfrost/panfrost_gpu.h | 1 +
>  drivers/gpu/drm/panfrost/panfrost_job.c | 2 +-
>  3 files changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c 
>b/drivers/gpu/drm/panfrost/panfrost_gpu.c
> index 6081b27829e1..420d224276a5 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_gpu.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c
> @@ -452,6 +452,12 @@ static u64 panfrost_get_core_mask(struct panfrost_device 
>*pfdev)
>   return core_mask;
>  }
>  
> +/* cores that panfrost_gpu_power_on() powers */
> +u64 panfrost_powered_core_mask(struct panfrost_device *pfdev)
> +{
> + return pfdev->features.shader_present & panfrost_get_core_mask(pfdev);
> +}
> +
>  void panfrost_gpu_power_on(struct panfrost_device *pfdev)
>  {
>   int ret;
> diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.h 
>b/drivers/gpu/drm/panfrost/panfrost_gpu.h
> index b4fef11211d5..78a6270b7fcb 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_gpu.h
> +++ b/drivers/gpu/drm/panfrost/panfrost_gpu.h
> @@ -13,6 +13,7 @@ void panfrost_gpu_fini(struct panfrost_device *pfdev);
>  u32 panfrost_gpu_get_latest_flush_id(struct panfrost_device *pfdev);
>  
>  int panfrost_gpu_soft_reset(struct panfrost_device *pfdev);
> +u64 panfrost_powered_core_mask(struct panfrost_device *pfdev);
>  void panfrost_gpu_power_on(struct panfrost_device *pfdev);
>  void panfrost_gpu_power_off(struct panfrost_device *pfdev);
>  void panfrost_gpu_suspend_irq(struct panfrost_device *pfdev);
> diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c 
>b/drivers/gpu/drm/panfrost/panfrost_job.c
> index 4ddf4b722ddf..33da86587db7 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_job.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_job.c
> @@ -143,7 +143,7 @@ static void panfrost_job_write_affinity(struct 
>panfrost_device *pfdev,
>    * Eventually we may need to support tiler only jobs and h/w with
>    * multiple (2) coherent core groups
>    */
> - affinity = pfdev->features.shader_present;
> + affinity = panfrost_powered_core_mask(pfdev);
>  
>   job_write(pfdev, JS_AFFINITY_NEXT_LO(js), lower_32_bits(affinity));
>   job_write(pfdev, JS_AFFINITY_NEXT_HI(js), upper_32_bits(affinity));

Reply via email to