All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Rob Clark" <robin.clark@oss.qualcomm.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 11/12] drm/msm/a8xx: Switch to generated protect regs
Date: Tue, 20 Oct 2026 23:41:42 +0000	[thread overview]
Message-ID: <sashiko-outbox-179609@kernel.org> (raw)
In-Reply-To: <20261020204728.28844-12-robin.clark@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] drm/msm/a8xx: wrong protect table pakala_protect used for Kaanapali
- [High] drm/msm/a8xx: missing CP_PROTECT_GLOBAL(56..62) in a850_ifpc_reglist_regs
--

commit 552d3a60893e50e06127da749c3d585e911f2b2e
Author: Rob Clark <robin.clark@oss.qualcomm.com>

drm/msm/a8xx: Switch to generated protect regs

This commit replaces the hardcoded protect register tables in
a8xx_catalog.c with the generated protect tables from the per-target
catalog headers.

> diff --git a/drivers/gpu/drm/msm/adreno/a8xx_catalog.c b/drivers/gpu/drm/msm/adreno/a8xx_catalog.c
> index bc79013165c13..5f5f71d86df93 100644
> --- a/drivers/gpu/drm/msm/adreno/a8xx_catalog.c
> +++ b/drivers/gpu/drm/msm/adreno/a8xx_catalog.c

[ ... ]

