From: sashiko-bot@kernel.org
To: "Louis-Alexis Eyraud" <louisalexis.eyraud@collabora.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v5 10/25] clk: mediatek: pll: Add BAR reset register offsets
Date: Sun, 02 Aug 2026 11:22:30 +0000 [thread overview]
Message-ID: <20260802112231.5C67F1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260801-mt8189-clocks-system-base-v5-10-ac4410697cc2@collabora.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The newly introduced `rst_bar_set_addr` and `rst_bar_clr_addr` are completely unused in the `mtk_pll_prepare` and `mtk_pll_unprepare` callbacks, causing read-modify-writes to be performed on the status register instead of writing to the dedicated set/clear registers.
--
--- Patch [10]: [PATCH v5 10/25] clk: mediatek: pll: Add BAR reset register offsets ---
commit 9a53464d4cd99a5e5248c794e08d787f148b4b00
Author: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
clk: mediatek: pll: Add BAR reset register offsets
This commit introduces new fields to the MTK PLL data structure to support
separate reset BAR status, set, and clear registers on the MT8189 SoC. It
also updates the prepare and unprepare callbacks to use the newly computed
reset BAR address instead of hardcoding the CON0 register offset.
> diff --git a/drivers/clk/mediatek/clk-pll.c b/drivers/clk/mediatek/clk-pll.c
> index ee478bc640851..4b0f7e2bfc5a5 100644
> --- a/drivers/clk/mediatek/clk-pll.c
> +++ b/drivers/clk/mediatek/clk-pll.c
[ ... ]
> @@ -249,9 +249,9 @@ int mtk_pll_prepare(struct clk_hw *hw)
> udelay(20);
>
> if (pll->data->flags & HAVE_RST_BAR) {
> - r = readl(pll->base_addr + REG_CON0);
> + r = readl(pll->rst_bar_addr);
> r |= pll->data->rst_bar_mask;
> - writel(r, pll->base_addr + REG_CON0);
> + writel(r, pll->rst_bar_addr);
> }
[Severity: High]
Does this logic correctly handle the new set and clear registers for MT8189?
The commit message mentions that MT8189 has separate set and clr registers
to handle the reset BAR. However, this code continues to perform a
read-modify-write on the status register (rst_bar_addr) instead of writing
to the newly added rst_bar_set_addr.
Will this fail to assert the reset BAR on MT8189 hardware that requires
the dedicated set register?
>
> return 0;
> @@ -263,9 +263,9 @@ void mtk_pll_unprepare(struct clk_hw *hw)
> u32 r;
>
> if (pll->data->flags & HAVE_RST_BAR) {
> - r = readl(pll->base_addr + REG_CON0);
> + r = readl(pll->rst_bar_addr);
> r &= ~pll->data->rst_bar_mask;
> - writel(r, pll->base_addr + REG_CON0);
> + writel(r, pll->rst_bar_addr);
> }
[Severity: High]
Similarly, shouldn't this unprepare path write to rst_bar_clr_addr if it is
available, rather than doing a read-modify-write on the status register?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260801-mt8189-clocks-system-base-v5-0-ac4410697cc2@collabora.com?part=10
next prev parent reply other threads:[~2026-08-02 11:22 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-01 11:20 [PATCH v5 00/25] MT8189: Add support for system and base clock controllers Louis-Alexis Eyraud
2026-08-01 11:20 ` [PATCH v5 01/25] dt-bindings: clock: mediatek: Make '#clock-cells' required for MT8186 Louis-Alexis Eyraud
2026-08-01 11:20 ` [PATCH v5 02/25] dt-bindings: clock: mediatek: Make '#clock-cells' required for MT8192 Louis-Alexis Eyraud
2026-08-01 11:20 ` [PATCH v5 03/25] dt-bindings: clock: mediatek: Make '#clock-cells' required for MT8195 Louis-Alexis Eyraud
2026-08-01 11:20 ` [PATCH v5 04/25] dt-bindings: clock: mediatek: reorder MT8186 compatibles Louis-Alexis Eyraud
2026-08-01 11:20 ` [PATCH v5 05/25] dt-bindings: clock: mediatek: regroup MT8188 dt-bindings into MT8186 Louis-Alexis Eyraud
2026-08-02 11:22 ` sashiko-bot
2026-08-03 14:24 ` Rob Herring
2026-08-01 11:20 ` [PATCH v5 06/25] dt-bindings: clock: mediatek: regroup MT8192 " Louis-Alexis Eyraud
2026-08-02 11:22 ` sashiko-bot
2026-08-01 11:20 ` [PATCH v5 07/25] dt-bindings: clock: mediatek: regroup MT8195 " Louis-Alexis Eyraud
2026-08-01 11:20 ` [PATCH v5 08/25] dt-bindings: clock: mediatek: Add MT8189 system/base clocks and resets Louis-Alexis Eyraud
2026-08-02 11:22 ` sashiko-bot
2026-08-01 11:20 ` [PATCH v5 09/25] clk: mediatek: Harmonize mtk_pll_fenc related symbol names Louis-Alexis Eyraud
2026-08-03 14:32 ` Brian Masney
2026-08-01 11:20 ` [PATCH v5 10/25] clk: mediatek: pll: Add BAR reset register offsets Louis-Alexis Eyraud
2026-08-02 11:22 ` sashiko-bot [this message]
2026-08-03 14:37 ` Brian Masney
2026-08-01 11:20 ` [PATCH v5 11/25] clk: mediatek: pll: Factorise pll power on/off sequences Louis-Alexis Eyraud
2026-08-03 14:39 ` Brian Masney
2026-08-01 11:20 ` [PATCH v5 12/25] clk: mediatek: pll: Add PLL stabilization delay definition Louis-Alexis Eyraud
2026-08-03 14:40 ` Brian Masney
2026-08-01 11:20 ` [PATCH v5 13/25] clk: mediatek: pll: Add ops for PLLs using set/clr regs Louis-Alexis Eyraud
2026-08-02 11:22 ` sashiko-bot
2026-08-03 14:44 ` Brian Masney
2026-08-01 11:21 ` [PATCH v5 14/25] clk: mediatek: pllfh: Add configurable clock ops to mtk_pllfh_data Louis-Alexis Eyraud
2026-08-03 14:45 ` Brian Masney
2026-08-01 11:21 ` [PATCH v5 15/25] clk: mediatek: pllfh: Add ops for PLLs using set/clr regs Louis-Alexis Eyraud
2026-08-03 14:46 ` Brian Masney
2026-08-01 11:21 ` [PATCH v5 16/25] clk: mediatek: Add MT8189 apmixedsys clock support Louis-Alexis Eyraud
2026-08-02 11:22 ` sashiko-bot
2026-08-03 15:12 ` Brian Masney
2026-08-01 11:21 ` [PATCH v5 17/25] clk: mediatek: Add MT8189 topckgen " Louis-Alexis Eyraud
2026-08-02 11:22 ` sashiko-bot
2026-08-03 15:16 ` Brian Masney
2026-08-01 11:21 ` [PATCH v5 18/25] clk: mediatek: Add MT8189 vlpckgen " Louis-Alexis Eyraud
2026-08-03 15:17 ` Brian Masney
2026-08-01 11:21 ` [PATCH v5 19/25] clk: mediatek: Add MT8189 vlpcfg " Louis-Alexis Eyraud
2026-08-03 15:19 ` Brian Masney
2026-08-01 11:21 ` [PATCH v5 20/25] clk: mediatek: Add MT8189 bus " Louis-Alexis Eyraud
2026-08-01 11:21 ` [PATCH v5 21/25] clk: mediatek: Add MT8189 dbgao " Louis-Alexis Eyraud
2026-08-01 11:21 ` [PATCH v5 22/25] clk: mediatek: Add MT8189 dvfsrc " Louis-Alexis Eyraud
2026-08-01 11:21 ` [PATCH v5 23/25] clk: mediatek: Add MT8189 i2c " Louis-Alexis Eyraud
2026-08-01 11:21 ` [PATCH v5 24/25] clk: mediatek: Add MT8189 scp " Louis-Alexis Eyraud
2026-08-02 11:22 ` sashiko-bot
2026-08-01 11:21 ` [PATCH v5 25/25] clk: mediatek: Add MT8189 ufs " Louis-Alexis Eyraud
2026-08-02 11:22 ` sashiko-bot
2026-08-03 15:23 ` [PATCH v5 00/25] MT8189: Add support for system and base clock controllers Brian Masney
2026-08-03 19:51 ` Jakub Kicinski
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=20260802112231.5C67F1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=louisalexis.eyraud@collabora.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 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.