From: sashiko-bot@kernel.org
To: "Junzhong Pan" <panjunzhong@linux.spacemit.com>
Cc: robh@kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v2 3/9] usb: chipidea: usb2: use devm_clk_get_optional_enabled()
Date: Tue, 08 Sep 2026 09:55:28 +0000 [thread overview]
Message-ID: <20260908095528.85C861F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260908-b4-spacemit-k1-usb2-v2-3-f07342ffa051@linux.spacemit.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Double disable and unprepare of the clock during device removal.
--
commit d2e0018bd6f14cd49dfa6012d83048e3abde69f6
Author: Junzhong Pan <panjunzhong@linux.spacemit.com>
usb: chipidea: usb2: use devm_clk_get_optional_enabled()
Convert devm_clk_get_optional() and clk_prepare_enable() into a single
call devm_clk_get_optional_enabled().
> diff --git a/drivers/usb/chipidea/ci_hdrc_usb2.c b/drivers/usb/chipidea/ci_hdrc_usb2.c
> index 8ffa1e95d8e86..6fae2d4a053a1 100644
> --- a/drivers/usb/chipidea/ci_hdrc_usb2.c
> +++ b/drivers/usb/chipidea/ci_hdrc_usb2.c
[ ... ]
> @@ -99,10 +94,6 @@ static int ci_hdrc_usb2_probe(struct platform_device *pdev)
> pm_runtime_enable(dev);
>
> return 0;
> -
> -clk_err:
> - clk_disable_unprepare(priv->clk);
> - return ret;
> }
>
> static void ci_hdrc_usb2_remove(struct platform_device *pdev)
[Severity: High]
Does this conversion also require removing the manual cleanup in
ci_hdrc_usb2_remove()?
Since the clock is now managed by devm_clk_get_optional_enabled(), it will
automatically handle disabling and unpreparing the clock when the device
is removed.
Leaving the manual clk_disable_unprepare(priv->clk) in ci_hdrc_usb2_remove():
static void ci_hdrc_usb2_remove(struct platform_device *pdev)
{
struct ci_hdrc_usb2_priv *priv = platform_get_drvdata(pdev);
pm_runtime_disable(&pdev->dev);
ci_hdrc_remove_device(priv->ci_pdev);
clk_disable_unprepare(priv->clk);
}
appears to result in a double disable and unprepare of the clock during
device removal, which could lead to unbalanced reference counts and trigger
kernel warnings.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260908-b4-spacemit-k1-usb2-v2-0-f07342ffa051@linux.spacemit.com?part=3
next prev parent reply other threads:[~2026-09-08 9:55 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-08 9:48 [PATCH v2 0/9] Add SpacemiT K1 USB2.0 controllers support Junzhong Pan
2026-09-08 9:48 ` [PATCH v2 1/9] dt-bindings: usb: ci-hdrc-usb2: add spacemit,k1-usb2 compatible Junzhong Pan
2026-09-08 9:48 ` [PATCH v2 2/9] dt-bindings: usb: ci-hdrc-usb2: require clocks and resets for spacemit,k1-usb2 Junzhong Pan
2026-09-08 17:50 ` Conor Dooley
2026-09-09 12:29 ` Junzhong Pan
2026-09-08 9:48 ` [PATCH v2 3/9] usb: chipidea: usb2: use devm_clk_get_optional_enabled() Junzhong Pan
2026-09-08 9:55 ` sashiko-bot [this message]
2026-09-08 10:01 ` Junzhong Pan
2026-09-08 9:48 ` [PATCH v2 4/9] usb: chipidea: usb2: add optional reset support Junzhong Pan
2026-09-08 10:00 ` sashiko-bot
2026-09-08 9:48 ` [PATCH v2 5/9] usb: chipidea: usb2: add SpacemiT K1 support Junzhong Pan
2026-09-08 10:05 ` sashiko-bot
2026-09-08 13:11 ` Troy Mitchell
2026-09-08 9:48 ` [PATCH v2 6/9] riscv: dts: spacemit: add USB2.0 controller nodes for K1 Junzhong Pan
2026-09-08 10:10 ` sashiko-bot
2026-09-08 9:48 ` [PATCH v2 7/9] riscv: dts: spacemit: enable USB2.0 controllers on BananaPi F3 Junzhong Pan
2026-09-08 13:11 ` Troy Mitchell
2026-09-08 9:48 ` [PATCH v2 8/9] riscv: dts: spacemit: enable USB2.0 controllers on OrangePi RV2 Junzhong Pan
2026-09-13 8:33 ` Ze Huang
2026-09-08 9:48 ` [PATCH v2 9/9] riscv: defconfig: enable ChipIdea USB controller support Junzhong Pan
2026-09-08 22:07 ` Yixun Lan
2026-09-09 12:31 ` Junzhong Pan
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=20260908095528.85C861F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=panjunzhong@linux.spacemit.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