* [PATCH] mmc: sdhci-of-arasan: Unregister all clock providers
@ 2026-11-03 10:05 Wentao Liang
2026-11-03 10:26 ` Krzysztof Kozlowski
2026-11-04 18:23 ` Adrian Hunter
0 siblings, 2 replies; 3+ messages in thread
From: Wentao Liang @ 2026-11-03 10:05 UTC (permalink / raw)
To: Michal Simek, Adrian Hunter, Ulf Hansson
Cc: linux-arm-kernel, linux-mmc, linux-kernel, Wentao Liang, stable
When #clock-cells is non-zero, sdhci_arasan_register_sdclk() registers
two clock providers for the same device node: one for the card clock and
one for the sample clock. of_clk_add_provider() takes a reference to
the device node for each registration, but the unregister helper only
calls of_clk_del_provider() once. The second device node reference is
therefore leaked and the sample clock provider remains registered after
the driver has been unbound.
Drop one provider for every clock that was registered.
Fixes: 07a14d1df454 ("mmc: sdhci-of-arasan: Add sampling clock for a phy to use")
Cc: stable@vger.kernel.org
Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
drivers/mmc/host/sdhci-of-arasan.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
index 0ee22923ad56..dccd2980fdd6 100644
--- a/drivers/mmc/host/sdhci-of-arasan.c
+++ b/drivers/mmc/host/sdhci-of-arasan.c
@@ -1648,11 +1648,20 @@ sdhci_arasan_register_sampleclk(struct sdhci_arasan_data *sdhci_arasan,
static void sdhci_arasan_unregister_sdclk(struct device *dev)
{
struct device_node *np = dev->of_node;
+ u32 num_clks = 0;
- if (!of_property_present(np, "#clock-cells"))
+ if (of_property_read_u32(np, "#clock-cells", &num_clks) < 0)
return;
- of_clk_del_provider(dev->of_node);
+ of_clk_del_provider(np);
+
+ /*
+ * sdhci_arasan_register_sdclk() registers a second provider for the
+ * sample clock when #clock-cells is non-zero, and each provider holds
+ * its own reference to the device node.
+ */
+ if (num_clks)
+ of_clk_del_provider(np);
}
/**
--
2.34.1
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] mmc: sdhci-of-arasan: Unregister all clock providers
2026-11-03 10:05 [PATCH] mmc: sdhci-of-arasan: Unregister all clock providers Wentao Liang
@ 2026-11-03 10:26 ` Krzysztof Kozlowski
2026-11-04 18:23 ` Adrian Hunter
1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2026-11-03 10:26 UTC (permalink / raw)
To: Wentao Liang
Cc: linux-mmc, Adrian Hunter, Ulf Hansson, stable, linux-kernel,
Michal Simek, linux-arm-kernel
On Tue, 03 Nov 2026 10:05:21 +0000, Wentao Liang wrote:
> When #clock-cells is non-zero, sdhci_arasan_register_sdclk() registers
> two clock providers for the same device node: one for the card clock and
> one for the sample clock. of_clk_add_provider() takes a reference to
> the device node for each registration, but the unregister helper only
> calls of_clk_del_provider() once. The second device node reference is
> therefore leaked and the sample clock provider remains registered after
> the driver has been unbound.
>
> Drop one provider for every clock that was registered.
>
> Fixes: 07a14d1df454 ("mmc: sdhci-of-arasan: Add sampling clock for a phy to use")
> Cc: stable@vger.kernel.org
> Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
> drivers/mmc/host/sdhci-of-arasan.c | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 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* Re: [PATCH] mmc: sdhci-of-arasan: Unregister all clock providers
2026-11-03 10:05 [PATCH] mmc: sdhci-of-arasan: Unregister all clock providers Wentao Liang
2026-11-03 10:26 ` Krzysztof Kozlowski
@ 2026-11-04 18:23 ` Adrian Hunter
1 sibling, 0 replies; 3+ messages in thread
From: Adrian Hunter @ 2026-11-04 18:23 UTC (permalink / raw)
To: Wentao Liang, Michal Simek, Ulf Hansson, swati.agarwal
Cc: linux-arm-kernel, linux-mmc, linux-kernel, stable
On 03/11/2026 12:05, Wentao Liang wrote:
> When #clock-cells is non-zero, sdhci_arasan_register_sdclk() registers
> two clock providers for the same device node: one for the card clock and
> one for the sample clock. of_clk_add_provider() takes a reference to
> the device node for each registration, but the unregister helper only
> calls of_clk_del_provider() once. The second device node reference is
> therefore leaked and the sample clock provider remains registered after
> the driver has been unbound.
>
> Drop one provider for every clock that was registered.
>
> Fixes: 07a14d1df454 ("mmc: sdhci-of-arasan: Add sampling clock for a phy to use")
> Cc: stable@vger.kernel.org
> Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
"Assisted-by" tag is not used anymore
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Looks OK to me but maybe someone who uses this code could
review or test it, since Krzysztof has cast some doubt on the
contributor.
> ---
> drivers/mmc/host/sdhci-of-arasan.c | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
> index 0ee22923ad56..dccd2980fdd6 100644
> --- a/drivers/mmc/host/sdhci-of-arasan.c
> +++ b/drivers/mmc/host/sdhci-of-arasan.c
> @@ -1648,11 +1648,20 @@ sdhci_arasan_register_sampleclk(struct sdhci_arasan_data *sdhci_arasan,
> static void sdhci_arasan_unregister_sdclk(struct device *dev)
> {
> struct device_node *np = dev->of_node;
> + u32 num_clks = 0;
>
> - if (!of_property_present(np, "#clock-cells"))
> + if (of_property_read_u32(np, "#clock-cells", &num_clks) < 0)
> return;
>
> - of_clk_del_provider(dev->of_node);
> + of_clk_del_provider(np);
> +
> + /*
> + * sdhci_arasan_register_sdclk() registers a second provider for the
> + * sample clock when #clock-cells is non-zero, and each provider holds
> + * its own reference to the device node.
> + */
> + if (num_clks)
> + of_clk_del_provider(np);
> }
>
> /**
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-04 18:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-03 10:05 [PATCH] mmc: sdhci-of-arasan: Unregister all clock providers Wentao Liang
2026-11-03 10:26 ` Krzysztof Kozlowski
2026-11-04 18:23 ` Adrian Hunter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®