From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 64943606A322 for ; Fri, 4 Dec 2026 08:03:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=UQxmfTXT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CC890112CF3; Fri, 4 Dec 2026 08:03:20 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id C69F9112CF3 for ; Fri, 4 Dec 2026 08:03:14 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 9115140860; Fri, 4 Dec 2026 08:03:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6318F1F000CE; Fri, 4 Dec 2026 08:03:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796371394; bh=PtE/Up3rJ7JZbd7EnBqUkVe2AVX463kwM7w7QEvhw64=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=UQxmfTXTVrK76jdFZJkoiNPXswwYTeds3g3rjarDZdup5/NtDMhHnMPuZY1escqRo OvCbXzbGG2AVQUF91VGLjXJSQcBR1HbPizffH+aFyiX3TSoXvx6Tl4/rK3R33nSuni hK9GqSAtprPO4TGfgvqDW6vqpvMok08VYXmUC8zG45LGqezxYzupdZ8XcugugX21Mf Whbl+V0ZnWbBUu8s8OMjn8ZQQnYQUhKF7G76ehVMw2KYCLveOCWX59dJqa6UaR1Orp VY48Obf/KKggFKBR435SuaDcpUXx+PBzjIu7SKsnIubqtqE4WDnlLSKRb+oeIEfqOD RK7YzF5Wo6FJw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v3 3/6] drm/imagination: Save metadata from firmware To: "Alexandru Dadu" Cc: dri-devel@lists.freedesktop.org In-Reply-To: <20261204-b4-commonize-fw-segment-loading-v3-3-84b4435fb634@imgtec.com> References: <20261204-b4-commonize-fw-segment-loading-v3-0-84b4435fb634@imgtec.com> <20261204-b4-commonize-fw-segment-loading-v3-3-84b4435fb634@imgtec.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 08:03:14 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "dri-devel" X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: 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 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/imag= ination/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); > =20 > 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 =3D=3D 0 || > + (version.major > PVR_FW_MAX_SUPPORTED_MAJOR_VERSION && !pvr_exp_fw_= support) || > + (version.major !=3D PVR_FW_MAX_SUPPORTED_MAJOR_VERSION && pvr_exp_f= w_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 !=3D sizeof(struct pvr_fw_info_header)) { > + drm_err(drm_dev, "Firmware header size mismatch (found=3D%u, expected= =3D%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 =3D true; > + } else if (header->layout_entry_size !=3D sizeof(struct pvr_fw_layout_e= ntry)) { > + drm_err(drm_dev, > + "Firmware layout table entry size mismatch (found=3D%u, expected=3D%z= u)\n)", > + header->layout_entry_size, sizeof(struct pvr_fw_layout_entry)); > + invalid =3D true; > + } else if (header->layout_entry_num > PVR_FW_INFO_MAX_NUM_ENTRIES) { > + drm_err(drm_dev, "Firmware layout table is too large (found=3D%u, max= =3D%u)\n)", > + header->layout_entry_num, PVR_FW_INFO_MAX_NUM_ENTRIES); > + invalid =3D 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 --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204-b4-commoni= ze-fw-segment-loading-v3-0-84b4435fb634@imgtec.com?part=3D3