From: Steven Price <steven.price@arm.com>
To: Young-Jun Hong <nirvanah@nirvanahyj.com>
Cc: "Boris Brezillon" <boris.brezillon@collabora.com>,
"Rob Herring" <robh@kernel.org>,
"Adrián Larumbe" <adrian.larumbe@collabora.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Alexey Sheplyakov" <asheplyakov@basealt.ru>,
"Vadim V. Vlasov" <vadim.vlasov@elpitech.ru>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] drm/panfrost: only put powered shader cores in the job affinity
Date: Mon, 23 Nov 2026 15:37:55 +0000 [thread overview]
Message-ID: <37d17a3a-6b8e-4909-85df-7980d689bb3f@arm.com> (raw)
In-Reply-To: <20261106054210.2893230-4-nirvanah@nirvanahyj.com_quarantine>
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 <nirvanah@nirvanahyj.com>
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));
prev parent reply other threads:[~2026-11-23 15:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 5:41 [PATCH 0/4] Exynos 5422: Mali-T628 GPU compute fixes Young-Jun Hong
2026-11-06 5:41 ` [PATCH 1/4] iommu/io-pgtable-arm: use inner shareable for Mali LPAE on a non-coherent GPU Young-Jun Hong
2026-11-06 5:41 ` [PATCH 2/4] clk: samsung: exynos5420: add VPLL rates for 650, 700 and 750 MHz Young-Jun Hong
2026-11-06 14:45 ` Henrik Grimler
2026-11-06 5:41 ` [PATCH 3/4] drm/panfrost: only put powered shader cores in the job affinity Young-Jun Hong
2026-11-06 5:41 ` [PATCH 4/4] drm/panfrost: let jobs opt in to all core groups Young-Jun Hong
[not found] ` <20261106054210.2893230-4-nirvanah@nirvanahyj.com_quarantine>
2026-11-23 15:37 ` Steven Price [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=37d17a3a-6b8e-4909-85df-7980d689bb3f@arm.com \
--to=steven.price@arm.com \
--cc=adrian.larumbe@collabora.com \
--cc=airlied@gmail.com \
--cc=asheplyakov@basealt.ru \
--cc=boris.brezillon@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=nirvanah@nirvanahyj.com \
--cc=robh@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--cc=vadim.vlasov@elpitech.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®