* [PATCH 0/2] clk: renesas: rzg2l: Disable unused clocks after resume
@ 2025-08-21 8:03 Claudiu
2025-08-21 8:03 ` [PATCH 1/2] clk: Export clk_disable_unused() Claudiu
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Claudiu @ 2025-08-21 8:03 UTC (permalink / raw)
To: mturquette, sboyd, geert+renesas, linux
Cc: claudiu.beznea, linux-renesas-soc, linux-arm-kernel, linux-clk,
linux-kernel, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Hi,
This series disables clocks that remain unused after resume.
This is necessary when the resume process is done with the help of the
bootloader, as the bootloader enables various clocks when returning from
resume.
On the RZ/G3S SoC (where this series was tested), the bootloader enables
the SDHI clocks (for all SDHI modules, of which 2 are used by Linux and
1 is unused) and the clocks for a serial IP (unused by Linux).
Testing was done on the RZ/G3S SMARC Carrier II board.
Thank you,
Claudiu Benea
Claudiu Beznea (2):
clk: Export clk_disable_unused()
clk: renesas: rzg2l: Register PM notifier to disable unused clocks
drivers/clk/clk.c | 9 +++++----
drivers/clk/renesas/rzg2l-cpg.c | 24 ++++++++++++++++++++++++
include/linux/clk.h | 12 ++++++++++++
3 files changed, 41 insertions(+), 4 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] clk: Export clk_disable_unused()
2025-08-21 8:03 [PATCH 0/2] clk: renesas: rzg2l: Disable unused clocks after resume Claudiu
@ 2025-08-21 8:03 ` Claudiu
2025-08-21 8:03 ` [PATCH 2/2] clk: renesas: rzg2l: Register PM notifier to disable unused clocks Claudiu
2025-08-25 17:05 ` [PATCH 0/2] clk: renesas: rzg2l: Disable unused clocks after resume Brian Masney
2 siblings, 0 replies; 9+ messages in thread
From: Claudiu @ 2025-08-21 8:03 UTC (permalink / raw)
To: mturquette, sboyd, geert+renesas, linux
Cc: claudiu.beznea, linux-renesas-soc, linux-arm-kernel, linux-clk,
linux-kernel, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
The Renesas RZ/G3S SoC has a suspend mode where power to most components is
turned off and RAM is switched to self-refresh. Resuming from this
low-power mode is done with the help of the bootloader. During resume, the
bootloader re-enables the clocks for the modules needed in the resume
process (e.g. SDHI or serial). After that, control is passed to Linux.
If Linux has not probed a driver for one of the modules enabled by the
bootloader, or if the module was previously in a runtime-suspended state,
the corresponding clocks remain enabled after resume, even though they have
no consumers or they were previously disabled.
To avoid keeping these clocks enabled unnecessarily, make the
clk_disable_unused() function available to other drivers. Drivers can then
call it during resume to disable any unused clocks.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
drivers/clk/clk.c | 9 +++++----
include/linux/clk.h | 12 ++++++++++++
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index b821b2cdb155..5278030b0ad8 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1460,7 +1460,7 @@ static void clk_core_disable_unprepare(struct clk_core *core)
clk_core_unprepare_lock(core);
}
-static void __init clk_unprepare_unused_subtree(struct clk_core *core)
+static void clk_unprepare_unused_subtree(struct clk_core *core)
{
struct clk_core *child;
@@ -1485,7 +1485,7 @@ static void __init clk_unprepare_unused_subtree(struct clk_core *core)
}
}
-static void __init clk_disable_unused_subtree(struct clk_core *core)
+static void clk_disable_unused_subtree(struct clk_core *core)
{
struct clk_core *child;
unsigned long flags;
@@ -1526,7 +1526,7 @@ static void __init clk_disable_unused_subtree(struct clk_core *core)
clk_core_disable_unprepare(core->parent);
}
-static bool clk_ignore_unused __initdata;
+static bool clk_ignore_unused;
static int __init clk_ignore_unused_setup(char *__unused)
{
clk_ignore_unused = true;
@@ -1534,7 +1534,7 @@ static int __init clk_ignore_unused_setup(char *__unused)
}
__setup("clk_ignore_unused", clk_ignore_unused_setup);
-static int __init clk_disable_unused(void)
+int clk_disable_unused(void)
{
struct clk_core *core;
int ret;
@@ -1574,6 +1574,7 @@ static int __init clk_disable_unused(void)
return 0;
}
late_initcall_sync(clk_disable_unused);
+EXPORT_SYMBOL_GPL(clk_disable_unused);
static int clk_core_determine_round_nolock(struct clk_core *core,
struct clk_rate_request *req)
diff --git a/include/linux/clk.h b/include/linux/clk.h
index b607482ca77e..7eb0e5eb9aba 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -950,6 +950,13 @@ int clk_save_context(void);
*/
void clk_restore_context(void);
+/**
+ * clk_disable_unused - disable unused clocks
+ *
+ * Disable unused clocks at boot or resume time.
+ */
+int clk_disable_unused(void);
+
#else /* !CONFIG_HAVE_CLK */
static inline struct clk *clk_get(struct device *dev, const char *id)
@@ -1136,6 +1143,11 @@ static inline int clk_save_context(void)
static inline void clk_restore_context(void) {}
+static inline int clk_disbale_unused(void)
+{
+ return 0;
+}
+
#endif
/* clk_prepare_enable helps cases using clk_enable in non-atomic context. */
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] clk: renesas: rzg2l: Register PM notifier to disable unused clocks
2025-08-21 8:03 [PATCH 0/2] clk: renesas: rzg2l: Disable unused clocks after resume Claudiu
2025-08-21 8:03 ` [PATCH 1/2] clk: Export clk_disable_unused() Claudiu
@ 2025-08-21 8:03 ` Claudiu
2025-08-25 17:05 ` [PATCH 0/2] clk: renesas: rzg2l: Disable unused clocks after resume Brian Masney
2 siblings, 0 replies; 9+ messages in thread
From: Claudiu @ 2025-08-21 8:03 UTC (permalink / raw)
To: mturquette, sboyd, geert+renesas, linux
Cc: claudiu.beznea, linux-renesas-soc, linux-arm-kernel, linux-clk,
linux-kernel, Claudiu Beznea
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Register a PM notifier to disable unused clocks after system resume.
This is necessary when resuming from a low-power mode where the bootloader
re-enables certain module clocks for its own use.
To avoid keeping these clocks enabled after control is passed back to
Linux, call clk_disable_unused() from a PM_POST_SUSPEND notifier.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
drivers/clk/renesas/rzg2l-cpg.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/clk/renesas/rzg2l-cpg.c b/drivers/clk/renesas/rzg2l-cpg.c
index 187233302818..2ca32d7acaf7 100644
--- a/drivers/clk/renesas/rzg2l-cpg.c
+++ b/drivers/clk/renesas/rzg2l-cpg.c
@@ -24,6 +24,7 @@
#include <linux/iopoll.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
+#include <linux/notifier.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm_clock.h>
@@ -31,6 +32,7 @@
#include <linux/reset-controller.h>
#include <linux/slab.h>
#include <linux/string_choices.h>
+#include <linux/suspend.h>
#include <linux/units.h>
#include <dt-bindings/clock/renesas-cpg-mssr.h>
@@ -150,6 +152,7 @@ struct rzg2l_pll5_mux_dsi_div_param {
* @info: Pointer to platform data
* @genpd: PM domain
* @mux_dsi_div_params: pll5 mux and dsi div parameters
+ * @pm_notifier: PM notifier
*/
struct rzg2l_cpg_priv {
struct reset_controller_dev rcdev;
@@ -168,6 +171,8 @@ struct rzg2l_cpg_priv {
struct generic_pm_domain genpd;
struct rzg2l_pll5_mux_dsi_div_param mux_dsi_div_params;
+
+ struct notifier_block pm_notifier;
};
static void rzg2l_cpg_del_clk_provider(void *data)
@@ -1879,6 +1884,21 @@ static int __init rzg2l_cpg_add_clk_domain(struct rzg2l_cpg_priv *priv)
return of_genpd_add_provider_simple(np, genpd);
}
+static int rzg2l_pm_notifier(struct notifier_block *nb, unsigned long action,
+ void *data)
+{
+ int ret;
+
+ if (action != PM_POST_SUSPEND)
+ return 0;
+
+ ret = clk_disable_unused();
+ if (ret)
+ return NOTIFY_BAD;
+
+ return NOTIFY_OK;
+}
+
static int __init rzg2l_cpg_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -1948,6 +1968,10 @@ static int __init rzg2l_cpg_probe(struct platform_device *pdev)
return error;
debugfs_create_file("mstop", 0444, NULL, priv, &rzg2l_mod_clock_mstop_fops);
+
+ priv->pm_notifier.notifier_call = rzg2l_pm_notifier;
+ register_pm_notifier(&priv->pm_notifier);
+
return 0;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] clk: renesas: rzg2l: Disable unused clocks after resume
2025-08-21 8:03 [PATCH 0/2] clk: renesas: rzg2l: Disable unused clocks after resume Claudiu
2025-08-21 8:03 ` [PATCH 1/2] clk: Export clk_disable_unused() Claudiu
2025-08-21 8:03 ` [PATCH 2/2] clk: renesas: rzg2l: Register PM notifier to disable unused clocks Claudiu
@ 2025-08-25 17:05 ` Brian Masney
2025-08-26 11:01 ` claudiu beznea
2 siblings, 1 reply; 9+ messages in thread
From: Brian Masney @ 2025-08-25 17:05 UTC (permalink / raw)
To: Claudiu
Cc: mturquette, sboyd, geert+renesas, linux, linux-renesas-soc,
linux-arm-kernel, linux-clk, linux-kernel, Claudiu Beznea
Hi Claudiu,
On Thu, Aug 21, 2025 at 11:03:30AM +0300, Claudiu wrote:
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>
> Hi,
>
> This series disables clocks that remain unused after resume.
> This is necessary when the resume process is done with the help of the
> bootloader, as the bootloader enables various clocks when returning from
> resume.
>
> On the RZ/G3S SoC (where this series was tested), the bootloader enables
> the SDHI clocks (for all SDHI modules, of which 2 are used by Linux and
> 1 is unused) and the clocks for a serial IP (unused by Linux).
>
> Testing was done on the RZ/G3S SMARC Carrier II board.
Do you think that other boards would also benefit from this change? If
so, what do you think about putting the call to register_pm_notifier()
inside an __init block in clk.c so that this same change doesn't have to
be implemented across various clk drivers?
Alternatively, if this is board specific, could this be fixed in the
boot loader so that the clock that's not used by Linus is properly shut
down on resume?
I'm not the subsystem maintainer, so I'm not asking you to make any of
these changes.
Brian
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] clk: renesas: rzg2l: Disable unused clocks after resume
2025-08-25 17:05 ` [PATCH 0/2] clk: renesas: rzg2l: Disable unused clocks after resume Brian Masney
@ 2025-08-26 11:01 ` claudiu beznea
2025-08-26 11:52 ` Brian Masney
0 siblings, 1 reply; 9+ messages in thread
From: claudiu beznea @ 2025-08-26 11:01 UTC (permalink / raw)
To: Brian Masney
Cc: mturquette, sboyd, geert+renesas, linux, linux-renesas-soc,
linux-arm-kernel, linux-clk, linux-kernel, Claudiu Beznea
Hi, Brian,
On 8/25/25 20:05, Brian Masney wrote:
> Hi Claudiu,
>
> On Thu, Aug 21, 2025 at 11:03:30AM +0300, Claudiu wrote:
>> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>>
>> Hi,
>>
>> This series disables clocks that remain unused after resume.
>> This is necessary when the resume process is done with the help of the
>> bootloader, as the bootloader enables various clocks when returning from
>> resume.
>>
>> On the RZ/G3S SoC (where this series was tested), the bootloader enables
>> the SDHI clocks (for all SDHI modules, of which 2 are used by Linux and
>> 1 is unused) and the clocks for a serial IP (unused by Linux).
>>
>> Testing was done on the RZ/G3S SMARC Carrier II board.
>
> Do you think that other boards would also benefit from this change? If
> so, what do you think about putting the call to register_pm_notifier()
> inside an __init block in clk.c so that this same change doesn't have to
> be implemented across various clk drivers?
Yes, that was my other approach I was thinking about. I wanted to see how other
people consider this version.
>
> Alternatively, if this is board specific, could this be fixed in the
> boot loader so that the clock that's not used by Linus is properly shut
> down on resume?
As a result of your request I did some more investigations on my side, I can say
that, yes, in theory that could be also handled by bootloader.
I can drop this and try to do it in bootloader, if any. Please let me know if
you still consider this (or the variant that implements it in a generic way)
necessary.
Thank you for your review,
Claudiu
>
> I'm not the subsystem maintainer, so I'm not asking you to make any of
> these changes.
>
> Brian
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] clk: renesas: rzg2l: Disable unused clocks after resume
2025-08-26 11:01 ` claudiu beznea
@ 2025-08-26 11:52 ` Brian Masney
2025-08-30 11:29 ` Claudiu Beznea
2025-09-01 9:46 ` Geert Uytterhoeven
0 siblings, 2 replies; 9+ messages in thread
From: Brian Masney @ 2025-08-26 11:52 UTC (permalink / raw)
To: claudiu beznea
Cc: mturquette, sboyd, geert+renesas, linux, linux-renesas-soc,
linux-arm-kernel, linux-clk, linux-kernel, Claudiu Beznea
Hi Claudiu,
On Tue, Aug 26, 2025 at 02:01:56PM +0300, claudiu beznea wrote:
> On 8/25/25 20:05, Brian Masney wrote:
> > On Thu, Aug 21, 2025 at 11:03:30AM +0300, Claudiu wrote:
> > > From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> > > This series disables clocks that remain unused after resume.
> > > This is necessary when the resume process is done with the help of the
> > > bootloader, as the bootloader enables various clocks when returning from
> > > resume.
> > >
> > > On the RZ/G3S SoC (where this series was tested), the bootloader enables
> > > the SDHI clocks (for all SDHI modules, of which 2 are used by Linux and
> > > 1 is unused) and the clocks for a serial IP (unused by Linux).
> > >
> > > Testing was done on the RZ/G3S SMARC Carrier II board.
> >
> > Do you think that other boards would also benefit from this change? If
> > so, what do you think about putting the call to register_pm_notifier()
> > inside an __init block in clk.c so that this same change doesn't have to
> > be implemented across various clk drivers?
>
> Yes, that was my other approach I was thinking about. I wanted to see how
> other people consider this version.
>
> >
> > Alternatively, if this is board specific, could this be fixed in the
> > boot loader so that the clock that's not used by Linus is properly shut
> > down on resume?
>
> As a result of your request I did some more investigations on my side, I can
> say that, yes, in theory that could be also handled by bootloader.
>
> I can drop this and try to do it in bootloader, if any. Please let me know
> if you still consider this (or the variant that implements it in a generic
> way) necessary.
Personally I would go the route of fixing this in the bootloader for
this particular platform.
If this issue affects other platforms, particularly across multiple
SoC vendors, then I think it would be worthwhile to have a discussion
about adding this functionality to the clk core.
Brian
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] clk: renesas: rzg2l: Disable unused clocks after resume
2025-08-26 11:52 ` Brian Masney
@ 2025-08-30 11:29 ` Claudiu Beznea
2025-09-01 9:46 ` Geert Uytterhoeven
1 sibling, 0 replies; 9+ messages in thread
From: Claudiu Beznea @ 2025-08-30 11:29 UTC (permalink / raw)
To: Brian Masney, Stephen Boyd
Cc: mturquette, sboyd, geert+renesas, linux, linux-renesas-soc,
linux-arm-kernel, linux-clk, linux-kernel, Claudiu Beznea
Hi, Stephen,
On 26.08.2025 14:52, Brian Masney wrote:
> Hi Claudiu,
>
> On Tue, Aug 26, 2025 at 02:01:56PM +0300, claudiu beznea wrote:
>> On 8/25/25 20:05, Brian Masney wrote:
>>> On Thu, Aug 21, 2025 at 11:03:30AM +0300, Claudiu wrote:
>>>> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>>>> This series disables clocks that remain unused after resume.
>>>> This is necessary when the resume process is done with the help of the
>>>> bootloader, as the bootloader enables various clocks when returning from
>>>> resume.
>>>>
>>>> On the RZ/G3S SoC (where this series was tested), the bootloader enables
>>>> the SDHI clocks (for all SDHI modules, of which 2 are used by Linux and
>>>> 1 is unused) and the clocks for a serial IP (unused by Linux).
>>>>
>>>> Testing was done on the RZ/G3S SMARC Carrier II board.
>>>
>>> Do you think that other boards would also benefit from this change? If
>>> so, what do you think about putting the call to register_pm_notifier()
>>> inside an __init block in clk.c so that this same change doesn't have to
>>> be implemented across various clk drivers?
>>
>> Yes, that was my other approach I was thinking about. I wanted to see how
>> other people consider this version.
>>
>>>
>>> Alternatively, if this is board specific, could this be fixed in the
>>> boot loader so that the clock that's not used by Linus is properly shut
>>> down on resume?
>>
>> As a result of your request I did some more investigations on my side, I can
>> say that, yes, in theory that could be also handled by bootloader.
>>
>> I can drop this and try to do it in bootloader, if any. Please let me know
>> if you still consider this (or the variant that implements it in a generic
>> way) necessary.
>
> Personally I would go the route of fixing this in the bootloader for
> this particular platform.
>
> If this issue affects other platforms, particularly across multiple
> SoC vendors, then I think it would be worthwhile to have a discussion
> about adding this functionality to the clk core.
>
Could you please let us know if you prefer a mechanism like
clk_disable_unused() in Linux for resume path?
Thank you,
Claudiu
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] clk: renesas: rzg2l: Disable unused clocks after resume
2025-08-26 11:52 ` Brian Masney
2025-08-30 11:29 ` Claudiu Beznea
@ 2025-09-01 9:46 ` Geert Uytterhoeven
2025-09-02 13:24 ` Brian Masney
1 sibling, 1 reply; 9+ messages in thread
From: Geert Uytterhoeven @ 2025-09-01 9:46 UTC (permalink / raw)
To: Brian Masney
Cc: claudiu beznea, mturquette, sboyd, geert+renesas, linux,
linux-renesas-soc, linux-arm-kernel, linux-clk, linux-kernel,
Claudiu Beznea
Hi Brian,
On Tue, 26 Aug 2025 at 13:52, Brian Masney <bmasney@redhat.com> wrote:
> On Tue, Aug 26, 2025 at 02:01:56PM +0300, claudiu beznea wrote:
> > On 8/25/25 20:05, Brian Masney wrote:
> > > On Thu, Aug 21, 2025 at 11:03:30AM +0300, Claudiu wrote:
> > > > From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> > > > This series disables clocks that remain unused after resume.
> > > > This is necessary when the resume process is done with the help of the
> > > > bootloader, as the bootloader enables various clocks when returning from
> > > > resume.
> > > >
> > > > On the RZ/G3S SoC (where this series was tested), the bootloader enables
> > > > the SDHI clocks (for all SDHI modules, of which 2 are used by Linux and
> > > > 1 is unused) and the clocks for a serial IP (unused by Linux).
> > > >
> > > > Testing was done on the RZ/G3S SMARC Carrier II board.
> > >
> > > Do you think that other boards would also benefit from this change? If
> > > so, what do you think about putting the call to register_pm_notifier()
> > > inside an __init block in clk.c so that this same change doesn't have to
> > > be implemented across various clk drivers?
> >
> > Yes, that was my other approach I was thinking about. I wanted to see how
> > other people consider this version.
> >
> > > Alternatively, if this is board specific, could this be fixed in the
> > > boot loader so that the clock that's not used by Linus is properly shut
> > > down on resume?
> >
> > As a result of your request I did some more investigations on my side, I can
> > say that, yes, in theory that could be also handled by bootloader.
> >
> > I can drop this and try to do it in bootloader, if any. Please let me know
> > if you still consider this (or the variant that implements it in a generic
> > way) necessary.
>
> Personally I would go the route of fixing this in the bootloader for
> this particular platform.
>
> If this issue affects other platforms, particularly across multiple
> SoC vendors, then I think it would be worthwhile to have a discussion
> about adding this functionality to the clk core.
How would the bootloader know which clocks are not used by Linux?
And why to offload this to the bootloader for resume, but not for boot?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] clk: renesas: rzg2l: Disable unused clocks after resume
2025-09-01 9:46 ` Geert Uytterhoeven
@ 2025-09-02 13:24 ` Brian Masney
0 siblings, 0 replies; 9+ messages in thread
From: Brian Masney @ 2025-09-02 13:24 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: claudiu beznea, mturquette, sboyd, geert+renesas, linux,
linux-renesas-soc, linux-arm-kernel, linux-clk, linux-kernel,
Claudiu Beznea
Hi Geert,
On Mon, Sep 01, 2025 at 11:46:34AM +0200, Geert Uytterhoeven wrote:
> On Tue, 26 Aug 2025 at 13:52, Brian Masney <bmasney@redhat.com> wrote:
> > On Tue, Aug 26, 2025 at 02:01:56PM +0300, claudiu beznea wrote:
> > > On 8/25/25 20:05, Brian Masney wrote:
> > > > On Thu, Aug 21, 2025 at 11:03:30AM +0300, Claudiu wrote:
> > > > > From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> > > > > This series disables clocks that remain unused after resume.
> > > > > This is necessary when the resume process is done with the help of the
> > > > > bootloader, as the bootloader enables various clocks when returning from
> > > > > resume.
> > > > >
> > > > > On the RZ/G3S SoC (where this series was tested), the bootloader enables
> > > > > the SDHI clocks (for all SDHI modules, of which 2 are used by Linux and
> > > > > 1 is unused) and the clocks for a serial IP (unused by Linux).
> > > > >
> > > > > Testing was done on the RZ/G3S SMARC Carrier II board.
> > > >
> > > > Do you think that other boards would also benefit from this change? If
> > > > so, what do you think about putting the call to register_pm_notifier()
> > > > inside an __init block in clk.c so that this same change doesn't have to
> > > > be implemented across various clk drivers?
> > >
> > > Yes, that was my other approach I was thinking about. I wanted to see how
> > > other people consider this version.
> > >
> > > > Alternatively, if this is board specific, could this be fixed in the
> > > > boot loader so that the clock that's not used by Linus is properly shut
> > > > down on resume?
> > >
> > > As a result of your request I did some more investigations on my side, I can
> > > say that, yes, in theory that could be also handled by bootloader.
> > >
> > > I can drop this and try to do it in bootloader, if any. Please let me know
> > > if you still consider this (or the variant that implements it in a generic
> > > way) necessary.
> >
> > Personally I would go the route of fixing this in the bootloader for
> > this particular platform.
> >
> > If this issue affects other platforms, particularly across multiple
> > SoC vendors, then I think it would be worthwhile to have a discussion
> > about adding this functionality to the clk core.
>
> How would the bootloader know which clocks are not used by Linux?
> And why to offload this to the bootloader for resume, but not for boot?
If the bootloader is involved with resume, then I assume that it's also
involved with suspend as well? If so, could the boot loader save the
state of the 3 clocks on suspend, and set them back to that same state
on resume?
How widespread is this issue? Does it just affect this board, or is it
common across other boards?
There are some longstanding issues with clk_disable_unused that Stephen
talked about at Linux Plumbers almost two years ago [1]. We'll have to
wait to hear back from him, however I suspect he may be reluctant to
expand the scope of clk_disable_unused even further given the existing
issues.
[1] https://www.youtube.com/watch?v=tXYzM8yLIQA
Brian
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-09-02 19:11 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-21 8:03 [PATCH 0/2] clk: renesas: rzg2l: Disable unused clocks after resume Claudiu
2025-08-21 8:03 ` [PATCH 1/2] clk: Export clk_disable_unused() Claudiu
2025-08-21 8:03 ` [PATCH 2/2] clk: renesas: rzg2l: Register PM notifier to disable unused clocks Claudiu
2025-08-25 17:05 ` [PATCH 0/2] clk: renesas: rzg2l: Disable unused clocks after resume Brian Masney
2025-08-26 11:01 ` claudiu beznea
2025-08-26 11:52 ` Brian Masney
2025-08-30 11:29 ` Claudiu Beznea
2025-09-01 9:46 ` Geert Uytterhoeven
2025-09-02 13:24 ` Brian Masney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).