Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Atanas Filipov" <atanas.filipov@oss.qualcomm.com>
Cc: conor+dt@kernel.org, media-ci@linuxtv.org,
	devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v6 3/3] arm64: dts: qcom: sm8250: Add JPEG encoder node
Date: Thu, 30 Jul 2026 15:31:23 +0000	[thread overview]
Message-ID: <20260730153124.3FA9C1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260730150524.2659577-4-atanas.filipov@oss.qualcomm.com>

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

New issues:
- [Critical] Unmanaged Interconnect Bandwidth / DT Misconfiguration
- [High] Incomplete / Ambiguous OPP Performance State Mapping

Pre-existing issues:
- [Critical] Missing Power Domain Attachment Logic (Driver)
- [High] Clock Ordering and Unconfigured Clocks
--

--- Patch [3]: [PATCH v6 3/3] arm64: dts: qcom: sm8250: Add JPEG encoder node ---
commit 78bc4a1419802a831ed1f485f610899cf6a592a5
Author: Atanas Filipov <atanas.filipov@oss.qualcomm.com>

arm64: dts: qcom: sm8250: Add JPEG encoder node

Add the JPEG encoder hardware node to the SM8250 device tree so the
qcom-jpeg V4L2 encoder driver can bind and operate on this platform.

> diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi
> index f11da2ca41818..d42b294193202 100644
> --- a/arch/arm64/boot/dts/qcom/sm8250.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi

[ ... ]

> +		jpeg-encoder@ac53000 {
> +			compatible = "qcom,sm8250-jpeg-enc";
> +			status = "disabled";
> +
> +			reg = <0x0 0x0ac53000 0x0 0x1000>;
> +
> +			interrupts = <GIC_SPI 474 IRQ_TYPE_EDGE_RISING>;
> +
> +			power-domains = <&camcc TITAN_TOP_GDSC>,
> +					<&rpmhpd RPMHPD_MMCX>,
> +					<&rpmhpd RPMHPD_MX>;

[Severity: High]
Will the OPP framework map performance states to the correct domain here?

The device node lists three power domains, but the jpeg_opp_table
provides only a single required-opps entry per OPP. The OPP framework
maps required-opps entries sequentially to attached genpd domains.

It looks like this maps the single entry to the first domain
(TITAN_TOP_GDSC), which does not support performance states, while the
scalable MMCX and MX domains receive no performance scaling mapping. Could
this lead to voltage scaling silently failing?

> +			power-domain-names = "titan_top", "mmcx", "mx";

[ ... ]

> +			jpeg_opp_table: opp-table {
> +				compatible = "operating-points-v2";
> +
> +				opp-100000000 {
> +					opp-hz = /bits/ 64 <400000000>,
> +						 /bits/ 64 <100000000>;
> +					required-opps = <&rpmhpd_opp_min_svs>;
> +				};

[Severity: Critical]
Are we missing the opp-peak-kBps arrays required for interconnect bandwidth
voting?

The DT node defines interconnects, but the OPP table omits opp-peak-kBps.
If the driver relies entirely on the OPP framework for interconnect management,
without opp-peak-kBps the framework votes for 0 kBps when an OPP is set.

Could this cause a synchronous external abort when the JPEG hardware accesses
memory through unclocked or unpowered NoC paths?

[ ... ]

[Severity: Critical]
This isn't a bug introduced by this patch, but does the qcom-jpeg driver
have the necessary logic to attach and manage multiple power domains?

The new device tree node specifies three power domains:

power-domains = <&camcc TITAN_TOP_GDSC>,
		<&rpmhpd RPMHPD_MMCX>,
		<&rpmhpd RPMHPD_MX>;

Looking at the driver's probe function:

drivers/media/platform/qcom/jpeg/qcom_jenc_dev.c:qcom_jpeg_probe() {
    ...
    rc = devm_pm_runtime_enable(jenc->dev);
    if (rc)
        goto err_free_jenc;
    ...
}

The driver relies solely on the driver core, which automatically attaches
only the first domain (TITAN_TOP_GDSC). Because the probe function does
not explicitly call devm_pm_domain_attach_list(), the MMCX and MX domains
are never powered on.

Will this result in unhandled page faults when accessing unpowered hardware
registers?

[Severity: High]
This is a pre-existing issue, but is the clock ordering correct when resuming
or during active transitions?

Looking at the driver's clock enablement logic:

drivers/media/platform/qcom/jpeg/qcom_jenc_dev.c:qcom_jpeg_clk_on() {
    ...
    rc = clk_bulk_prepare_enable(jenc->num_clks, jenc->clks);
    if (rc)
        return rc;

    /* setup the OPP according to the calculated optimal frequency */
    opp = dev_pm_opp_find_freq_ceil_indexed(jenc->dev, &jenc->opt_freq, JPEG_OPP_CORE_IDX);
    ...
    rc = dev_pm_opp_set_opp(jenc->dev, opp);
    ...
}

Clocks are explicitly enabled before the OPP framework handles the required
voltage scaling constraints via dev_pm_opp_set_opp(). If the bootloader left
clocks at a high frequency, enabling them before voltage is scaled up could
violate hardware voltage constraints.

Additionally, three of the five provided clocks (sf_axi, core_ahb, cpas_ahb)
are never rate-configured by the driver, leaving them at arbitrary unmanaged
rates. Could this lead to hardware instability?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260730150524.2659577-1-atanas.filipov@oss.qualcomm.com?part=3

  reply	other threads:[~2026-07-30 15:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30 15:05 [PATCH v6 0/3] Add Qualcomm JPEG V4L2 encoder for SM8250 Atanas Filipov
2026-07-30 15:05 ` [PATCH v6 1/3] dt-bindings: media: qcom: Add JPEG encoder binding Atanas Filipov
2026-07-30 15:39   ` Dmitry Baryshkov
2026-07-30 16:24     ` Atanas Filipov
2026-07-30 15:05 ` [PATCH v6 2/3] media: qcom: jpeg: Add Qualcomm JPEG V4L2 encoder Atanas Filipov
2026-07-30 15:20   ` sashiko-bot
2026-07-30 15:57   ` Dmitry Baryshkov
2026-07-30 15:05 ` [PATCH v6 3/3] arm64: dts: qcom: sm8250: Add JPEG encoder node Atanas Filipov
2026-07-30 15:31   ` sashiko-bot [this message]
2026-07-30 16:01   ` Dmitry Baryshkov
2026-07-30 18:02     ` Atanas Filipov

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=20260730153124.3FA9C1F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=atanas.filipov@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox