From: sashiko-bot@kernel.org
To: "Alexandru Dadu" <alexandru.dadu@imgtec.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 4/5] drm/imagination: Limit access to the META firmware interface
Date: Tue, 03 Nov 2026 08:46:05 +0000 [thread overview]
Message-ID: <sashiko-outbox-194867@kernel.org> (raw)
In-Reply-To: <20261103-prep-meta-fw-arch-independent-v3-4-563dbaf1b779@imgtec.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] drm/imagination: inverted layout_mars_value check in layout_is_mars()
--
commit 4207fc7502d043d11f6874d92c1ba51c38ade0fe
Author: Alessio Belle <alessio.belle@imgtec.com>
drm/imagination: Limit access to the META firmware interface
This commit isolates access to the META firmware interface behind the
generic firmware processor table in struct pvr_fw_defs, removes
pvr_fw_meta.h, and renames pvr_rogue_meta.h to pvr_rogue_meta_internal.h.
> diff --git a/drivers/gpu/drm/imagination/pvr_fw_startstop.c b/drivers/gpu/drm/imagination/pvr_fw_startstop.c
> index 98ca2692239d0..ab637ba7d108c 100644
> --- a/drivers/gpu/drm/imagination/pvr_fw_startstop.c
> +++ b/drivers/gpu/drm/imagination/pvr_fw_startstop.c
[ ... ]
> @@ -199,6 +197,30 @@ pvr_fw_start(struct pvr_device *pvr_dev)
> return err;
> }
>
> +static inline bool layout_is_mars(struct pvr_device *pvr_dev)
> +{
> + u64 layout_mars_value = 0;
> +
> + if (PVR_FEATURE_VALUE(pvr_dev, layout_mars, &layout_mars_value))
> + return false;
> +
> + return layout_mars_value == 0;
> +}
[Severity: High]
As reported by Sashiko on v2 [1], does layout_is_mars() invert the check on
layout_mars_value when PVR_FEATURE_VALUE() succeeds?
Prior to this change, pvr_fw_stop() checked:
if (PVR_FEATURE_VALUE(pvr_dev, layout_mars, &layout_mars_value) == 0)
layout_mars = layout_mars_value > 0;
In layout_is_mars(), when PVR_FEATURE_VALUE() returns 0 (feature present),
it evaluates layout_mars_value == 0 instead of layout_mars_value > 0.
On cores with the layout_mars feature enabled (layout_mars_value > 0),
layout_is_mars() will return false, causing pvr_fw_stop() to poll
ROGUE_CR_SIDEKICK_IDLE and ROGUE_CR_SLC_IDLE (which are already powered
down by the firmware on MARS cores) and skip polling ROGUE_CR_MARS_IDLE
before asserting ROGUE_CR_SOFT_RESET. Should this return
layout_mars_value > 0 instead?
[1] https://lore.kernel.org/r/20261029-prep-meta-fw-arch-independent-v2-4-b9f5d69b7a52@imgtec.com
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261103-prep-meta-fw-arch-independent-v3-0-563dbaf1b779@imgtec.com?part=4
next prev parent reply other threads:[~2026-11-03 8:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 8:36 [PATCH v3 0/5] drm/imagination: RISC-V and META firmware interface updates Alexandru Dadu
2026-11-03 8:36 ` [PATCH v3 1/5] drm/imagination: Prepare heap config header for multi-arch support Alexandru Dadu
2026-11-03 8:36 ` [PATCH v3 2/5] drm/imagination: Limit access to the RISC-V firmware interface Alexandru Dadu
2026-11-03 8:36 ` [PATCH v3 3/5] drm/imagination: Make the RISC-V firmware header arch-independent Alexandru Dadu
2026-11-03 8:36 ` [PATCH v3 4/5] drm/imagination: Limit access to the META firmware interface Alexandru Dadu
2026-11-03 8:46 ` sashiko-bot [this message]
2026-11-03 8:36 ` [PATCH v3 5/5] drm/imagination: Make the META firmware header arch-independent Alexandru Dadu
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-194867@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=alexandru.dadu@imgtec.com \
--cc=dri-devel@lists.freedesktop.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox