From: sashiko-bot@kernel.org
To: "Jian Hu via B4 Relay" <devnull+jian.hu.amlogic.com@kernel.org>
Cc: krzk+dt@kernel.org, conor+dt@kernel.org,
devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH 09/10] clk: amlogic: Add A9 peripherals clock controller driver
Date: Tue, 12 May 2026 06:18:43 +0000 [thread overview]
Message-ID: <20260512061843.C1D75C2BCB0@smtp.kernel.org> (raw)
In-Reply-To: <20260511-b4-a9_clk-v1-9-41cb4071b7c9@amlogic.com>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] Missing multiplexer value table for `usb_48m_pre` clock
- [High] Register bit overlap between `gen` clock divider and gate
- [High] Incorrect parent clock selector referenced by `hdmitx1_pixel`
--
commit 4a10654bfda3abb70d26d386a44e76675278fccb
Author: Jian Hu <jian.hu@amlogic.com>
clk: amlogic: Add A9 peripherals clock controller driver
Add the peripherals clock controller driver for the Amlogic A9 SoC family.
> diff --git a/drivers/clk/meson/a9-peripherals.c b/drivers/clk/meson/a9-peripherals.c
> new file mode 100644
> --- /dev/null
> +++ b/drivers/clk/meson/a9-peripherals.c
[ ... ]
> /* Channel 5 and 6 are unconnected. */
> static u32 a9_usb_250m_parents_val_table[] = { 0, 1, 2, 3, 4, 7 };
> static const struct clk_parent_data a9_usb_250m_parents[] = {
> { .fw_name = "fdiv4", },
> { .fw_name = "fdiv3", },
> { .fw_name = "fdiv5", },
> { .fw_name = "fdiv2", },
> { .fw_name = "fdiv7", },
> { .fw_name = "fdiv2p5", }
> };
>
> static A9_COMP_SEL(usb_250m, USB_CLK_CTRL, 9, 0x7, a9_usb_250m_parents,
> a9_usb_250m_parents_val_table);
[ ... ]
> static const struct clk_parent_data a9_usb_48m_pre_parents[] = {
> { .fw_name = "fdiv4", },
> { .fw_name = "fdiv3", },
> { .fw_name = "fdiv5", },
> { .fw_name = "fdiv2", },
> { .fw_name = "fdiv7", },
> { .fw_name = "fdiv2p5", }
> };
>
> static A9_COMP_SEL(usb_48m_pre, USB_CLK_CTRL, 25, 0x7, a9_usb_48m_pre_parents,
> NULL);
^^^^
Since channels 5 and 6 are unconnected, should this macro use a value table
similar to a9_usb_250m_parents_val_table?
Passing NULL might cause the framework to write the unconnected index 5 for
the fdiv2p5 clock, potentially silencing the clock output instead of
selecting index 7.
[ ... ]
> static A9_COMP_SEL(gen, GEN_CLK_CTRL, 12, 0x1f, a9_gen_parents,
> a9_gen_parents_val_table);
> static A9_COMP_DIV(gen, GEN_CLK_CTRL, 0, 12);
> static A9_COMP_GATE(gen, GEN_CLK_CTRL, 11, 0);
^^
Could this cause a register bit overlap?
The divider is configured to be 12 bits wide starting at bit 0, which means
it occupies bits 0 through 11. However, the clock gate is also defined at
bit 11 in the same register.
Writing to the divider might inadvertently toggle the clock gate, and
toggling the gate could corrupt the most significant bit of the divider.
[ ... ]
> static struct clk_regmap a9_hdmitx1_pixel = {
> .data = &(struct clk_regmap_gate_data){
> .offset = VID_CLK_CTRL2,
> .bit_idx = 12,
> },
> .hw.init = &(struct clk_init_data) {
> .name = "hdmitx1_pixel",
> .ops = &clk_regmap_gate_ops,
> .parent_hws = (const struct clk_hw *[]) {
> &a9_hdmitx_pixel_sel.hw
^^^^^^^^^^^^^^^^^^^^^^^
Is this the intended parent selector?
This references a9_hdmitx_pixel_sel instead of a9_hdmitx1_pixel_sel. This
hierarchy mismatch might cause parent and rate adjustments for hdmitx1_pixel
to mutate the wrong clock selector, leaving its own hardware unconfigured.
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260511-b4-a9_clk-v1-0-41cb4071b7c9@amlogic.com?part=9
next prev parent reply other threads:[~2026-05-12 6:18 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 12:47 [PATCH 00/10] Add support for A9 family clock controller Jian Hu via B4 Relay
2026-05-11 12:47 ` [PATCH 01/10] dt-bindings: clock: Add Amlogic A9 SCMI " Jian Hu via B4 Relay
2026-05-11 12:47 ` [PATCH 02/10] dt-bindings: clock: Add Amlogic A9 PLL " Jian Hu via B4 Relay
2026-05-12 4:18 ` sashiko-bot
2026-05-11 12:47 ` [PATCH 03/10] dt-bindings: clock: Add Amlogic A9 peripherals " Jian Hu via B4 Relay
2026-05-11 12:47 ` [PATCH 04/10] dt-bindings: clock: Add Amlogic A9 AO " Jian Hu via B4 Relay
2026-05-11 12:47 ` [PATCH 05/10] clk: amlogic: PLL l_detect signal supports active-high configuration Jian Hu via B4 Relay
2026-05-11 15:47 ` Brian Masney
2026-05-11 12:47 ` [PATCH 06/10] clk: amlogic: PLL reset signal supports active-low configuration Jian Hu via B4 Relay
2026-05-11 15:21 ` Brian Masney
2026-05-12 4:48 ` sashiko-bot
2026-05-11 12:47 ` [PATCH 07/10] clk: amlogic: Support POWER_OF_TWO for PLL pre-divider Jian Hu via B4 Relay
2026-05-11 15:23 ` Brian Masney
2026-05-11 12:47 ` [PATCH 08/10] clk: amlogic: Add A9 PLL clock controller driver Jian Hu via B4 Relay
2026-05-11 15:36 ` Brian Masney
2026-05-12 5:56 ` sashiko-bot
2026-05-11 12:47 ` [PATCH 09/10] clk: amlogic: Add A9 peripherals " Jian Hu via B4 Relay
2026-05-11 15:42 ` Brian Masney
2026-05-12 6:18 ` sashiko-bot [this message]
2026-05-11 12:47 ` [PATCH 10/10] clk: amlogic: Add A9 AO " Jian Hu via B4 Relay
2026-05-11 15:45 ` Brian Masney
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=20260512061843.C1D75C2BCB0@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=devnull+jian.hu.amlogic.com@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=robh@kernel.org \
--cc=sashiko@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