Linux clock framework development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Fil Dunsky" <filipp.dunsky@gmail.com>
Cc: devicetree@vger.kernel.org, linux-clk@vger.kernel.org,
	linux-gpio@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v4 3/6] clk: Add Cortina Systems CS7542 clocks
Date: Wed, 25 Nov 2026 10:46:04 +0000	[thread overview]
Message-ID: <sashiko-outbox-233158@kernel.org> (raw)
In-Reply-To: <20261125-cs7542-syscon-v4-3-3337bb0d3b48@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] clk: cs7542_gate_is_prepared() treats regmap_test_bits()
  error as true
--

commit f8597ca556e18d2697791a53767842596741c7d5
Author: Fil Dunsky <filipp.dunsky@gmail.com>

clk: Add Cortina Systems CS7542 clocks

This commit adds a clock driver for the Cortina Systems CS7542 global
syscon, registering the APB, CPU, and AXI clocks from the boot strap along
with three PCIe clock gates.

> diff --git a/drivers/clk/clk-cs7542.c b/drivers/clk/clk-cs7542.c
> new file mode 100644
> index 0000000000000..5aa83dc71c2e9
> --- /dev/null
> +++ b/drivers/clk/clk-cs7542.c

[ ... ]

> +static int cs7542_gate_is_prepared(struct clk_hw *hw)
> +{
> +	struct cs7542_gate *gate = container_of(hw, struct cs7542_gate, hw);
> +
> +	return regmap_test_bits(gate->map, GLOBAL_CONFIG, gate->mask);
> +}

[Severity: Medium]
Can a regmap_test_bits() error cause cs7542_gate_is_prepared() to report
the clock gate as prepared?  regmap_test_bits() returns a negative errno if
reading GLOBAL_CONFIG fails, and clk_core_is_prepared() assigns the result
of .is_prepared() directly to a bool, converting any negative error into
true and causing clk_unprepare_unused_subtree() to unprepare the gate.
Checking regmap_test_bits(...) > 0 would treat read failures as unprepared.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261125-cs7542-syscon-v4-0-3337bb0d3b48@gmail.com?part=3

  reply	other threads:[~2026-11-25 10:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 10:34 [PATCH v4 0/6] soc: cortina: Add CS7542 global clocks, reset controller and pinctrl Fil Dunsky via B4 Relay
2026-11-25 10:34 ` [PATCH v4 1/6] dt-bindings: soc: Add Cortina Systems CS7542 global controls Fil Dunsky via B4 Relay
2026-11-25 10:34 ` [PATCH v4 2/6] dt-bindings: pinctrl: Add Cortina Systems CS7542 pin mux Fil Dunsky via B4 Relay
2026-11-25 10:34 ` [PATCH v4 3/6] clk: Add Cortina Systems CS7542 clocks Fil Dunsky via B4 Relay
2026-11-25 10:46   ` sashiko-bot [this message]
2026-11-25 10:34 ` [PATCH v4 4/6] reset: Add Cortina Systems CS7542 global reset controller Fil Dunsky via B4 Relay
2026-11-25 10:34 ` [PATCH v4 5/6] pinctrl: Add Cortina Systems CS7542 pin multiplexer Fil Dunsky via B4 Relay
2026-11-25 10:34 ` [PATCH v4 6/6] MAINTAINERS: Add CS7542 global control support Fil Dunsky via B4 Relay

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=sashiko-outbox-233158@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=filipp.dunsky@gmail.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-gpio@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox