Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Benjamin Gaignard" <benjamin.gaignard@collabora.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org,
	media-ci@linuxtv.org, Frank.Li@kernel.org, imx@lists.linux.dev,
	conor+dt@kernel.org
Subject: Re: [PATCH 2/2] media: verisilicon: Remove useless internal fields
Date: Wed, 23 Sep 2026 09:19:10 +0000	[thread overview]
Message-ID: <20260923091911.4B0E41F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260923090307.49959-3-benjamin.gaignard@collabora.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] media: hantro: orphaned deprecation check prints incorrect warnings
- [Low] media: hantro: dead code and uninitialized ctrl_base leftover
--

commit 92c1741f69ee792773b715ddb2cdc5d557c1656f
Author: Benjamin Gaignard <benjamin.gaignard@collabora.com>

media: verisilicon: Remove useless internal fields

This commit removes the reg_names and num_regs fields from struct
hantro_variant and simplifies the register mapping in hantro_probe(). It
replaces the array of reg_bases with a single reg_base pointer since
multiple register regions are no longer used.

> diff --git a/drivers/media/platform/verisilicon/hantro.h b/drivers/media/platform/verisilicon/hantro.h
> index 0353de154a1ec..20c3afb3b8176 100644
> --- a/drivers/media/platform/verisilicon/hantro.h
> +++ b/drivers/media/platform/verisilicon/hantro.h
[ ... ]
> @@ -204,7 +200,7 @@ struct hantro_dev {
>  	struct device *dev;
>  	struct clk_bulk_data *clocks;
>  	struct reset_control *resets;
> -	void __iomem **reg_bases;
> +	void __iomem *reg_base;
>  	void __iomem *enc_base;
>  	void __iomem *dec_base;
>  	void __iomem *ctrl_base;

[Severity: Low]
Is this ctrl_base field still needed?

With the removal of imx8mq_vpu_variant and imx8mq_vpu_hw_init in a prior
patch, vpu->ctrl_base is no longer initialized. This leaves dead code in
imx8m_soft_reset() which attempts to read from it:

drivers/media/platform/verisilicon/imx8m_vpu_hw.c:imx8m_soft_reset() {
	...
	val = readl(vpu->ctrl_base + CTRL_SOFT_RESET);
	...
}

This is now mathematically unreachable because the only caller,
imx8m_vpu_g1_reset(), is referenced by imx8mq_vpu_codec_ops, which is also
orphaned. Could ctrl_base and the associated dead code be removed?

> diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
> index 70de47ddb023b..f418b04279856 100644
> --- a/drivers/media/platform/verisilicon/hantro_drv.c
> +++ b/drivers/media/platform/verisilicon/hantro_drv.c
> @@ -1080,7 +1080,6 @@ static int hantro_probe(struct platform_device *pdev)
>  {
>  	const struct of_device_id *match;
>  	struct hantro_dev *vpu;
> -	int num_bases;
>  	int i, ret;
>  
>  	vpu = devm_kzalloc(&pdev->dev, sizeof(*vpu), GFP_KERNEL);

[Severity: Medium]
Since a prior patch in this series removed "nxp,imx8mq-vpu" from
of_hantro_match, will the deprecation check further down in hantro_probe()
print incorrect warnings?

If a device tree node contains both the new "nxp,imx8mq-vpu-g1" and the
old "nxp,imx8mq-vpu" compatibles, it will probe successfully with the new
compatible. However, the check in hantro_probe():

drivers/media/platform/verisilicon/hantro_drv.c:hantro_probe() {
	...
	if (of_device_is_compatible(pdev->dev.of_node, "nxp,imx8mq-vpu"))
		dev_warn(&pdev->dev, "%s compatible is deprecated\n",
			 match->compatible);
	...
}

will still trigger because the old string is in the fallback list. It then
prints match->compatible (which resolves to "nxp,imx8mq-vpu-g1") as
deprecated, which is factually incorrect.

Could this orphaned check be removed to avoid misleading kernel logs?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260923090307.49959-1-benjamin.gaignard@collabora.com?part=2

      reply	other threads:[~2026-09-23  9:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-23  9:03 [PATCH 0/2] Remove unused variant and code clean up Benjamin Gaignard
2026-09-23  9:03 ` [PATCH 1/2] media: verisilicon: Remove deprecated variant Benjamin Gaignard
2026-09-23  9:16   ` sashiko-bot
2026-09-23 12:12   ` Rob Herring (Arm)
2026-09-23 14:29   ` Frank Li
2026-09-23  9:03 ` [PATCH 2/2] media: verisilicon: Remove useless internal fields Benjamin Gaignard
2026-09-23  9:19   ` sashiko-bot [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=20260923091911.4B0E41F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=benjamin.gaignard@collabora.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=media-ci@linuxtv.org \
    --cc=robh@kernel.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