From: sashiko-bot@kernel.org
To: "Alexandru Dadu" <alexandru.dadu@imgtec.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 3/6] drm/imagination: Save metadata from firmware
Date: Fri, 04 Dec 2026 08:03:14 +0000 [thread overview]
Message-ID: <sashiko-outbox-249359@kernel.org> (raw)
In-Reply-To: <20261204-b4-commonize-fw-segment-loading-v3-3-84b4435fb634@imgtec.com>
Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [High] drm/imagination: undefined pvr_exp_fw_support in
pvr_fw_load_version()
- [Medium] drm/imagination: pvr_remove() unplug order triggers MIPS
WARN_ON splats
- [Low] drm/imagination: stray parenthesis in
pvr_fw_info_header_validate() logs
--
commit 33b17f6942ad845e374f3128899573d7f62e4526
Author: Matt Coster <opensource@mtcoster.net>
drm/imagination: Save metadata from firmware
This commit extracts firmware version and section layout metadata from
the firmware header into a kernel-internal struct pvr_fw_metadata,
moving header validation and parsing into pvr_fw_info.c and updating
callers to use it.
> diff --git a/drivers/gpu/drm/imagination/pvr_drv.c b/drivers/gpu/drm/imagination/pvr_drv.c
> index 2d522a8e46ad6..67f9820cf22cc 100644
> --- a/drivers/gpu/drm/imagination/pvr_drv.c
> +++ b/drivers/gpu/drm/imagination/pvr_drv.c
> @@ -1481,8 +1481,8 @@ static void pvr_remove(struct platform_device *plat_dev)
> xa_destroy(&pvr_dev->free_list_ids);
>
> pm_runtime_suspend(drm_dev->dev);
> - pvr_device_fini(pvr_dev);
> drm_dev_unplug(drm_dev);
> + pvr_device_fini(pvr_dev);
> pvr_watchdog_fini(pvr_dev);
> pvr_queue_device_fini(pvr_dev);
> pvr_context_device_fini(pvr_dev);
[Severity: Medium]
Does calling drm_dev_unplug() before pvr_device_fini() trigger WARN_ON()
splats on MIPS GPUs during driver removal?
pvr_device_fini() -> pvr_fw_fini() destroys firmware objects via
pvr_fw_object_destroy() -> pvr_vm_mips_unmap(), which calls
WARN_ON(pvr_mmu_flush_exec(pvr_dev, true)). Because pvr_mmu_flush_exec()
checks drm_dev_enter() before !READ_ONCE(pvr_dev->fw_dev.initialised), it
now returns -EIO instead of 0 on every firmware object unmapped during
teardown.
This reordering in pvr_remove() is also not explained in the commit
message.
[ ... ]
> diff --git a/drivers/gpu/drm/imagination/pvr_fw_info.c b/drivers/gpu/drm/imagination/pvr_fw_info.c
> new file mode 100644
> index 0000000000000..b0f2dad91fc32
> --- /dev/null
> +++ b/drivers/gpu/drm/imagination/pvr_fw_info.c
> @@ -0,0 +1,345 @@
[ ... ]
> + if (version.major == 0 ||
> + (version.major > PVR_FW_MAX_SUPPORTED_MAJOR_VERSION && !pvr_exp_fw_support) ||
> + (version.major != PVR_FW_MAX_SUPPORTED_MAJOR_VERSION && pvr_exp_fw_support)) {
[Severity: High]
As reported by kernel test robot on v1 [1], does this break linking when
CONFIG_DRM_POWERVR is enabled? pvr_exp_fw_support is declared extern in
pvr_fw.h but is never defined anywhere in the tree, causing a link or
modpost failure.
Even if pvr_exp_fw_support were defined and enabled, the third clause
rejects every major version other than PVR_FW_MAX_SUPPORTED_MAJOR_VERSION,
which would still prevent loading any experimental major version above it.
[ ... ]
> + if (header->header_len != sizeof(struct pvr_fw_info_header)) {
> + drm_err(drm_dev, "Firmware header size mismatch (found=%u, expected=%zu)\n)",
> + header->header_len, sizeof(struct pvr_fw_info_header));
> + return -EINVAL;
> + }
> +
> + if (!header->layout_entry_num || !header->layout_entry_size) {
> + drm_err(drm_dev, "Firmware layout table missing\n");
> + invalid = true;
> + } else if (header->layout_entry_size != sizeof(struct pvr_fw_layout_entry)) {
> + drm_err(drm_dev,
> + "Firmware layout table entry size mismatch (found=%u, expected=%zu)\n)",
> + header->layout_entry_size, sizeof(struct pvr_fw_layout_entry));
> + invalid = true;
> + } else if (header->layout_entry_num > PVR_FW_INFO_MAX_NUM_ENTRIES) {
> + drm_err(drm_dev, "Firmware layout table is too large (found=%u, max=%u)\n)",
> + header->layout_entry_num, PVR_FW_INFO_MAX_NUM_ENTRIES);
> + invalid = true;
[Severity: Low]
These three drm_err() format strings end with "\n)" instead of "\n",
leaving a stray closing parenthesis on the next log line.
[1] https://lore.kernel.org/r/20261126130340.K8Rznt4t-lkp@intel.com
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-b4-commonize-fw-segment-loading-v3-0-84b4435fb634@imgtec.com?part=3
next prev parent reply other threads:[~2026-12-04 8:03 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 7:41 [PATCH v3 0/6] drm/imagination: Commonize firmware segment loading Alexandru Dadu
2026-12-04 7:41 ` Alexandru Dadu
2026-12-04 7:41 ` [PATCH v3 1/6] drm/imagination: Remove get_fw_obj_gpu_addr() Alexandru Dadu
2026-12-04 7:41 ` Alexandru Dadu
2026-12-04 7:41 ` [PATCH v3 2/6] drm/imagination: Fix size of FW header members Alexandru Dadu
2026-12-04 7:41 ` Alexandru Dadu
2026-12-04 7:41 ` [PATCH v3 3/6] drm/imagination: Save metadata from firmware Alexandru Dadu
2026-12-04 7:41 ` Alexandru Dadu
2026-12-04 8:03 ` sashiko-bot [this message]
2026-12-04 7:41 ` [PATCH v3 4/6] drm/imagination: Release firmware after init Alexandru Dadu
2026-12-04 7:41 ` Alexandru Dadu
2026-12-04 7:41 ` [PATCH v3 5/6] drm/imagination: Generalize FW segment loading Alexandru Dadu
2026-12-04 7:41 ` Alexandru Dadu
2026-12-04 7:58 ` sashiko-bot
2026-12-04 7:41 ` [PATCH v3 6/6] drm/imagination: Avoid loop in configure_seg_mmu() Alexandru Dadu
2026-12-04 7:41 ` 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-249359@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 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.