From: sashiko-bot@kernel.org
To: "Shubhrajyoti Datta" <shubhrajyoti.datta@amd.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v2 6/8] clk: clocking-wizard: Use dev_err_probe() when mapping registers
Date: Thu, 09 Jul 2026 11:25:16 +0000 [thread overview]
Message-ID: <20260709112516.9842B1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260709111403.1579159-7-shubhrajyoti.datta@amd.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
New issues:
- [Medium] Wrapping `devm_platform_ioremap_resource()` in `dev_err_probe()` causes redundant double error logging, and the commit message's justification regarding deferred-probe behavior is factually incorrect.
Pre-existing issues:
- [High] Registering the exact same `struct notifier_block` instance (`clk_wzrd->nb`) to two different clock notifier chains corrupts the SRCU linked lists.
--
--- Patch [6]: [PATCH v2 6/8] clk: clocking-wizard: Use dev_err_probe() when mapping registers ---
commit 62924401e7cb937dd4102855b2b6f8bf68175467
Author: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>
clk: clocking-wizard: Use dev_err_probe() when mapping registers
This commit updates the error handling for mapping registers in the clock
wizard driver. It replaces a direct return of the error code with a call
to dev_err_probe().
> Align the devm_platform_ioremap_resource() error path with clk_in1 and
> s_axi_aclk handling for consistent logging and deferred-probe behavior.
[Severity: Medium]
Is this description accurate regarding deferred-probe behavior?
Since devm_platform_ioremap_resource() never returns -EPROBE_DEFER, could
the commit message be more precise about what deferred-probe behavior is
expected here?
> diff --git a/drivers/clk/xilinx/clk-xlnx-clock-wizard.c b/drivers/clk/xilinx/clk-xlnx-clock-wizard.c
> index fe73ee02b54ee..381e396aef0e7 100644
> --- a/drivers/clk/xilinx/clk-xlnx-clock-wizard.c
> +++ b/drivers/clk/xilinx/clk-xlnx-clock-wizard.c
> @@ -1277,7 +1277,8 @@ static int clk_wzrd_probe(struct platform_device *pdev)
>
> clk_wzrd->base = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(clk_wzrd->base))
> - return PTR_ERR(clk_wzrd->base);
> + return dev_err_probe(&pdev->dev, PTR_ERR(clk_wzrd->base),
> + "failed to map registers\n");
[Severity: Medium]
Does wrapping devm_platform_ioremap_resource() with dev_err_probe() cause
redundant error logging?
Because devm_platform_ioremap_resource() calls __devm_ioremap_resource()
internally, which natively utilizes dev_err_probe() to print detailed error
messages for all its failure modes, would this exact same failure end up
being logged twice?
[Severity: High]
This is a pre-existing issue, but does registering the same notifier block
instance to two different clock notifier chains corrupt the SRCU linked
lists?
Looking at clk_wzrd_probe(), the driver attempts to register the exact same
notifier block instance to both clk_in1 and axi_clk:
drivers/clk/xilinx/clk-xlnx-clock-wizard.c:clk_wzrd_probe() {
...
clk_wzrd->nb.notifier_call = clk_wzrd_clk_notifier;
ret = devm_clk_notifier_register(&pdev->dev, clk_wzrd->clk_in1,
&clk_wzrd->nb);
if (ret)
dev_warn(&pdev->dev,
"unable to register clock notifier\n");
ret = devm_clk_notifier_register(&pdev->dev, clk_wzrd->axi_clk,
&clk_wzrd->nb);
...
}
Because a notifier_block structure contains a next pointer used to link it
into a singly-linked list, does registering it to the second clock's chain
overwrite the next pointer and corrupt the first clock's notifier list?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260709111403.1579159-1-shubhrajyoti.datta@amd.com?part=6
next prev parent reply other threads:[~2026-07-09 11:25 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 11:13 [PATCH v2 0/8] clk: clocking-wizard: Add static-config clock provider support Shubhrajyoti Datta
2026-07-09 11:13 ` [PATCH v2 1/8] dt-bindings: clock: clocking-wizard: Add static-config mode support Shubhrajyoti Datta
2026-07-09 11:13 ` [PATCH v2 2/8] clk: clocking-wizard: Do not map the memory for static-config Shubhrajyoti Datta
2026-07-09 11:28 ` sashiko-bot
2026-07-09 11:13 ` [PATCH v2 3/8] clk: clocking-wizard: Move clk_in1 acquisition before static-config check Shubhrajyoti Datta
2026-07-09 11:25 ` sashiko-bot
2026-07-09 11:13 ` [PATCH v2 4/8] clk: clocking-wizard: Add static-config clock provider support Shubhrajyoti Datta
2026-07-09 11:26 ` sashiko-bot
2026-07-09 11:14 ` [PATCH v2 5/8] clk: clocking-wizard: Skip s_axi_aclk for static-config Shubhrajyoti Datta
2026-07-09 11:28 ` sashiko-bot
2026-07-09 11:14 ` [PATCH v2 6/8] clk: clocking-wizard: Use dev_err_probe() when mapping registers Shubhrajyoti Datta
2026-07-09 11:25 ` sashiko-bot [this message]
2026-07-09 11:14 ` [PATCH v2 7/8] clk: clocking-wizard: Fix division by zero and unbounded register write Shubhrajyoti Datta
2026-07-09 11:28 ` sashiko-bot
2026-07-09 11:14 ` [PATCH v2 8/8] clk: clocking-wizard: Use separate notifier_block for each clock Shubhrajyoti Datta
2026-07-09 11:20 ` 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=20260709112516.9842B1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=shubhrajyoti.datta@amd.com \
/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