Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
Cc: robh@kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org,
	linux-clk@vger.kernel.org
Subject: Re: [PATCH v11 4/6] clk: Add KUnit tests for assigned-clock-sscs
Date: Mon, 17 Aug 2026 11:07:25 +0000	[thread overview]
Message-ID: <20260817110726.4C85C1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260817-clk-v11-v11-4-36e9bc701b11@nxp.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Commit message and code mismatch: .set_spread_spectrum is omitted from clk_dummy_single_parent_ops
--

--- Patch [4]: [PATCH v11 4/6] clk: Add KUnit tests for assigned-clock-sscs ---
commit 5c23da1873b6e03ee6da2afc142b2da0f14531f3
Author: Peng Fan <peng.fan@nxp.com>

clk: Add KUnit tests for assigned-clock-sscs

This patch adds KUnit test coverage for the assigned-clock-sscs DT
property. It extends the dummy clock context and ops to support spread
spectrum settings, and adds a new test suite for various scenarios.

>     Extend the existing test infrastructure to support spread spectrum:
>     - Add struct clk_spread_spectrum field to clk_dummy_context and a
>       clk_dummy_set_spread_spectrum callback
>     - Wire set_spread_spectrum into all dummy clock ops

[Severity: Medium]
The commit message mentions wiring set_spread_spectrum into all dummy clock
ops, but it appears to be omitted from clk_dummy_single_parent_ops in
clk_test.c. Is this omission intentional?

It looks like clk_dummy_set_spread_spectrum assumes the clk_hw is embedded
in a struct clk_dummy_context:

static int clk_dummy_set_spread_spectrum(...)
{
    struct clk_dummy_context *ctx =
        container_of(hw, struct clk_dummy_context, hw);
    
    ctx->sscs = *ss_conf;
    ...
}

Clocks using clk_dummy_single_parent_ops often allocate a bare struct
clk_hw or use struct clk_single_parent_ctx, which lacks the sscs field.
If the callback had been naively wired as the commit message implies,
configuring spread spectrum on these clocks might cause memory corruption
via an out-of-bounds write.

Could the commit message be updated to clarify that
clk_dummy_single_parent_ops was intentionally skipped?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260817-clk-v11-v11-0-36e9bc701b11@nxp.com?part=4

  reply	other threads:[~2026-08-17 11:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-17 10:59 [PATCH v11 0/6] clk: Support spread spectrum and use it in clk-scmi Peng Fan (OSS)
2026-08-17 10:59 ` [PATCH v11 1/6] dt-bindings: clock: Add spread spectrum definition Peng Fan (OSS)
2026-08-17 10:59 ` [PATCH v11 2/6] clk: Introduce clk_hw_set_spread_spectrum Peng Fan (OSS)
2026-08-17 11:04   ` sashiko-bot
2026-08-17 10:59 ` [PATCH v11 3/6] clk: conf: Support assigned-clock-sscs Peng Fan (OSS)
2026-08-17 11:04   ` sashiko-bot
2026-08-17 10:59 ` [PATCH v11 4/6] clk: Add KUnit tests for assigned-clock-sscs Peng Fan (OSS)
2026-08-17 11:07   ` sashiko-bot [this message]
2026-08-17 10:59 ` [PATCH v11 5/6] clk: scmi: Introduce common header for SCMI clock interface Peng Fan (OSS)
2026-08-17 11:08   ` sashiko-bot
2026-08-17 10:59 ` [PATCH v11 6/6] clk: scmi: Add i.MX95 OEM extension support for SCMI clock driver Peng Fan (OSS)
2026-08-17 11:16   ` sashiko-bot

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=20260817110726.4C85C1F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=peng.fan@oss.nxp.com \
    --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