linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk:aspeed:Fix reset driver probe from builtin_platform to core_initcal
@ 2021-10-05  6:45 Ryan Chen
  2021-10-17  1:45 ` Stephen Boyd
  2021-12-13  1:49 ` Billy Tsai
  0 siblings, 2 replies; 4+ messages in thread
From: Ryan Chen @ 2021-10-05  6:45 UTC (permalink / raw)
  To: ryan_chen, Michael Turquette, Stephen Boyd, Joel Stanley,
	Andrew Jeffery, linux-clk, linux-kernel

Change the reset probe sequence from builtin_platform to core_initcal.
For avoid some driver is probe but failed due to reset driver not probe.

Fixes: d3d04f6c330a ("clk: Add support for AST2600 SoC")
Signed-off-by: Ryan Chen <ryan_chen@aspeedtech.com>
---
 drivers/clk/clk-ast2600.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/clk-ast2600.c b/drivers/clk/clk-ast2600.c
index 085d0a18b2b6..6293d8d1a6a8 100644
--- a/drivers/clk/clk-ast2600.c
+++ b/drivers/clk/clk-ast2600.c
@@ -686,7 +686,13 @@ static struct platform_driver aspeed_g6_clk_driver = {
 		.suppress_bind_attrs = true,
 	},
 };
-builtin_platform_driver(aspeed_g6_clk_driver);
+
+static int __init aspeed_g6_clk_init(void)
+{
+	return platform_driver_register(&aspeed_g6_clk_driver);
+}
+
+core_initcall(aspeed_g6_clk_init);
 
 static const u32 ast2600_a0_axi_ahb_div_table[] = {
 	2, 2, 3, 5,
-- 
2.17.1


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

* Re: [PATCH] clk:aspeed:Fix reset driver probe from builtin_platform to core_initcal
  2021-10-05  6:45 [PATCH] clk:aspeed:Fix reset driver probe from builtin_platform to core_initcal Ryan Chen
@ 2021-10-17  1:45 ` Stephen Boyd
  2021-10-18  0:54   ` Ryan Chen
  2021-12-13  1:49 ` Billy Tsai
  1 sibling, 1 reply; 4+ messages in thread
From: Stephen Boyd @ 2021-10-17  1:45 UTC (permalink / raw)
  To: Andrew Jeffery, Joel Stanley, Michael Turquette, linux-clk,
	linux-kernel, ryan_chen

Quoting Ryan Chen (2021-10-04 23:45:13)
> Change the reset probe sequence from builtin_platform to core_initcal.
> For avoid some driver is probe but failed due to reset driver not probe.

I don't get it. Does something never try probe again because it can't
get the reset it wants? I understand that builtin_platform_driver()
moves the initcall level later than core_initcall() so this is a
workaround for some driver probe ordering problem?

> 
> Fixes: d3d04f6c330a ("clk: Add support for AST2600 SoC")
> Signed-off-by: Ryan Chen <ryan_chen@aspeedtech.com>

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

* RE: [PATCH] clk:aspeed:Fix reset driver probe from builtin_platform to core_initcal
  2021-10-17  1:45 ` Stephen Boyd
@ 2021-10-18  0:54   ` Ryan Chen
  0 siblings, 0 replies; 4+ messages in thread
From: Ryan Chen @ 2021-10-18  0:54 UTC (permalink / raw)
  To: Stephen Boyd, Andrew Jeffery, Joel Stanley, Michael Turquette,
	linux-clk, linux-kernel

Hello,
> -----Original Message-----
> From: Stephen Boyd <sboyd@kernel.org>
> Sent: Sunday, October 17, 2021 9:45 AM
> To: Andrew Jeffery <andrew@aj.id.au>; Joel Stanley <joel@jms.id.au>; Michael
> Turquette <mturquette@baylibre.com>; linux-clk@vger.kernel.org;
> linux-kernel@vger.kernel.org; Ryan Chen <ryan_chen@aspeedtech.com>
> Subject: Re: [PATCH] clk:aspeed:Fix reset driver probe from builtin_platform to
> core_initcal
> 
> Quoting Ryan Chen (2021-10-04 23:45:13)
> > Change the reset probe sequence from builtin_platform to core_initcal.
> > For avoid some driver is probe but failed due to reset driver not probe.
> 
> I don't get it. Does something never try probe again because it can't get the
> reset it wants? I understand that builtin_platform_driver() moves the initcall
> level later than core_initcall() so this is a workaround for some driver probe
> ordering problem?
The most of driver have reset function in probe. if driver probe need do the reset 
(ex: devm_reset_control_get_shared) but reset driver not ready (devm_reset_controller_register),
that driver probe will cause the fail, than after reset driver probe, there will have second probe In driver. 
That the reason I put reset probe in core_initcall.
And also you can see that the reason most soc chip do the devm_reset_controller_register in core_initcall.

> 
> >
> > Fixes: d3d04f6c330a ("clk: Add support for AST2600 SoC")
> > Signed-off-by: Ryan Chen <ryan_chen@aspeedtech.com>

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

* Re: [PATCH] clk:aspeed:Fix reset driver probe from builtin_platform to core_initcal
  2021-10-05  6:45 [PATCH] clk:aspeed:Fix reset driver probe from builtin_platform to core_initcal Ryan Chen
  2021-10-17  1:45 ` Stephen Boyd
@ 2021-12-13  1:49 ` Billy Tsai
  1 sibling, 0 replies; 4+ messages in thread
From: Billy Tsai @ 2021-12-13  1:49 UTC (permalink / raw)
  To: Ryan Chen, Michael Turquette, Stephen Boyd, Joel Stanley,
	Andrew Jeffery, linux-clk, linux-kernel

On 2021/10/5, 2:45 PM, "Ryan Chen" <ryan_chen@aspeedtech.com> wrote:

    >   Change the reset probe sequence from builtin_platform to core_initcal.
    >   For avoid some driver is probe but failed due to reset driver not probe.

    >   Fixes: d3d04f6c330a ("clk: Add support for AST2600 SoC")
    >   Signed-off-by: Ryan Chen <ryan_chen@aspeedtech.com>

Reviewed-by: Billy Tsai <billy_tsai@aspeedtech.com>

    >   ---
    >    drivers/clk/clk-ast2600.c | 8 +++++++-
    >    1 file changed, 7 insertions(+), 1 deletion(-)
     
    >   diff --git a/drivers/clk/clk-ast2600.c b/drivers/clk/clk-ast2600.c
    >   index 085d0a18b2b6..6293d8d1a6a8 100644
    >   --- a/drivers/clk/clk-ast2600.c
    >   +++ b/drivers/clk/clk-ast2600.c
    >   @@ -686,7 +686,13 @@ static struct platform_driver aspeed_g6_clk_driver = {
    >    		.suppress_bind_attrs = true,
    >    	},
    >    };
    >   -builtin_platform_driver(aspeed_g6_clk_driver);
    >   +
    >   +static int __init aspeed_g6_clk_init(void)
    >   +{
    >   +	return platform_driver_register(&aspeed_g6_clk_driver);
    >   +}
    >   +
    >   +core_initcall(aspeed_g6_clk_init);
      
    >    static const u32 ast2600_a0_axi_ahb_div_table[] = {
    >    	2, 2, 3, 5,
    >   -- 
    >   2.17.1




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

end of thread, other threads:[~2021-12-13  1:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-05  6:45 [PATCH] clk:aspeed:Fix reset driver probe from builtin_platform to core_initcal Ryan Chen
2021-10-17  1:45 ` Stephen Boyd
2021-10-18  0:54   ` Ryan Chen
2021-12-13  1:49 ` Billy Tsai

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).