Linux RTC
 help / color / mirror / Atom feed
* [PATCH] rtc: ma35d1: release the clock reference on probe failure
@ 2026-11-04  2:53 Wentao Liang
  2026-11-04  3:00 ` sashiko-bot
  2026-11-04  7:10 ` Krzysztof Kozlowski
  0 siblings, 2 replies; 3+ messages in thread
From: Wentao Liang @ 2026-11-04  2:53 UTC (permalink / raw)
  To: Jacky Huang, Shan-Chun Hung, Alexandre Belloni
  Cc: linux-arm-kernel, linux-rtc

ma35d1_rtc_probe() gets the RTC clock with of_clk_get() and enables it
with clk_prepare_enable(). The clock reference is never dropped and the
clock is never disabled, not on the many later error returns and not on
success either, since the driver has no remove callback. The reference
and the enabled clock are leaked for every probe attempt.

Use devm_clk_get_enabled(), which ties both the reference and the
enabled state to the device lifetime.

Fixes: dc0684adf3b6 ("rtc: Add driver for Nuvoton ma35d1 rtc controller")
Cc: stable@vger.kernel.org
Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/rtc/rtc-ma35d1.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/rtc/rtc-ma35d1.c b/drivers/rtc/rtc-ma35d1.c
index cfcfc28060f6..43358d68565a 100644
--- a/drivers/rtc/rtc-ma35d1.c
+++ b/drivers/rtc/rtc-ma35d1.c
@@ -221,14 +221,10 @@ static int ma35d1_rtc_probe(struct platform_device *pdev)
 	if (IS_ERR(rtc->rtc_reg))
 		return PTR_ERR(rtc->rtc_reg);
 
-	clk = of_clk_get(pdev->dev.of_node, 0);
+	clk = devm_clk_get_enabled(&pdev->dev, NULL);
 	if (IS_ERR(clk))
 		return dev_err_probe(&pdev->dev, PTR_ERR(clk), "failed to find rtc clock\n");
 
-	ret = clk_prepare_enable(clk);
-	if (ret)
-		return ret;
-
 	if (!(rtc_reg_read(rtc, MA35_REG_RTC_INIT) & RTC_INIT_ACTIVE)) {
 		ret = ma35d1_rtc_init(rtc, RTC_INIT_TIMEOUT);
 		if (ret)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] rtc: ma35d1: release the clock reference on probe failure
  2026-11-04  2:53 [PATCH] rtc: ma35d1: release the clock reference on probe failure Wentao Liang
@ 2026-11-04  3:00 ` sashiko-bot
  2026-11-04  7:10 ` Krzysztof Kozlowski
  1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-11-04  3:00 UTC (permalink / raw)
  To: Wentao Liang; +Cc: linux-rtc, Alexandre Belloni

> ma35d1_rtc_probe() gets the RTC clock with of_clk_get() and enables it
> with clk_prepare_enable(). The clock reference is never dropped and the
> clock is never disabled, not on the many later error returns and not on
> success either, since the driver has no remove callback. The reference
> and the enabled clock are leaked for every probe attempt.
> 
> Use devm_clk_get_enabled(), which ties both the reference and the
> enabled state to the device lifetime.
> 
> Fixes: dc0684adf3b6 ("rtc: Add driver for Nuvoton ma35d1 rtc controller")
> Cc: stable@vger.kernel.org
> Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261104025339.1527356-1-vulab@iscas.ac.cn?part=1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] rtc: ma35d1: release the clock reference on probe failure
  2026-11-04  2:53 [PATCH] rtc: ma35d1: release the clock reference on probe failure Wentao Liang
  2026-11-04  3:00 ` sashiko-bot
@ 2026-11-04  7:10 ` Krzysztof Kozlowski
  1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2026-11-04  7:10 UTC (permalink / raw)
  To: Wentao Liang
  Cc: Jacky Huang, Shan-Chun Hung, Alexandre Belloni, linux-rtc,
	linux-arm-kernel


On Wed, 04 Nov 2026 02:53:39 +0000, Wentao Liang wrote:
> ma35d1_rtc_probe() gets the RTC clock with of_clk_get() and enables it
> with clk_prepare_enable(). The clock reference is never dropped and the
> clock is never disabled, not on the many later error returns and not on
> success either, since the driver has no remove callback. The reference
> and the enabled clock are leaked for every probe attempt.
> 
> Use devm_clk_get_enabled(), which ties both the reference and the
> enabled state to the device lifetime.
> 
> Fixes: dc0684adf3b6 ("rtc: Add driver for Nuvoton ma35d1 rtc controller")
> Cc: stable@vger.kernel.org
> Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
>  drivers/rtc/rtc-ma35d1.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 

Multiple things here:
1. Your team ignored completely previous feedback. Multiple times.

2. You use multiple identities with this email address, thus I doubt that we
   speak with an actual person.

3. Your bot does not even bother running checkpatch, right?

4. Nothing of this was reproduced nor tested.

5. Finally, the same feedback:
You sent multiple independent patches, to multiple independent
subsystems. The amount of these patches clearly suggest this was
AI generated and most likely not tested.

More importantly, you sent all this work without properly organizing
relevant patches into patchsets. This makes reviewing difficult
and might cause multiple reviewers to address the same issue.
Replying to the entire set is impossible and requires handling each
patch independently, instead of applying or discarding the set.
Maintainers also won't see the bigger picture of your work. Quite
worrying.

This is on the verge of hostile patch: bomb us with so many
contributions, we won't be able to handle them in efficient manner,
like responding ONCE to ask you to slow down.  Considering all this
is untested and LLM generated, I have even more doubts whether this
should be considered for review.

Please read kernel documentation BEFORE posting more work. It will
explain you how to identify subsystems, how to organize your work per
subsystem (so a patchset grouping multiple patches with a short cover
letter), how to document the issue discovery method and what was
or was not tested.

Best regards,
Krzysztof





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-04  7:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-04  2:53 [PATCH] rtc: ma35d1: release the clock reference on probe failure Wentao Liang
2026-11-04  3:00 ` sashiko-bot
2026-11-04  7:10 ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox