All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Vishnu Reddy" <busanna.reddy@oss.qualcomm.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org,
	media-ci@linuxtv.org, robh@kernel.org
Subject: Re: [PATCH v10 07/14] media: iris: Replace enum-indexed clock and power domain tables with per-block structures
Date: Sun, 26 Jul 2026 06:06:22 +0000	[thread overview]
Message-ID: <20260726060623.5805C1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260726-glymur-v10-7-de451559e88b@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Unchecked dereference of optional `iris_power_domain` pointers (`pd`) in resource helpers (`iris_enable_power_domain_and_clocks`, etc.) leads to kernel oops.
--

--- Patch [7]: [PATCH v10 07/14] media: iris: Replace enum-indexed clock and power domain tables with per-block structures ---
commit a990e7238dd52b7ecf138859cc143e38431554ef
Author: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>

media: iris: Replace enum-indexed clock and power domain tables with per-block structures

This commit replaces the flat tables and enum-based lookups for clocks
and power domains with per-hardware-block structures. It introduces the
iris_power_domain structure to bundle devices and clocks without runtime
index lookups.

> diff --git a/drivers/media/platform/qcom/iris/iris_vpu4x.c b/drivers/media/platform/qcom/iris/iris_vpu4x.c
> --- a/drivers/media/platform/qcom/iris/iris_vpu4x.c
> +++ b/drivers/media/platform/qcom/iris/iris_vpu4x.c

[ ... ]

>  static int iris_vpu4x_power_on_hardware(struct iris_core *core)
>  {
>  	u32 efuse_value = readl(core->reg_base + WRAPPER_EFUSE_MONITOR);
>  	int ret;
>  
> -	ret = iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_HW_POWER_DOMAIN]);
> +	ret = iris_enable_power_domain_and_clocks(core, core->vcodec);
>  	if (ret)
>  		return ret;
>  
>  	if (!(efuse_value & DISABLE_VIDEO_VPP0_BIT)) {
> -		ret = iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs
> -						[IRIS_VPP0_HW_POWER_DOMAIN]);
> +		ret = iris_enable_power_domain_and_clocks(core, core->vcodec_vpp0);

[Severity: High]
This is a pre-existing issue, but can this lead to a NULL pointer 
dereference if the platform data doesn't provide configuration for this 
block?

If the hardware efuse indicates VPP0 is present, but the software 
platform data omitted the VPP0 configuration, core->vcodec_vpp0 will be 
NULL. It is then passed to iris_enable_power_domain_and_clocks(), which 
dereferences it immediately:

iris_enable_power_domain_and_clocks(core, pd)
    for (i = 0; i < pd->pd_cnt; i++) {
        ...
    }

The same pattern appears in iris_disable_power_domain_and_clocks() and 
iris_genpd_set_hwmode() for the core->vcodec_vpp1 and core->apv pointers. 
Should there be a NULL check for these pointers in the resource helpers, 
or should the efuse check be combined with a software configuration check?

>  		if (ret)
>  			goto disable_hw_power_domain;
>  	}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260726-glymur-v10-0-de451559e88b@oss.qualcomm.com?part=7

  reply	other threads:[~2026-07-26  6:06 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-26  5:49 [PATCH v10 00/14] media: iris: Add support for glymur platform Vishnu Reddy
2026-07-26  5:49 ` [PATCH v10 01/14] dt-bindings: media: qcom,glymur-iris: Add glymur video codec Vishnu Reddy
2026-07-26  6:00   ` sashiko-bot
2026-07-26  5:49 ` [PATCH v10 02/14] media: iris: Add hooks to initialize and tear down context banks Vishnu Reddy
2026-07-26  6:01   ` sashiko-bot
2026-07-26  5:49 ` [PATCH v10 03/14] media: iris: Add helper to create a context bank device Vishnu Reddy
2026-07-26  6:03   ` sashiko-bot
2026-07-26  5:49 ` [PATCH v10 04/14] media: iris: Add helper to select relevant " Vishnu Reddy
2026-07-26  6:11   ` sashiko-bot
2026-07-26  5:49 ` [PATCH v10 05/14] media: iris: Skip DMA mask setting to core device when IOMMU is not mapped Vishnu Reddy
2026-07-26  6:05   ` sashiko-bot
2026-07-26  5:49 ` [PATCH v10 06/14] media: iris: Enable Secure PAS support with IOMMU managed by Linux Vishnu Reddy
2026-07-26  6:08   ` sashiko-bot
2026-07-26  5:49 ` [PATCH v10 07/14] media: iris: Replace enum-indexed clock and power domain tables with per-block structures Vishnu Reddy
2026-07-26  6:06   ` sashiko-bot [this message]
2026-07-26  5:49 ` [PATCH v10 08/14] media: iris: Add power sequence for glymur Vishnu Reddy
2026-07-26  6:05   ` sashiko-bot
2026-07-26  5:49 ` [PATCH v10 09/14] media: iris: Handle CPU_CS_SCIACMDARG3 register write via program bootup registers hook Vishnu Reddy
2026-07-26  6:03   ` sashiko-bot
2026-07-26  5:49 ` [PATCH v10 10/14] media: iris: Add support to select core for dual core platforms Vishnu Reddy
2026-07-26  6:18   ` sashiko-bot
2026-07-26  5:49 ` [PATCH v10 11/14] media: iris: Add hooks for pixel and non-pixel context banks Vishnu Reddy
2026-07-26  6:03   ` sashiko-bot
2026-07-26  5:49 ` [PATCH v10 12/14] media: iris: Add platform data for glymur Vishnu Reddy
2026-07-26  5:49 ` [PATCH v10 13/14] arm64: dts: qcom: glymur: Add iris video node Vishnu Reddy
2026-07-26  5:49 ` [PATCH v10 14/14] arm64: dts: qcom: glymur-crd: Enable iris video codec node Vishnu Reddy

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=20260726060623.5805C1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=busanna.reddy@oss.qualcomm.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --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 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.