All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Vishnu Reddy" <busanna.reddy@oss.qualcomm.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v9 08/14] media: iris: Add power sequence for glymur
Date: Wed, 15 Jul 2026 14:36:55 +0000	[thread overview]
Message-ID: <20260715143656.7A5C71F00A3F@smtp.kernel.org> (raw)
In-Reply-To: <20260715-glymur-v9-8-8cf2cbe12a07@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] If the NOC LPI handshake times out during readl_poll_timeout, the PREP bit is left asserted in the AON register, permanently hanging the NOC on the next boot.
--

--- Patch [8]: [PATCH v9 08/14] media: iris: Add power sequence for glymur ---
commit d6ece601b7cdb53f3a84fa94a79400eb75a5853d
Author: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>

media: iris: Add power sequence for glymur

This commit introduces power sequencing for the Glymur platform, which has
two video codec cores. It ensures that clock and power rail voting is
coordinated since both cores share the same power rails and clock source.

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

[ ... ]

> +static void iris_vpu36_power_off_vcodec(struct iris_core *core, u32 core_id)
> +{

[ ... ]

> +	do {
> +		writel(power_down_prep[core_id], core->reg_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL);
> +		usleep_range(15, 20);
> +		value = readl(core->reg_base + AON_WRAPPER_MVP_NOC_LPI_STATUS);
> +
> +		handshake_done = value & lpi_status_done[core_id];
> +		handshake_busy = value & (lpi_status_deny[core_id] | lpi_status_active[core_id]);
> +
> +		if (handshake_done || !handshake_busy)
> +			break;
> +
> +		writel(0, core->reg_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL);
> +		usleep_range(15, 20);
> +	} while (++count < 1000);
> +
> +	if (!handshake_done && handshake_busy)
> +		goto disable_power;
> +
> +	ret = readl_poll_timeout(core->reg_base + AON_WRAPPER_MVP_NOC_LPI_STATUS, value,
> +				 value & lpi_status_done[core_id], 200, 2000);
> +	if (ret)
> +		goto disable_power;

[Severity: High]
If this readl_poll_timeout() fails and returns an error, the code jumps
directly to disable_power, skipping the zeroing of the control register below.
Since the AON_WRAPPER_MVP_NOC_LPI_CONTROL register is in the Always-On (AON)
domain, won't this leave the power_down_prep bit asserted across power cycles
and permanently hang the NOC on the next boot?

Should writel(0, core->reg_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL) be called
before jumping to disable_power on timeout?

> +
> +	writel(0, core->reg_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL);
> +
> +	writel(bridge_sw_reset[core_id] | bridge_hw_reset[core_id],
> +	       core->reg_base + CPU_CS_AHB_BRIDGE_SYNC_RESET);
> +	writel(bridge_hw_reset[core_id], core->reg_base + CPU_CS_AHB_BRIDGE_SYNC_RESET);
> +	writel(0x0, core->reg_base + CPU_CS_AHB_BRIDGE_SYNC_RESET);
> +
> +disable_power:
> +	iris_genpd_set_hwmode(&core->vcodec[core_id], false);
> +	iris_disable_power_domain_and_clocks(core, &core->vcodec[core_id]);
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com?part=8

  reply	other threads:[~2026-07-15 14:36 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-15 14:09 [PATCH v9 00/14] media: iris: Add support for glymur platform Vishnu Reddy
2026-07-15 14:09 ` [PATCH v9 01/14] dt-bindings: media: qcom,glymur-iris: Add glymur video codec Vishnu Reddy
2026-07-15 14:22   ` sashiko-bot
2026-07-15 14:09 ` [PATCH v9 02/14] media: iris: Add hooks to initialize and tear down context banks Vishnu Reddy
2026-07-15 14:23   ` sashiko-bot
2026-07-15 14:09 ` [PATCH v9 03/14] media: iris: Add helper to create a context bank device Vishnu Reddy
2026-07-15 14:09 ` [PATCH v9 04/14] media: iris: Add helper to select relevant " Vishnu Reddy
2026-07-15 14:29   ` sashiko-bot
2026-07-15 14:09 ` [PATCH v9 05/14] media: iris: Skip DMA mask setting to core device when IOMMU is not mapped Vishnu Reddy
2026-07-15 14:22   ` sashiko-bot
2026-07-15 14:10 ` [PATCH v9 06/14] media: iris: Enable Secure PAS support with IOMMU managed by Linux Vishnu Reddy
2026-07-15 14:37   ` sashiko-bot
2026-07-15 14:10 ` [PATCH v9 07/14] media: iris: Replace enum-indexed clock and power domain tables with per-block structures Vishnu Reddy
2026-07-15 14:39   ` sashiko-bot
2026-07-15 14:10 ` [PATCH v9 08/14] media: iris: Add power sequence for glymur Vishnu Reddy
2026-07-15 14:36   ` sashiko-bot [this message]
2026-07-15 14:10 ` [PATCH v9 09/14] media: iris: Handle CPU_CS_SCIACMDARG3 register write via program bootup registers hook Vishnu Reddy
2026-07-15 14:10 ` [PATCH v9 10/14] media: iris: Add support to select core for dual core platforms Vishnu Reddy
2026-07-15 14:42   ` sashiko-bot
2026-07-15 14:10 ` [PATCH v9 11/14] media: iris: Add hooks for pixel and non-pixel context banks Vishnu Reddy
2026-07-15 14:52   ` sashiko-bot
2026-07-15 15:27   ` Bryan O'Donoghue
2026-07-15 14:10 ` [PATCH v9 12/14] media: iris: Add platform data for glymur Vishnu Reddy
2026-07-15 14:10 ` [PATCH v9 13/14] arm64: dts: qcom: glymur: Add iris video node Vishnu Reddy
2026-07-15 15:18   ` sashiko-bot
2026-07-15 14:10 ` [PATCH v9 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=20260715143656.7A5C71F00A3F@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=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.