> @@ -1305,7 +1026,7 @@ static const struct adreno_info a8xx_gpus[] = {
>  			  ADRENO_QUIRK_IFPC,
>  		.funcs = &a8xx_gpu_funcs,
>  		.a6xx = &(const struct a6xx_info) {
> -			.protect = &a840_protect,
> +			.protect = &pakala_protect,
>  			.nonctxt_reglist = kaanapali_nonctxt_regs,
>  			.pwrup_reglist = &a840_pwrup_reglist,
>  			.dyn_pwrup_reglist = &a840_dyn_pwrup_reglist,

[Severity: High]
Should the Kaanapali (Adreno 840, 0x44050a01) entry in a8xx_gpus[] use
&kaanapali_protect instead of &pakala_protect?

__build_asserts() checks kaanapali_protect, which is defined in
drivers/gpu/drm/msm/adreno/catalog/adreno_kaanapali.h, but kaanapali_protect
is left unused in a8xx_gpus[].

When hw_init() -> a8xx_set_cp_protect() programs the protection registers
from pakala_protect_regs on Kaanapali, several Kaanapali-specific spans from
kaanapali_protect_regs (including 0x00775..0x0077f, 0x00c07..0x00c0f,
0x03d00..0x05cff, 0x0a82e, 0x0aed0..0x0b17f, and 0x1fd80..0x1ffff) are left
unprotected against unprivileged userspace command streams, while
0x00000..0x00007 and 0x27c02..0x27c05 are protected instead.

[ ... ]

> @@ -1481,7 +1202,7 @@ static const struct adreno_info a8xx_gpus[] = {
>  			  ADRENO_QUIRK_IFPC,
>  		.funcs = &a8xx_gpu_funcs,
>  		.a6xx = &(const struct a6xx_info) {
> -			.protect = &a850_protect,
> +			.protect = &hawi_protect,
>  			.nonctxt_reglist = hawi_nonctxt_regs,
>  			.pwrup_reglist = &a850_pwrup_reglist,
>  			.dyn_pwrup_reglist = &a850_dyn_pwrup_reglist,

[Severity: High]
Does switching Hawi (Adreno 850, 0x44051401) to hawi_protect without
updating a850_ifpc_reglist_regs cause REG_A8XX_CP_PROTECT_GLOBAL(56) through
REG_A8XX_CP_PROTECT_GLOBAL(62) to be lost across inter-frame power collapse?

Previously, a850_protect_regs had 57 entries, and a850_ifpc_reglist_regs
omitted REG_A8XX_CP_PROTECT_GLOBAL(56) through
REG_A8XX_CP_PROTECT_GLOBAL(62):

drivers/gpu/drm/msm/adreno/a8xx_catalog.c:
static const u32 a850_ifpc_reglist_regs[] = {
	...
	REG_A8XX_CP_PROTECT_GLOBAL(54),
	REG_A8XX_CP_PROTECT_GLOBAL(55),
	REG_A8XX_CP_PROTECT_GLOBAL(63),
};

In drivers/gpu/drm/msm/adreno/catalog/adreno_hawi.h, hawi_protect_regs has
64 entries, so hw_init() -> a8xx_set_cp_protect() populates all 64
REG_A8XX_CP_PROTECT_GLOBAL(0..63) registers:

drivers/gpu/drm/msm/adreno/catalog/adreno_hawi.h:
static const u32 hawi_protect_regs[] __maybe_unused = {
	...
	A6XX_PROTECT_NORDWR(0x1ac00, 0x1fff),
	A6XX_PROTECT_NORDWR(0x1f400, 0x0477),
	A6XX_PROTECT_NORDWR(0x1f930, 0x032f),
	A6XX_PROTECT_NORDWR(0x1fd80, 0x1fff),
	A6XX_PROTECT_NORDWR(0x27800, 0x007f),
	A6XX_PROTECT_RDONLY(0x27880, 0x0001),
	A6XX_PROTECT_NORDWR(0x27882, 0x037d),
	A6XX_PROTECT_NORDWR(0x27c06, 0x0000),
};
DECLARE_ADRENO_PROTECT(hawi_protect, 64);

Because Hawi sets ADRENO_QUIRK_IFPC and uses a850_ifpc_reglist in
a8xx_patch_pwrup_reglist(), those 7 protection registers (covering ranges in
0x1ac00..0x27bff) will not be restored after inter-frame power collapse.

> @@ -1516,6 +1237,10 @@ DECLARE_ADRENO_GPULIST(a8xx);
>  
>  static inline __always_unused void __build_asserts(void)
>  {
> -	BUILD_BUG_ON(a810_protect.count > a810_protect.count_max);
> -	BUILD_BUG_ON(a830_protect.count > a830_protect.count_max);
> +	BUILD_BUG_ON(glymur_protect.count > glymur_protect.count_max);
> +	BUILD_BUG_ON(hawi_protect.count > hawi_protect.count_max);
> +	BUILD_BUG_ON(kaanapali_protect.count > kaanapali_protect.count_max);
> +	BUILD_BUG_ON(maili_protect.count > maili_protect.count_max);
> +	BUILD_BUG_ON(milos_protect.count > milos_protect.count_max);
> +	BUILD_BUG_ON(pakala_protect.count > pakala_protect.count_max);
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261020204728.28844-1-robin.clark@oss.qualcomm.com?part=11

  reply	other threads:[~2026-10-20 23:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-20 20:46 [PATCH 00/12] drm/msm/a8xx: GPU state capture support Rob Clark
2026-10-20 20:46 ` [PATCH 01/12] drm/msm: Import adreno_snapshot.h Rob Clark
2026-10-20 20:46 ` [PATCH 02/12] drm/msm/a8xx: Export aperture helpers Rob Clark
2026-10-20 20:46 ` [PATCH 03/12] drm/msm/a8xx: Add a8xx_aperture_acquire_slice() Rob Clark
2026-10-20 20:46 ` [PATCH 04/12] drm/msm/a8xx: Allow nonctx reglist to include GMU regs Rob Clark
2026-10-21  8:38   ` Konrad Dybcio
2026-10-20 20:46 ` [PATCH 05/12] drm/msm/a8xx: Stop getting GMEM_PROTECT from nonctx list Rob Clark
2026-10-20 20:46 ` [PATCH 06/12] drm/msm/adreno: Fix PROTECT span length Rob Clark
2026-10-21  8:40   ` Konrad Dybcio
2026-10-20 20:46 ` [PATCH 07/12] drm/msm/adreno: add temporary __maybe_unused Rob Clark
2026-10-20 20:46 ` [PATCH 08/12] drm/msm/a8xx: Import generated headers Rob Clark
2026-10-20 20:46 ` [PATCH 09/12] drm/msm/a8xx: devcoredump state capture support Rob Clark
2026-10-20 23:13   ` sashiko-bot
2026-10-21  8:42   ` Konrad Dybcio
2026-10-20 20:46 ` [PATCH 10/12] drm/msm/a8xx: Switch to generated nonctx regs Rob Clark
2026-10-20 23:32   ` sashiko-bot
2026-10-21  8:43   ` Konrad Dybcio
2026-10-20 20:46 ` [PATCH 11/12] drm/msm/a8xx: Switch to generated protect regs Rob Clark
2026-10-20 23:41   ` sashiko-bot [this message]
2026-10-21  8:44   ` Konrad Dybcio
2026-10-20 20:46 ` [PATCH 12/12] drm/msm/adreno: Remove temporary __maybe_unused Rob Clark

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=sashiko-outbox-179609@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=robin.clark@oss.qualcomm.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.