linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: exynos5420: Keep aclk66_peric enabled during boot
@ 2014-05-29 21:21 Doug Anderson
  2014-05-29 22:29 ` Mike Turquette
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Doug Anderson @ 2014-05-29 21:21 UTC (permalink / raw)
  To: linux-arm-kernel

Right now if you've got earlyprintk enabled on exynos5420-peach-pit
then you'll get a hang on boot.  Here's why:

1. The i2c-s3c2410 driver will probe at subsys_initcall.  It will
   enable its clock and disable it.  This is the clock "i2c2".
2. The act of disabling "i2c2" will disable its parents.  In this case
   the parent is "aclk66_peric".  There are no other children of
   "aclk66_peric" officially enabled, so "aclk66_peric" will be turned
   off (despite being CLK_IGNORE_UNUSED, but that's by design).
3. The next time you try to earlyprintk you'll do so without the UART
   clock enabled.  That's because the UART clocks are also children of
   "aclk66_peric".  You'll hang.

There's no good place to put a clock enable for earlyprintk, which is
handled by a bunch of assembly code.  The best we can do is to handle
this in the clock driver.

Signed-off-by: Doug Anderson <dianders@chromium.org>
---
 drivers/clk/samsung/clk-exynos5420.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c
index 9d7d7ee..1e586be 100644
--- a/drivers/clk/samsung/clk-exynos5420.c
+++ b/drivers/clk/samsung/clk-exynos5420.c
@@ -1172,11 +1172,17 @@ static struct of_device_id ext_clk_match[] __initdata = {
 	{ },
 };
 
+/* Keep these clocks on until late_initcall */
+static const char *boot_clocks[] __initconst = {
+	"aclk66_peric",
+};
+
 /* register exynos5420 clocks */
 static void __init exynos5x_clk_init(struct device_node *np,
 		enum exynos5x_soc soc)
 {
 	struct samsung_clk_provider *ctx;
+	int i;
 
 	if (np) {
 		reg_base = of_iomap(np, 0);
@@ -1226,6 +1232,12 @@ static void __init exynos5x_clk_init(struct device_node *np,
 	}
 
 	exynos5420_clk_sleep_init();
+
+	for (i = 0; i < ARRAY_SIZE(boot_clocks); i++) {
+		struct clk *to_enable = __clk_lookup(boot_clocks[i]);
+
+		clk_prepare_enable(to_enable);
+	}
 }
 
 static void __init exynos5420_clk_init(struct device_node *np)
@@ -1239,3 +1251,15 @@ static void __init exynos5800_clk_init(struct device_node *np)
 	exynos5x_clk_init(np, EXYNOS5800);
 }
 CLK_OF_DECLARE(exynos5800_clk, "samsung,exynos5800-clock", exynos5800_clk_init);
+
+static int __init exynos5420_clk_late_init(void)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(boot_clocks); i++) {
+		struct clk *to_disable = __clk_lookup(boot_clocks[i]);
+
+		clk_disable_unprepare(to_disable);
+	}
+}
+late_initcall(exynos5420_clk_late_init);
-- 
1.9.1.423.g4596e3a

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

* [PATCH] clk: exynos5420: Keep aclk66_peric enabled during boot
  2014-05-29 21:21 [PATCH] clk: exynos5420: Keep aclk66_peric enabled during boot Doug Anderson
@ 2014-05-29 22:29 ` Mike Turquette
  2014-05-30  5:02   ` Tomasz Figa
  2014-05-30 14:00 ` Javier Martinez Canillas
  2014-05-30 16:32 ` [PATCH v2] " Doug Anderson
  2 siblings, 1 reply; 22+ messages in thread
From: Mike Turquette @ 2014-05-29 22:29 UTC (permalink / raw)
  To: linux-arm-kernel

Quoting Doug Anderson (2014-05-29 14:21:36)
> Right now if you've got earlyprintk enabled on exynos5420-peach-pit
> then you'll get a hang on boot.  Here's why:
> 
> 1. The i2c-s3c2410 driver will probe at subsys_initcall.  It will
>    enable its clock and disable it.  This is the clock "i2c2".
> 2. The act of disabling "i2c2" will disable its parents.  In this case
>    the parent is "aclk66_peric".  There are no other children of
>    "aclk66_peric" officially enabled, so "aclk66_peric" will be turned
>    off (despite being CLK_IGNORE_UNUSED, but that's by design).
> 3. The next time you try to earlyprintk you'll do so without the UART
>    clock enabled.  That's because the UART clocks are also children of
>    "aclk66_peric".  You'll hang.
> 
> There's no good place to put a clock enable for earlyprintk, which is
> handled by a bunch of assembly code.  The best we can do is to handle
> this in the clock driver.
> 
> Signed-off-by: Doug Anderson <dianders@chromium.org>
> ---
>  drivers/clk/samsung/clk-exynos5420.c | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c
> index 9d7d7ee..1e586be 100644
> --- a/drivers/clk/samsung/clk-exynos5420.c
> +++ b/drivers/clk/samsung/clk-exynos5420.c
> @@ -1172,11 +1172,17 @@ static struct of_device_id ext_clk_match[] __initdata = {
>         { },
>  };
>  
> +/* Keep these clocks on until late_initcall */
> +static const char *boot_clocks[] __initconst = {
> +       "aclk66_peric",
> +};
> +
>  /* register exynos5420 clocks */
>  static void __init exynos5x_clk_init(struct device_node *np,
>                 enum exynos5x_soc soc)
>  {
>         struct samsung_clk_provider *ctx;
> +       int i;
>  
>         if (np) {
>                 reg_base = of_iomap(np, 0);
> @@ -1226,6 +1232,12 @@ static void __init exynos5x_clk_init(struct device_node *np,
>         }
>  
>         exynos5420_clk_sleep_init();
> +
> +       for (i = 0; i < ARRAY_SIZE(boot_clocks); i++) {
> +               struct clk *to_enable = __clk_lookup(boot_clocks[i]);

How about replacing __clk_lookup with clk_get? You can keep the struct
clk object hanging around for later...

> +
> +               clk_prepare_enable(to_enable);
> +       }
>  }
>  
>  static void __init exynos5420_clk_init(struct device_node *np)
> @@ -1239,3 +1251,15 @@ static void __init exynos5800_clk_init(struct device_node *np)
>         exynos5x_clk_init(np, EXYNOS5800);
>  }
>  CLK_OF_DECLARE(exynos5800_clk, "samsung,exynos5800-clock", exynos5800_clk_init);
> +
> +static int __init exynos5420_clk_late_init(void)
> +{
> +       int i;
> +
> +       for (i = 0; i < ARRAY_SIZE(boot_clocks); i++) {
> +               struct clk *to_disable = __clk_lookup(boot_clocks[i]);
> +
> +               clk_disable_unprepare(to_disable);

And then release it here with a clk_put.

Regards,
Mike

> +       }
> +}
> +late_initcall(exynos5420_clk_late_init);
> -- 
> 1.9.1.423.g4596e3a
> 

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

* [PATCH] clk: exynos5420: Keep aclk66_peric enabled during boot
  2014-05-29 22:29 ` Mike Turquette
@ 2014-05-30  5:02   ` Tomasz Figa
  2014-05-30 16:28     ` Doug Anderson
  0 siblings, 1 reply; 22+ messages in thread
From: Tomasz Figa @ 2014-05-30  5:02 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On 30.05.2014 00:29, Mike Turquette wrote:
> Quoting Doug Anderson (2014-05-29 14:21:36)
>> Right now if you've got earlyprintk enabled on exynos5420-peach-pit
>> then you'll get a hang on boot.  Here's why:
>>
>> 1. The i2c-s3c2410 driver will probe at subsys_initcall.  It will
>>    enable its clock and disable it.  This is the clock "i2c2".
>> 2. The act of disabling "i2c2" will disable its parents.  In this case
>>    the parent is "aclk66_peric".  There are no other children of
>>    "aclk66_peric" officially enabled, so "aclk66_peric" will be turned
>>    off (despite being CLK_IGNORE_UNUSED, but that's by design).
>> 3. The next time you try to earlyprintk you'll do so without the UART
>>    clock enabled.  That's because the UART clocks are also children of
>>    "aclk66_peric".  You'll hang.
>>
>> There's no good place to put a clock enable for earlyprintk, which is
>> handled by a bunch of assembly code.  The best we can do is to handle
>> this in the clock driver.
>>
>> Signed-off-by: Doug Anderson <dianders@chromium.org>
>> ---
>>  drivers/clk/samsung/clk-exynos5420.c | 24 ++++++++++++++++++++++++
>>  1 file changed, 24 insertions(+)
>>
>> diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c
>> index 9d7d7ee..1e586be 100644
>> --- a/drivers/clk/samsung/clk-exynos5420.c
>> +++ b/drivers/clk/samsung/clk-exynos5420.c
>> @@ -1172,11 +1172,17 @@ static struct of_device_id ext_clk_match[] __initdata = {
>>         { },
>>  };
>>  
>> +/* Keep these clocks on until late_initcall */
>> +static const char *boot_clocks[] __initconst = {
>> +       "aclk66_peric",
>> +};
>> +
>>  /* register exynos5420 clocks */
>>  static void __init exynos5x_clk_init(struct device_node *np,
>>                 enum exynos5x_soc soc)
>>  {
>>         struct samsung_clk_provider *ctx;
>> +       int i;
>>  
>>         if (np) {
>>                 reg_base = of_iomap(np, 0);
>> @@ -1226,6 +1232,12 @@ static void __init exynos5x_clk_init(struct device_node *np,
>>         }
>>  
>>         exynos5420_clk_sleep_init();
>> +
>> +       for (i = 0; i < ARRAY_SIZE(boot_clocks); i++) {
>> +               struct clk *to_enable = __clk_lookup(boot_clocks[i]);
> 
> How about replacing __clk_lookup with clk_get? You can keep the struct
> clk object hanging around for later...
> 

Mike, correct me if I'm wrong, but I thought you need clkdev look-up
entry for clk_get() to find a clock. Here, this clock apparently don't
have one and you don't even have a struct device * to pass to clk_get(),
so even if you had a look-up entry, it would need to be a wildcard entry
(with NULL device), which wouldn't be too elegant.

Doug, isn't a similar thing needed for PM debug as well? Maybe having
this clock always ungated whenever DEBUG_LL is enabled would be enough?

Best regards,
Tomasz

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

* [PATCH] clk: exynos5420: Keep aclk66_peric enabled during boot
  2014-05-29 21:21 [PATCH] clk: exynos5420: Keep aclk66_peric enabled during boot Doug Anderson
  2014-05-29 22:29 ` Mike Turquette
@ 2014-05-30 14:00 ` Javier Martinez Canillas
  2014-05-30 16:29   ` Doug Anderson
  2014-05-30 16:32 ` [PATCH v2] " Doug Anderson
  2 siblings, 1 reply; 22+ messages in thread
From: Javier Martinez Canillas @ 2014-05-30 14:00 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Doug,

On 05/29/2014 11:21 PM, Doug Anderson wrote:
> Right now if you've got earlyprintk enabled on exynos5420-peach-pit
> then you'll get a hang on boot.  Here's why:
> 
> 1. The i2c-s3c2410 driver will probe at subsys_initcall.  It will
>    enable its clock and disable it.  This is the clock "i2c2".
> 2. The act of disabling "i2c2" will disable its parents.  In this case
>    the parent is "aclk66_peric".  There are no other children of
>    "aclk66_peric" officially enabled, so "aclk66_peric" will be turned
>    off (despite being CLK_IGNORE_UNUSED, but that's by design).
> 3. The next time you try to earlyprintk you'll do so without the UART
>    clock enabled.  That's because the UART clocks are also children of
>    "aclk66_peric".  You'll hang.
> 
> There's no good place to put a clock enable for earlyprintk, which is
> handled by a bunch of assembly code.  The best we can do is to handle
> this in the clock driver.
> 
> Signed-off-by: Doug Anderson <dianders@chromium.org>
> ---
>  drivers/clk/samsung/clk-exynos5420.c | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 

I tested your patch and it solves the issue for me, so feel free to add

Tested-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>

Just one trivial comment below:

> diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c
> index 9d7d7ee..1e586be 100644
> --- a/drivers/clk/samsung/clk-exynos5420.c
> +++ b/drivers/clk/samsung/clk-exynos5420.c
> @@ -1172,11 +1172,17 @@ static struct of_device_id ext_clk_match[] __initdata = {
>  	{ },
>  };
>  
> +/* Keep these clocks on until late_initcall */
> +static const char *boot_clocks[] __initconst = {
> +	"aclk66_peric",
> +};
> +
>  /* register exynos5420 clocks */
>  static void __init exynos5x_clk_init(struct device_node *np,
>  		enum exynos5x_soc soc)
>  {
>  	struct samsung_clk_provider *ctx;
> +	int i;
>  
>  	if (np) {
>  		reg_base = of_iomap(np, 0);
> @@ -1226,6 +1232,12 @@ static void __init exynos5x_clk_init(struct device_node *np,
>  	}
>  
>  	exynos5420_clk_sleep_init();
> +
> +	for (i = 0; i < ARRAY_SIZE(boot_clocks); i++) {
> +		struct clk *to_enable = __clk_lookup(boot_clocks[i]);
> +
> +		clk_prepare_enable(to_enable);
> +	}
>  }
>  
>  static void __init exynos5420_clk_init(struct device_node *np)
> @@ -1239,3 +1251,15 @@ static void __init exynos5800_clk_init(struct device_node *np)
>  	exynos5x_clk_init(np, EXYNOS5800);
>  }
>  CLK_OF_DECLARE(exynos5800_clk, "samsung,exynos5800-clock", exynos5800_clk_init);
> +
> +static int __init exynos5420_clk_late_init(void)
> +{
> +	int i;
> +
> +	for (i = 0; i < ARRAY_SIZE(boot_clocks); i++) {
> +		struct clk *to_disable = __clk_lookup(boot_clocks[i]);
> +
> +		clk_disable_unprepare(to_disable);
> +	}
> +}
> +late_initcall(exynos5420_clk_late_init);
> 

You should return 0 here.

Best regards,
Javier

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

* [PATCH] clk: exynos5420: Keep aclk66_peric enabled during boot
  2014-05-30  5:02   ` Tomasz Figa
@ 2014-05-30 16:28     ` Doug Anderson
  0 siblings, 0 replies; 22+ messages in thread
From: Doug Anderson @ 2014-05-30 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Tomasz,

On Thu, May 29, 2014 at 10:02 PM, Tomasz Figa <tomasz.figa@gmail.com> wrote:
> Hi,
>
> On 30.05.2014 00:29, Mike Turquette wrote:
>> Quoting Doug Anderson (2014-05-29 14:21:36)
>>> Right now if you've got earlyprintk enabled on exynos5420-peach-pit
>>> then you'll get a hang on boot.  Here's why:
>>>
>>> 1. The i2c-s3c2410 driver will probe at subsys_initcall.  It will
>>>    enable its clock and disable it.  This is the clock "i2c2".
>>> 2. The act of disabling "i2c2" will disable its parents.  In this case
>>>    the parent is "aclk66_peric".  There are no other children of
>>>    "aclk66_peric" officially enabled, so "aclk66_peric" will be turned
>>>    off (despite being CLK_IGNORE_UNUSED, but that's by design).
>>> 3. The next time you try to earlyprintk you'll do so without the UART
>>>    clock enabled.  That's because the UART clocks are also children of
>>>    "aclk66_peric".  You'll hang.
>>>
>>> There's no good place to put a clock enable for earlyprintk, which is
>>> handled by a bunch of assembly code.  The best we can do is to handle
>>> this in the clock driver.
>>>
>>> Signed-off-by: Doug Anderson <dianders@chromium.org>
>>> ---
>>>  drivers/clk/samsung/clk-exynos5420.c | 24 ++++++++++++++++++++++++
>>>  1 file changed, 24 insertions(+)
>>>
>>> diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c
>>> index 9d7d7ee..1e586be 100644
>>> --- a/drivers/clk/samsung/clk-exynos5420.c
>>> +++ b/drivers/clk/samsung/clk-exynos5420.c
>>> @@ -1172,11 +1172,17 @@ static struct of_device_id ext_clk_match[] __initdata = {
>>>         { },
>>>  };
>>>
>>> +/* Keep these clocks on until late_initcall */
>>> +static const char *boot_clocks[] __initconst = {
>>> +       "aclk66_peric",
>>> +};
>>> +
>>>  /* register exynos5420 clocks */
>>>  static void __init exynos5x_clk_init(struct device_node *np,
>>>                 enum exynos5x_soc soc)
>>>  {
>>>         struct samsung_clk_provider *ctx;
>>> +       int i;
>>>
>>>         if (np) {
>>>                 reg_base = of_iomap(np, 0);
>>> @@ -1226,6 +1232,12 @@ static void __init exynos5x_clk_init(struct device_node *np,
>>>         }
>>>
>>>         exynos5420_clk_sleep_init();
>>> +
>>> +       for (i = 0; i < ARRAY_SIZE(boot_clocks); i++) {
>>> +               struct clk *to_enable = __clk_lookup(boot_clocks[i]);
>>
>> How about replacing __clk_lookup with clk_get? You can keep the struct
>> clk object hanging around for later...
>>
>
> Mike, correct me if I'm wrong, but I thought you need clkdev look-up
> entry for clk_get() to find a clock. Here, this clock apparently don't
> have one and you don't even have a struct device * to pass to clk_get(),
> so even if you had a look-up entry, it would need to be a wildcard entry
> (with NULL device), which wouldn't be too elegant.

I'll send up the next patch changing this clock to "GATE_A" which will
allow global lookups.  ...then I'll use clk_get() as Mike requests.
We can see if we like it better and can always move back to
__clk_lookup().


> Doug, isn't a similar thing needed for PM debug as well? Maybe having
> this clock always ungated whenever DEBUG_LL is enabled would be enough?

There may be a possible case where this is needed for PM debug, but I
don't _think_ it's needed in all the common cases.  It's also not
sufficient, I think.

Specifically:

1. This patch only gets "aclk66_peric", not the UART clock itself.  It
makes the assumption (required for earlyprink) that the bootloader
left enough clocks on to use the UART.  That is roughly documented in
Documentation/arm/Booting.  Mostly this patch is making sure that we
don't screw up the nice environment that the bootloader left for us.
This solution has the nice side effect that we don't need to try to
figure out which actual UART is active / grab the right clock.

2. Without grabbing the real UART clock then PM debug would start
failing anyway when the system disables all unused clocks in
late_init.

3. I would assume that if there was a problem here it would have
surfaced in 5250.  5250 doesn't have the problem we're addressing here
since there's no gate clock for "aclk66_peric" (or if there is one,
it's not described in our clock tree).

4. Assuming that you've got the serial port specified as a console=
port, I think the core will use s3c24xx_serial_pm to enable the clock
and leave it on.


...I haven't got myself setup for PM debug upstream right now (would
be good to get it configured / working locally eventually), but I
think if we have problems to solve there then we should solve it in
code related to PM debug.  How does that sound?

Also note that on ChromeOS we always have DEBUG_LL enabled (though we
usually don't have earlyprintk on the command line).

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

* [PATCH] clk: exynos5420: Keep aclk66_peric enabled during boot
  2014-05-30 14:00 ` Javier Martinez Canillas
@ 2014-05-30 16:29   ` Doug Anderson
  0 siblings, 0 replies; 22+ messages in thread
From: Doug Anderson @ 2014-05-30 16:29 UTC (permalink / raw)
  To: linux-arm-kernel

Javier,

On Fri, May 30, 2014 at 7:00 AM, Javier Martinez Canillas
<javier.martinez@collabora.co.uk> wrote:
>> @@ -1239,3 +1251,15 @@ static void __init exynos5800_clk_init(struct device_node *np)
>>       exynos5x_clk_init(np, EXYNOS5800);
>>  }
>>  CLK_OF_DECLARE(exynos5800_clk, "samsung,exynos5800-clock", exynos5800_clk_init);
>> +
>> +static int __init exynos5420_clk_late_init(void)
>> +{
>> +     int i;
>> +
>> +     for (i = 0; i < ARRAY_SIZE(boot_clocks); i++) {
>> +             struct clk *to_disable = __clk_lookup(boot_clocks[i]);
>> +
>> +             clk_disable_unprepare(to_disable);
>> +     }
>> +}
>> +late_initcall(exynos5420_clk_late_init);
>>
>
> You should return 0 here.

Duh.  Done.

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

* [PATCH v2] clk: exynos5420: Keep aclk66_peric enabled during boot
  2014-05-29 21:21 [PATCH] clk: exynos5420: Keep aclk66_peric enabled during boot Doug Anderson
  2014-05-29 22:29 ` Mike Turquette
  2014-05-30 14:00 ` Javier Martinez Canillas
@ 2014-05-30 16:32 ` Doug Anderson
  2014-06-05 18:48   ` Doug Anderson
  2014-06-05 20:35   ` [PATCH v3] clk: exynos5420: Remove aclk66_peric from the clock tree description Doug Anderson
  2 siblings, 2 replies; 22+ messages in thread
From: Doug Anderson @ 2014-05-30 16:32 UTC (permalink / raw)
  To: linux-arm-kernel

Right now if you've got earlyprintk enabled on exynos5420-peach-pit
then you'll get a hang on boot.  Here's why:

1. The i2c-s3c2410 driver will probe at subsys_initcall.  It will
   enable its clock and disable it.  This is the clock "i2c2".
2. The act of disabling "i2c2" will disable its parents.  In this case
   the parent is "aclk66_peric".  There are no other children of
   "aclk66_peric" officially enabled, so "aclk66_peric" will be turned
   off (despite being CLK_IGNORE_UNUSED, but that's by design).
3. The next time you try to earlyprintk you'll do so without the UART
   clock enabled.  That's because the UART clocks are also children of
   "aclk66_peric".  You'll hang.

There's no good place to put a clock enable for earlyprintk, which is
handled by a bunch of assembly code.  The best we can do is to handle
this in the clock driver.

Signed-off-by: Doug Anderson <dianders@chromium.org>
Tested-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
---
Changes in v2:
- Use GATE_A and clk_get().  Save the clock for putting later.
- Return 0 from exynos5420_clk_late_init().

 drivers/clk/samsung/clk-exynos5420.c | 33 +++++++++++++++++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c
index 9d7d7ee..70b607a 100644
--- a/drivers/clk/samsung/clk-exynos5420.c
+++ b/drivers/clk/samsung/clk-exynos5420.c
@@ -890,8 +890,8 @@ static struct samsung_gate_clock exynos5x_gate_clks[] __initdata = {
 			GATE_BUS_TOP, 9, CLK_IGNORE_UNUSED, 0),
 	GATE(0, "aclk66_psgen", "mout_user_aclk66_psgen",
 			GATE_BUS_TOP, 10, CLK_IGNORE_UNUSED, 0),
-	GATE(CLK_ACLK66_PERIC, "aclk66_peric", "mout_user_aclk66_peric",
-			GATE_BUS_TOP, 11, CLK_IGNORE_UNUSED, 0),
+	GATE_A(CLK_ACLK66_PERIC, "aclk66_peric", "mout_user_aclk66_peric",
+			GATE_BUS_TOP, 11, CLK_IGNORE_UNUSED, 0, "aclk66_peric"),
 	GATE(0, "aclk266_isp", "mout_user_aclk266_isp",
 			GATE_BUS_TOP, 13, 0, 0),
 	GATE(0, "aclk166", "mout_user_aclk166",
@@ -1172,11 +1172,22 @@ static struct of_device_id ext_clk_match[] __initdata = {
 	{ },
 };
 
+/* Keep these clocks on until late_initcall */
+struct boot_clock {
+	char *name;
+	struct clk *clk;
+};
+
+static struct boot_clock boot_clocks[] __initdata = {
+	{ .name = "aclk66_peric", },
+};
+
 /* register exynos5420 clocks */
 static void __init exynos5x_clk_init(struct device_node *np,
 		enum exynos5x_soc soc)
 {
 	struct samsung_clk_provider *ctx;
+	int i;
 
 	if (np) {
 		reg_base = of_iomap(np, 0);
@@ -1226,6 +1237,11 @@ static void __init exynos5x_clk_init(struct device_node *np,
 	}
 
 	exynos5420_clk_sleep_init();
+
+	for (i = 0; i < ARRAY_SIZE(boot_clocks); i++) {
+		boot_clocks[i].clk = clk_get(NULL, boot_clocks[i].name);
+		clk_prepare_enable(boot_clocks[i].clk);
+	}
 }
 
 static void __init exynos5420_clk_init(struct device_node *np)
@@ -1239,3 +1255,16 @@ static void __init exynos5800_clk_init(struct device_node *np)
 	exynos5x_clk_init(np, EXYNOS5800);
 }
 CLK_OF_DECLARE(exynos5800_clk, "samsung,exynos5800-clock", exynos5800_clk_init);
+
+static int __init exynos5420_clk_late_init(void)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(boot_clocks); i++) {
+		clk_disable_unprepare(boot_clocks[i].clk);
+		clk_put(boot_clocks[i].clk);
+	}
+
+	return 0;
+}
+late_initcall(exynos5420_clk_late_init);
-- 
1.9.1.423.g4596e3a

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

* [PATCH v2] clk: exynos5420: Keep aclk66_peric enabled during boot
  2014-05-30 16:32 ` [PATCH v2] " Doug Anderson
@ 2014-06-05 18:48   ` Doug Anderson
  2014-06-05 19:14     ` Tomasz Figa
  2014-06-05 20:35   ` [PATCH v3] clk: exynos5420: Remove aclk66_peric from the clock tree description Doug Anderson
  1 sibling, 1 reply; 22+ messages in thread
From: Doug Anderson @ 2014-06-05 18:48 UTC (permalink / raw)
  To: linux-arm-kernel

Tomasz / Mike,

On Fri, May 30, 2014 at 9:32 AM, Doug Anderson <dianders@chromium.org> wrote:
> Right now if you've got earlyprintk enabled on exynos5420-peach-pit
> then you'll get a hang on boot.  Here's why:
>
> 1. The i2c-s3c2410 driver will probe at subsys_initcall.  It will
>    enable its clock and disable it.  This is the clock "i2c2".
> 2. The act of disabling "i2c2" will disable its parents.  In this case
>    the parent is "aclk66_peric".  There are no other children of
>    "aclk66_peric" officially enabled, so "aclk66_peric" will be turned
>    off (despite being CLK_IGNORE_UNUSED, but that's by design).
> 3. The next time you try to earlyprintk you'll do so without the UART
>    clock enabled.  That's because the UART clocks are also children of
>    "aclk66_peric".  You'll hang.
>
> There's no good place to put a clock enable for earlyprintk, which is
> handled by a bunch of assembly code.  The best we can do is to handle
> this in the clock driver.
>
> Signed-off-by: Doug Anderson <dianders@chromium.org>
> Tested-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
> ---
> Changes in v2:
> - Use GATE_A and clk_get().  Save the clock for putting later.
> - Return 0 from exynos5420_clk_late_init().
>
>  drivers/clk/samsung/clk-exynos5420.c | 33 +++++++++++++++++++++++++++++++--
>  1 file changed, 31 insertions(+), 2 deletions(-)

Are there other changes you'd like me to make to this?  It would be
really nice to get this in for 3.16 so the system doesn't just
mysteriously hang when you use earlyprintk.

-Doug

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

* [PATCH v2] clk: exynos5420: Keep aclk66_peric enabled during boot
  2014-06-05 18:48   ` Doug Anderson
@ 2014-06-05 19:14     ` Tomasz Figa
  2014-06-05 19:22       ` Doug Anderson
  0 siblings, 1 reply; 22+ messages in thread
From: Tomasz Figa @ 2014-06-05 19:14 UTC (permalink / raw)
  To: linux-arm-kernel

On 05.06.2014 20:48, Doug Anderson wrote:
> Tomasz / Mike,
> 
> On Fri, May 30, 2014 at 9:32 AM, Doug Anderson <dianders@chromium.org> wrote:
>> Right now if you've got earlyprintk enabled on exynos5420-peach-pit
>> then you'll get a hang on boot.  Here's why:
>>
>> 1. The i2c-s3c2410 driver will probe at subsys_initcall.  It will
>>    enable its clock and disable it.  This is the clock "i2c2".
>> 2. The act of disabling "i2c2" will disable its parents.  In this case
>>    the parent is "aclk66_peric".  There are no other children of
>>    "aclk66_peric" officially enabled, so "aclk66_peric" will be turned
>>    off (despite being CLK_IGNORE_UNUSED, but that's by design).
>> 3. The next time you try to earlyprintk you'll do so without the UART
>>    clock enabled.  That's because the UART clocks are also children of
>>    "aclk66_peric".  You'll hang.
>>
>> There's no good place to put a clock enable for earlyprintk, which is
>> handled by a bunch of assembly code.  The best we can do is to handle
>> this in the clock driver.
>>
>> Signed-off-by: Doug Anderson <dianders@chromium.org>
>> Tested-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
>> ---
>> Changes in v2:
>> - Use GATE_A and clk_get().  Save the clock for putting later.
>> - Return 0 from exynos5420_clk_late_init().
>>
>>  drivers/clk/samsung/clk-exynos5420.c | 33 +++++++++++++++++++++++++++++++--
>>  1 file changed, 31 insertions(+), 2 deletions(-)
> 
> Are there other changes you'd like me to make to this?  It would be
> really nice to get this in for 3.16 so the system doesn't just
> mysteriously hang when you use earlyprintk.

We can probably take this as an -rc fix, so it should be fine.

However I still don't see the point of exporting this clock and
polluting the global clkdev namespace. Even the diffstat looks better in v1.

Best regards,
Tomasz

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

* [PATCH v2] clk: exynos5420: Keep aclk66_peric enabled during boot
  2014-06-05 19:14     ` Tomasz Figa
@ 2014-06-05 19:22       ` Doug Anderson
  2014-06-05 19:31         ` Tomasz Figa
  0 siblings, 1 reply; 22+ messages in thread
From: Doug Anderson @ 2014-06-05 19:22 UTC (permalink / raw)
  To: linux-arm-kernel

Tomasz,

On Thu, Jun 5, 2014 at 12:14 PM, Tomasz Figa <tomasz.figa@gmail.com> wrote:
> On 05.06.2014 20:48, Doug Anderson wrote:
>> Tomasz / Mike,
>>
>> On Fri, May 30, 2014 at 9:32 AM, Doug Anderson <dianders@chromium.org> wrote:
>>> Right now if you've got earlyprintk enabled on exynos5420-peach-pit
>>> then you'll get a hang on boot.  Here's why:
>>>
>>> 1. The i2c-s3c2410 driver will probe at subsys_initcall.  It will
>>>    enable its clock and disable it.  This is the clock "i2c2".
>>> 2. The act of disabling "i2c2" will disable its parents.  In this case
>>>    the parent is "aclk66_peric".  There are no other children of
>>>    "aclk66_peric" officially enabled, so "aclk66_peric" will be turned
>>>    off (despite being CLK_IGNORE_UNUSED, but that's by design).
>>> 3. The next time you try to earlyprintk you'll do so without the UART
>>>    clock enabled.  That's because the UART clocks are also children of
>>>    "aclk66_peric".  You'll hang.
>>>
>>> There's no good place to put a clock enable for earlyprintk, which is
>>> handled by a bunch of assembly code.  The best we can do is to handle
>>> this in the clock driver.
>>>
>>> Signed-off-by: Doug Anderson <dianders@chromium.org>
>>> Tested-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
>>> ---
>>> Changes in v2:
>>> - Use GATE_A and clk_get().  Save the clock for putting later.
>>> - Return 0 from exynos5420_clk_late_init().
>>>
>>>  drivers/clk/samsung/clk-exynos5420.c | 33 +++++++++++++++++++++++++++++++--
>>>  1 file changed, 31 insertions(+), 2 deletions(-)
>>
>> Are there other changes you'd like me to make to this?  It would be
>> really nice to get this in for 3.16 so the system doesn't just
>> mysteriously hang when you use earlyprintk.
>
> We can probably take this as an -rc fix, so it should be fine.
>
> However I still don't see the point of exporting this clock and
> polluting the global clkdev namespace. Even the diffstat looks better in v1.

OK, I'm happy to go back to v1 with the addition of the "return 0".

Mike: are you OK with that?

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

* [PATCH v2] clk: exynos5420: Keep aclk66_peric enabled during boot
  2014-06-05 19:22       ` Doug Anderson
@ 2014-06-05 19:31         ` Tomasz Figa
  2014-06-05 20:10           ` Doug Anderson
  0 siblings, 1 reply; 22+ messages in thread
From: Tomasz Figa @ 2014-06-05 19:31 UTC (permalink / raw)
  To: linux-arm-kernel

On 05.06.2014 21:22, Doug Anderson wrote:
> Tomasz,
> 
> On Thu, Jun 5, 2014 at 12:14 PM, Tomasz Figa <tomasz.figa@gmail.com> wrote:
>> On 05.06.2014 20:48, Doug Anderson wrote:
>>> Tomasz / Mike,
>>>
>>> On Fri, May 30, 2014 at 9:32 AM, Doug Anderson <dianders@chromium.org> wrote:
>>>> Right now if you've got earlyprintk enabled on exynos5420-peach-pit
>>>> then you'll get a hang on boot.  Here's why:
>>>>
>>>> 1. The i2c-s3c2410 driver will probe at subsys_initcall.  It will
>>>>    enable its clock and disable it.  This is the clock "i2c2".
>>>> 2. The act of disabling "i2c2" will disable its parents.  In this case
>>>>    the parent is "aclk66_peric".  There are no other children of
>>>>    "aclk66_peric" officially enabled, so "aclk66_peric" will be turned
>>>>    off (despite being CLK_IGNORE_UNUSED, but that's by design).
>>>> 3. The next time you try to earlyprintk you'll do so without the UART
>>>>    clock enabled.  That's because the UART clocks are also children of
>>>>    "aclk66_peric".  You'll hang.
>>>>
>>>> There's no good place to put a clock enable for earlyprintk, which is
>>>> handled by a bunch of assembly code.  The best we can do is to handle
>>>> this in the clock driver.
>>>>
>>>> Signed-off-by: Doug Anderson <dianders@chromium.org>
>>>> Tested-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
>>>> ---
>>>> Changes in v2:
>>>> - Use GATE_A and clk_get().  Save the clock for putting later.
>>>> - Return 0 from exynos5420_clk_late_init().
>>>>
>>>>  drivers/clk/samsung/clk-exynos5420.c | 33 +++++++++++++++++++++++++++++++--
>>>>  1 file changed, 31 insertions(+), 2 deletions(-)
>>>
>>> Are there other changes you'd like me to make to this?  It would be
>>> really nice to get this in for 3.16 so the system doesn't just
>>> mysteriously hang when you use earlyprintk.
>>
>> We can probably take this as an -rc fix, so it should be fine.
>>
>> However I still don't see the point of exporting this clock and
>> polluting the global clkdev namespace. Even the diffstat looks better in v1.
> 
> OK, I'm happy to go back to v1 with the addition of the "return 0".
> 
> Mike: are you OK with that?
> 

One more question that just came to my mind: Why it is just the
aclk66_peri and not its children related to UARTs?

Exynos5420 clock driver still needs a little clean-up, so I'm okay with
any fix for now and changing this later if needed, but is this gate
clock for ACLK66_PERIC even needed? It seems to be marked with
CLK_IGNORE_UNUSED which suggests that it is not needed in this driver at
all, along with other similar clocks. AFAIK for power management
purposes our fine-grained approach is fine and we shouldn't need to use
the big gates.

Best regards,
Tomasz

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

* [PATCH v2] clk: exynos5420: Keep aclk66_peric enabled during boot
  2014-06-05 19:31         ` Tomasz Figa
@ 2014-06-05 20:10           ` Doug Anderson
  2014-06-05 20:42             ` Doug Anderson
  0 siblings, 1 reply; 22+ messages in thread
From: Doug Anderson @ 2014-06-05 20:10 UTC (permalink / raw)
  To: linux-arm-kernel

Tomasz,

On Thu, Jun 5, 2014 at 12:31 PM, Tomasz Figa <tomasz.figa@gmail.com> wrote:
> One more question that just came to my mind: Why it is just the
> aclk66_peri and not its children related to UARTs?

Can you re-read out the original patch description and see if it
answers that?  Basically: the UART was left on by the bootloader and
that's a requirement of earlyprintk but the common clock framework is
messing with aclk66_peric which is what's killing us.


> Exynos5420 clock driver still needs a little clean-up, so I'm okay with
> any fix for now and changing this later if needed, but is this gate
> clock for ACLK66_PERIC even needed? It seems to be marked with
> CLK_IGNORE_UNUSED which suggests that it is not needed in this driver at
> all, along with other similar clocks. AFAIK for power management
> purposes our fine-grained approach is fine and we shouldn't need to use
> the big gates.

Right, another option is to remove this gate from the clock tree (and
reparent all children on the gate's parent) and that would also fix
us.  The main advantages of the "big gate" as I see it:

1. There's a reasonable chance that our clock tree description is not
complete.  Patches to add previously undocumented clocks seems to be a
relatively common occurrence.  If one of those undocumented clocks
happens to be a child of aclk66_peric then we'll no longer be gating
it.

2. There might be a small amount of power saved by gating the clock
higher in the tree.

3. Having a more complete description of the clock tree is nice in
case someone outside the kernel does something.  If a stray pointer
(or a nonstandard bootloader) gates the clock then our tree won't show
problems, but the clock will still be gated.


Of course as soon as the first child of aclk66_peric is activated then
points #1 and #2 are invalid.  ...and #3 is a bit bogus because there
are A LOT of gates that we already don't model.


Also: the CLK_IGNORE_UNUSED is a bit bogus here.  That's not really a
useful flag in the case that you've got children that are enabled and
disabled.  Once your first child is enabled and disabled you'll be
disabled!

---

Hmmm, I think I've convinced myself that your suggestion of just
removing this gate from the table is the right thing to do.  Patch
will be coming up soon.

-Doug

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

* [PATCH v3] clk: exynos5420: Remove aclk66_peric from the clock tree description
  2014-05-30 16:32 ` [PATCH v2] " Doug Anderson
  2014-06-05 18:48   ` Doug Anderson
@ 2014-06-05 20:35   ` Doug Anderson
  2014-06-05 22:26     ` Tomasz Figa
                       ` (2 more replies)
  1 sibling, 3 replies; 22+ messages in thread
From: Doug Anderson @ 2014-06-05 20:35 UTC (permalink / raw)
  To: linux-arm-kernel

The "aclk66_peric" clock is a gate clock with a whole bunch of gates
underneath it.  This big gate isn't very useful to include in our
clock tree.  If any of the children need to be turned on then the big
gate will need to be on anyway.  ...and there are plenty of other "big
gates" that aren't described in our clock tree, some of which shut off
collections of clocks that have no relationship in the hierarchy so
are hard to model.

"aclk66_peric" is causing earlyprintk problems since it gets disabled
as part of the boot process, so let's just remove it.

Strangely (and for no good reason) this clock is exported as part of
the common clock bindings.  Remove it since there are no in-kernel
device trees using it and no reason anyone out of tree should refer to
it either.

Signed-off-by: Doug Anderson <dianders@chromium.org>
---
Changes in v3:
- Now just remove aclk66_peric from the tree as suggested by Tomasz.

Changes in v2:
- Use GATE_A and clk_get().  Save the clock for putting later.
- Return 0 from exynos5420_clk_late_init().

 drivers/clk/samsung/clk-exynos5420.c   | 85 ++++++++++++++++++++++------------
 include/dt-bindings/clock/exynos5420.h |  1 -
 2 files changed, 55 insertions(+), 31 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c
index 9d7d7ee..61eccf0 100644
--- a/drivers/clk/samsung/clk-exynos5420.c
+++ b/drivers/clk/samsung/clk-exynos5420.c
@@ -890,8 +890,6 @@ static struct samsung_gate_clock exynos5x_gate_clks[] __initdata = {
 			GATE_BUS_TOP, 9, CLK_IGNORE_UNUSED, 0),
 	GATE(0, "aclk66_psgen", "mout_user_aclk66_psgen",
 			GATE_BUS_TOP, 10, CLK_IGNORE_UNUSED, 0),
-	GATE(CLK_ACLK66_PERIC, "aclk66_peric", "mout_user_aclk66_peric",
-			GATE_BUS_TOP, 11, CLK_IGNORE_UNUSED, 0),
 	GATE(0, "aclk266_isp", "mout_user_aclk266_isp",
 			GATE_BUS_TOP, 13, 0, 0),
 	GATE(0, "aclk166", "mout_user_aclk166",
@@ -994,34 +992,61 @@ static struct samsung_gate_clock exynos5x_gate_clks[] __initdata = {
 			SRC_MASK_FSYS, 24, CLK_SET_RATE_PARENT, 0),
 
 	/* PERIC Block */
-	GATE(CLK_UART0, "uart0", "aclk66_peric", GATE_IP_PERIC, 0, 0, 0),
-	GATE(CLK_UART1, "uart1", "aclk66_peric", GATE_IP_PERIC, 1, 0, 0),
-	GATE(CLK_UART2, "uart2", "aclk66_peric", GATE_IP_PERIC, 2, 0, 0),
-	GATE(CLK_UART3, "uart3", "aclk66_peric", GATE_IP_PERIC, 3, 0, 0),
-	GATE(CLK_I2C0, "i2c0", "aclk66_peric", GATE_IP_PERIC, 6, 0, 0),
-	GATE(CLK_I2C1, "i2c1", "aclk66_peric", GATE_IP_PERIC, 7, 0, 0),
-	GATE(CLK_I2C2, "i2c2", "aclk66_peric", GATE_IP_PERIC, 8, 0, 0),
-	GATE(CLK_I2C3, "i2c3", "aclk66_peric", GATE_IP_PERIC, 9, 0, 0),
-	GATE(CLK_USI0, "usi0", "aclk66_peric", GATE_IP_PERIC, 10, 0, 0),
-	GATE(CLK_USI1, "usi1", "aclk66_peric", GATE_IP_PERIC, 11, 0, 0),
-	GATE(CLK_USI2, "usi2", "aclk66_peric", GATE_IP_PERIC, 12, 0, 0),
-	GATE(CLK_USI3, "usi3", "aclk66_peric", GATE_IP_PERIC, 13, 0, 0),
-	GATE(CLK_I2C_HDMI, "i2c_hdmi", "aclk66_peric", GATE_IP_PERIC, 14, 0, 0),
-	GATE(CLK_TSADC, "tsadc", "aclk66_peric", GATE_IP_PERIC, 15, 0, 0),
-	GATE(CLK_SPI0, "spi0", "aclk66_peric", GATE_IP_PERIC, 16, 0, 0),
-	GATE(CLK_SPI1, "spi1", "aclk66_peric", GATE_IP_PERIC, 17, 0, 0),
-	GATE(CLK_SPI2, "spi2", "aclk66_peric", GATE_IP_PERIC, 18, 0, 0),
-	GATE(CLK_I2S1, "i2s1", "aclk66_peric", GATE_IP_PERIC, 20, 0, 0),
-	GATE(CLK_I2S2, "i2s2", "aclk66_peric", GATE_IP_PERIC, 21, 0, 0),
-	GATE(CLK_PCM1, "pcm1", "aclk66_peric", GATE_IP_PERIC, 22, 0, 0),
-	GATE(CLK_PCM2, "pcm2", "aclk66_peric", GATE_IP_PERIC, 23, 0, 0),
-	GATE(CLK_PWM, "pwm", "aclk66_peric", GATE_IP_PERIC, 24, 0, 0),
-	GATE(CLK_SPDIF, "spdif", "aclk66_peric", GATE_IP_PERIC, 26, 0, 0),
-	GATE(CLK_USI4, "usi4", "aclk66_peric", GATE_IP_PERIC, 28, 0, 0),
-	GATE(CLK_USI5, "usi5", "aclk66_peric", GATE_IP_PERIC, 30, 0, 0),
-	GATE(CLK_USI6, "usi6", "aclk66_peric", GATE_IP_PERIC, 31, 0, 0),
-
-	GATE(CLK_KEYIF, "keyif", "aclk66_peric", GATE_BUS_PERIC, 22, 0, 0),
+	GATE(CLK_UART0, "uart0", "mout_user_aclk66_peric",
+			GATE_IP_PERIC, 0, 0, 0),
+	GATE(CLK_UART1, "uart1", "mout_user_aclk66_peric",
+			GATE_IP_PERIC, 1, 0, 0),
+	GATE(CLK_UART2, "uart2", "mout_user_aclk66_peric",
+			GATE_IP_PERIC, 2, 0, 0),
+	GATE(CLK_UART3, "uart3", "mout_user_aclk66_peric",
+			GATE_IP_PERIC, 3, 0, 0),
+	GATE(CLK_I2C0, "i2c0", "mout_user_aclk66_peric",
+			GATE_IP_PERIC, 6, 0, 0),
+	GATE(CLK_I2C1, "i2c1", "mout_user_aclk66_peric",
+			GATE_IP_PERIC, 7, 0, 0),
+	GATE(CLK_I2C2, "i2c2", "mout_user_aclk66_peric",
+			GATE_IP_PERIC, 8, 0, 0),
+	GATE(CLK_I2C3, "i2c3", "mout_user_aclk66_peric",
+			GATE_IP_PERIC, 9, 0, 0),
+	GATE(CLK_USI0, "usi0", "mout_user_aclk66_peric",
+			GATE_IP_PERIC, 10, 0, 0),
+	GATE(CLK_USI1, "usi1", "mout_user_aclk66_peric",
+			GATE_IP_PERIC, 11, 0, 0),
+	GATE(CLK_USI2, "usi2", "mout_user_aclk66_peric",
+			GATE_IP_PERIC, 12, 0, 0),
+	GATE(CLK_USI3, "usi3", "mout_user_aclk66_peric",
+			GATE_IP_PERIC, 13, 0, 0),
+	GATE(CLK_I2C_HDMI, "i2c_hdmi", "mout_user_aclk66_peric",
+			GATE_IP_PERIC, 14, 0, 0),
+	GATE(CLK_TSADC, "tsadc", "mout_user_aclk66_peric",
+			GATE_IP_PERIC, 15, 0, 0),
+	GATE(CLK_SPI0, "spi0", "mout_user_aclk66_peric",
+			GATE_IP_PERIC, 16, 0, 0),
+	GATE(CLK_SPI1, "spi1", "mout_user_aclk66_peric",
+			GATE_IP_PERIC, 17, 0, 0),
+	GATE(CLK_SPI2, "spi2", "mout_user_aclk66_peric",
+			GATE_IP_PERIC, 18, 0, 0),
+	GATE(CLK_I2S1, "i2s1", "mout_user_aclk66_peric",
+			GATE_IP_PERIC, 20, 0, 0),
+	GATE(CLK_I2S2, "i2s2", "mout_user_aclk66_peric",
+			GATE_IP_PERIC, 21, 0, 0),
+	GATE(CLK_PCM1, "pcm1", "mout_user_aclk66_peric",
+			GATE_IP_PERIC, 22, 0, 0),
+	GATE(CLK_PCM2, "pcm2", "mout_user_aclk66_peric",
+			GATE_IP_PERIC, 23, 0, 0),
+	GATE(CLK_PWM, "pwm", "mout_user_aclk66_peric",
+			GATE_IP_PERIC, 24, 0, 0),
+	GATE(CLK_SPDIF, "spdif", "mout_user_aclk66_peric",
+			GATE_IP_PERIC, 26, 0, 0),
+	GATE(CLK_USI4, "usi4", "mout_user_aclk66_peric",
+			GATE_IP_PERIC, 28, 0, 0),
+	GATE(CLK_USI5, "usi5", "mout_user_aclk66_peric",
+			GATE_IP_PERIC, 30, 0, 0),
+	GATE(CLK_USI6, "usi6", "mout_user_aclk66_peric",
+			GATE_IP_PERIC, 31, 0, 0),
+
+	GATE(CLK_KEYIF, "keyif", "mout_user_aclk66_peric",
+			GATE_BUS_PERIC, 22, 0, 0),
 
 	/* PERIS Block */
 	GATE(CLK_CHIPID, "chipid", "aclk66_psgen",
diff --git a/include/dt-bindings/clock/exynos5420.h b/include/dt-bindings/clock/exynos5420.h
index 97dcb89..14e1c8f 100644
--- a/include/dt-bindings/clock/exynos5420.h
+++ b/include/dt-bindings/clock/exynos5420.h
@@ -63,7 +63,6 @@
 #define CLK_SCLK_MPHY_IXTAL24	161
 
 /* gate clocks */
-#define CLK_ACLK66_PERIC	256
 #define CLK_UART0		257
 #define CLK_UART1		258
 #define CLK_UART2		259
-- 
2.0.0.526.g5318336

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

* [PATCH v2] clk: exynos5420: Keep aclk66_peric enabled during boot
  2014-06-05 20:10           ` Doug Anderson
@ 2014-06-05 20:42             ` Doug Anderson
  0 siblings, 0 replies; 22+ messages in thread
From: Doug Anderson @ 2014-06-05 20:42 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Thu, Jun 5, 2014 at 1:10 PM, Doug Anderson <dianders@chromium.org> wrote:
> Hmmm, I think I've convinced myself that your suggestion of just
> removing this gate from the table is the right thing to do.  Patch
> will be coming up soon.

It's here <https://patchwork.kernel.org/patch/4308631/>

Ironically, that patch has a much worse diffstat and also changes
devicetree bindings (!).  ...but it does seem better.

-Doug

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

* [PATCH v3] clk: exynos5420: Remove aclk66_peric from the clock tree description
  2014-06-05 20:35   ` [PATCH v3] clk: exynos5420: Remove aclk66_peric from the clock tree description Doug Anderson
@ 2014-06-05 22:26     ` Tomasz Figa
  2014-06-06 23:41       ` Mike Turquette
  2014-06-06  0:03     ` Mike Turquette
  2014-06-30 13:48     ` Tomasz Figa
  2 siblings, 1 reply; 22+ messages in thread
From: Tomasz Figa @ 2014-06-05 22:26 UTC (permalink / raw)
  To: linux-arm-kernel

On 05.06.2014 22:35, Doug Anderson wrote:
> The "aclk66_peric" clock is a gate clock with a whole bunch of gates
> underneath it.  This big gate isn't very useful to include in our
> clock tree.  If any of the children need to be turned on then the big
> gate will need to be on anyway.  ...and there are plenty of other "big
> gates" that aren't described in our clock tree, some of which shut off
> collections of clocks that have no relationship in the hierarchy so
> are hard to model.
> 
> "aclk66_peric" is causing earlyprintk problems since it gets disabled
> as part of the boot process, so let's just remove it.
> 
> Strangely (and for no good reason) this clock is exported as part of
> the common clock bindings.  Remove it since there are no in-kernel
> device trees using it and no reason anyone out of tree should refer to
> it either.
> 
> Signed-off-by: Doug Anderson <dianders@chromium.org>
> ---
> Changes in v3:
> - Now just remove aclk66_peric from the tree as suggested by Tomasz.
> 
> Changes in v2:
> - Use GATE_A and clk_get().  Save the clock for putting later.
> - Return 0 from exynos5420_clk_late_init().
> 
>  drivers/clk/samsung/clk-exynos5420.c   | 85 ++++++++++++++++++++++------------
>  include/dt-bindings/clock/exynos5420.h |  1 -
>  2 files changed, 55 insertions(+), 31 deletions(-)
> 

Mike, I can take this patch to my tree as a fix for 3.16-rc, or if still
possible and you don't mind, feel free to apply it directly with my ACK:

Acked-by: Tomasz Figa <t.figa@samsung.com>

Best regards,
Tomasz

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

* [PATCH v3] clk: exynos5420: Remove aclk66_peric from the clock tree description
  2014-06-05 20:35   ` [PATCH v3] clk: exynos5420: Remove aclk66_peric from the clock tree description Doug Anderson
  2014-06-05 22:26     ` Tomasz Figa
@ 2014-06-06  0:03     ` Mike Turquette
  2014-06-06  0:46       ` Doug Anderson
  2014-06-30 13:48     ` Tomasz Figa
  2 siblings, 1 reply; 22+ messages in thread
From: Mike Turquette @ 2014-06-06  0:03 UTC (permalink / raw)
  To: linux-arm-kernel

Quoting Doug Anderson (2014-06-05 13:35:14)
> The "aclk66_peric" clock is a gate clock with a whole bunch of gates
> underneath it.  This big gate isn't very useful to include in our
> clock tree.  If any of the children need to be turned on then the big
> gate will need to be on anyway.  ...and there are plenty of other "big
> gates" that aren't described in our clock tree, some of which shut off
> collections of clocks that have no relationship in the hierarchy so
> are hard to model.

I think this is a common problem. On OMAP we have something similar to
this called "clock domains" or "clkdm" and it has been historically
handled outside of the Linux clock framework[1]. There is a relationship
to the clock framework of course and in the future it might be
worthwhile to see if there is a generic way to handle this stuff.

> 
> "aclk66_peric" is causing earlyprintk problems since it gets disabled
> as part of the boot process, so let's just remove it.
> 
> Strangely (and for no good reason) this clock is exported as part of
> the common clock bindings.  Remove it since there are no in-kernel
> device trees using it and no reason anyone out of tree should refer to
> it either.

So Linux has no control over the big gate now, correct? You are
dependent on the bootloader to ungate this thing?

Regards,
Mike

[1] http://deferred.io/images/clkdm.png

> 
> Signed-off-by: Doug Anderson <dianders@chromium.org>
> ---
> Changes in v3:
> - Now just remove aclk66_peric from the tree as suggested by Tomasz.
> 
> Changes in v2:
> - Use GATE_A and clk_get().  Save the clock for putting later.
> - Return 0 from exynos5420_clk_late_init().
> 
>  drivers/clk/samsung/clk-exynos5420.c   | 85 ++++++++++++++++++++++------------
>  include/dt-bindings/clock/exynos5420.h |  1 -
>  2 files changed, 55 insertions(+), 31 deletions(-)
> 
> diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c
> index 9d7d7ee..61eccf0 100644
> --- a/drivers/clk/samsung/clk-exynos5420.c
> +++ b/drivers/clk/samsung/clk-exynos5420.c
> @@ -890,8 +890,6 @@ static struct samsung_gate_clock exynos5x_gate_clks[] __initdata = {
>                         GATE_BUS_TOP, 9, CLK_IGNORE_UNUSED, 0),
>         GATE(0, "aclk66_psgen", "mout_user_aclk66_psgen",
>                         GATE_BUS_TOP, 10, CLK_IGNORE_UNUSED, 0),
> -       GATE(CLK_ACLK66_PERIC, "aclk66_peric", "mout_user_aclk66_peric",
> -                       GATE_BUS_TOP, 11, CLK_IGNORE_UNUSED, 0),
>         GATE(0, "aclk266_isp", "mout_user_aclk266_isp",
>                         GATE_BUS_TOP, 13, 0, 0),
>         GATE(0, "aclk166", "mout_user_aclk166",
> @@ -994,34 +992,61 @@ static struct samsung_gate_clock exynos5x_gate_clks[] __initdata = {
>                         SRC_MASK_FSYS, 24, CLK_SET_RATE_PARENT, 0),
>  
>         /* PERIC Block */
> -       GATE(CLK_UART0, "uart0", "aclk66_peric", GATE_IP_PERIC, 0, 0, 0),
> -       GATE(CLK_UART1, "uart1", "aclk66_peric", GATE_IP_PERIC, 1, 0, 0),
> -       GATE(CLK_UART2, "uart2", "aclk66_peric", GATE_IP_PERIC, 2, 0, 0),
> -       GATE(CLK_UART3, "uart3", "aclk66_peric", GATE_IP_PERIC, 3, 0, 0),
> -       GATE(CLK_I2C0, "i2c0", "aclk66_peric", GATE_IP_PERIC, 6, 0, 0),
> -       GATE(CLK_I2C1, "i2c1", "aclk66_peric", GATE_IP_PERIC, 7, 0, 0),
> -       GATE(CLK_I2C2, "i2c2", "aclk66_peric", GATE_IP_PERIC, 8, 0, 0),
> -       GATE(CLK_I2C3, "i2c3", "aclk66_peric", GATE_IP_PERIC, 9, 0, 0),
> -       GATE(CLK_USI0, "usi0", "aclk66_peric", GATE_IP_PERIC, 10, 0, 0),
> -       GATE(CLK_USI1, "usi1", "aclk66_peric", GATE_IP_PERIC, 11, 0, 0),
> -       GATE(CLK_USI2, "usi2", "aclk66_peric", GATE_IP_PERIC, 12, 0, 0),
> -       GATE(CLK_USI3, "usi3", "aclk66_peric", GATE_IP_PERIC, 13, 0, 0),
> -       GATE(CLK_I2C_HDMI, "i2c_hdmi", "aclk66_peric", GATE_IP_PERIC, 14, 0, 0),
> -       GATE(CLK_TSADC, "tsadc", "aclk66_peric", GATE_IP_PERIC, 15, 0, 0),
> -       GATE(CLK_SPI0, "spi0", "aclk66_peric", GATE_IP_PERIC, 16, 0, 0),
> -       GATE(CLK_SPI1, "spi1", "aclk66_peric", GATE_IP_PERIC, 17, 0, 0),
> -       GATE(CLK_SPI2, "spi2", "aclk66_peric", GATE_IP_PERIC, 18, 0, 0),
> -       GATE(CLK_I2S1, "i2s1", "aclk66_peric", GATE_IP_PERIC, 20, 0, 0),
> -       GATE(CLK_I2S2, "i2s2", "aclk66_peric", GATE_IP_PERIC, 21, 0, 0),
> -       GATE(CLK_PCM1, "pcm1", "aclk66_peric", GATE_IP_PERIC, 22, 0, 0),
> -       GATE(CLK_PCM2, "pcm2", "aclk66_peric", GATE_IP_PERIC, 23, 0, 0),
> -       GATE(CLK_PWM, "pwm", "aclk66_peric", GATE_IP_PERIC, 24, 0, 0),
> -       GATE(CLK_SPDIF, "spdif", "aclk66_peric", GATE_IP_PERIC, 26, 0, 0),
> -       GATE(CLK_USI4, "usi4", "aclk66_peric", GATE_IP_PERIC, 28, 0, 0),
> -       GATE(CLK_USI5, "usi5", "aclk66_peric", GATE_IP_PERIC, 30, 0, 0),
> -       GATE(CLK_USI6, "usi6", "aclk66_peric", GATE_IP_PERIC, 31, 0, 0),
> -
> -       GATE(CLK_KEYIF, "keyif", "aclk66_peric", GATE_BUS_PERIC, 22, 0, 0),
> +       GATE(CLK_UART0, "uart0", "mout_user_aclk66_peric",
> +                       GATE_IP_PERIC, 0, 0, 0),
> +       GATE(CLK_UART1, "uart1", "mout_user_aclk66_peric",
> +                       GATE_IP_PERIC, 1, 0, 0),
> +       GATE(CLK_UART2, "uart2", "mout_user_aclk66_peric",
> +                       GATE_IP_PERIC, 2, 0, 0),
> +       GATE(CLK_UART3, "uart3", "mout_user_aclk66_peric",
> +                       GATE_IP_PERIC, 3, 0, 0),
> +       GATE(CLK_I2C0, "i2c0", "mout_user_aclk66_peric",
> +                       GATE_IP_PERIC, 6, 0, 0),
> +       GATE(CLK_I2C1, "i2c1", "mout_user_aclk66_peric",
> +                       GATE_IP_PERIC, 7, 0, 0),
> +       GATE(CLK_I2C2, "i2c2", "mout_user_aclk66_peric",
> +                       GATE_IP_PERIC, 8, 0, 0),
> +       GATE(CLK_I2C3, "i2c3", "mout_user_aclk66_peric",
> +                       GATE_IP_PERIC, 9, 0, 0),
> +       GATE(CLK_USI0, "usi0", "mout_user_aclk66_peric",
> +                       GATE_IP_PERIC, 10, 0, 0),
> +       GATE(CLK_USI1, "usi1", "mout_user_aclk66_peric",
> +                       GATE_IP_PERIC, 11, 0, 0),
> +       GATE(CLK_USI2, "usi2", "mout_user_aclk66_peric",
> +                       GATE_IP_PERIC, 12, 0, 0),
> +       GATE(CLK_USI3, "usi3", "mout_user_aclk66_peric",
> +                       GATE_IP_PERIC, 13, 0, 0),
> +       GATE(CLK_I2C_HDMI, "i2c_hdmi", "mout_user_aclk66_peric",
> +                       GATE_IP_PERIC, 14, 0, 0),
> +       GATE(CLK_TSADC, "tsadc", "mout_user_aclk66_peric",
> +                       GATE_IP_PERIC, 15, 0, 0),
> +       GATE(CLK_SPI0, "spi0", "mout_user_aclk66_peric",
> +                       GATE_IP_PERIC, 16, 0, 0),
> +       GATE(CLK_SPI1, "spi1", "mout_user_aclk66_peric",
> +                       GATE_IP_PERIC, 17, 0, 0),
> +       GATE(CLK_SPI2, "spi2", "mout_user_aclk66_peric",
> +                       GATE_IP_PERIC, 18, 0, 0),
> +       GATE(CLK_I2S1, "i2s1", "mout_user_aclk66_peric",
> +                       GATE_IP_PERIC, 20, 0, 0),
> +       GATE(CLK_I2S2, "i2s2", "mout_user_aclk66_peric",
> +                       GATE_IP_PERIC, 21, 0, 0),
> +       GATE(CLK_PCM1, "pcm1", "mout_user_aclk66_peric",
> +                       GATE_IP_PERIC, 22, 0, 0),
> +       GATE(CLK_PCM2, "pcm2", "mout_user_aclk66_peric",
> +                       GATE_IP_PERIC, 23, 0, 0),
> +       GATE(CLK_PWM, "pwm", "mout_user_aclk66_peric",
> +                       GATE_IP_PERIC, 24, 0, 0),
> +       GATE(CLK_SPDIF, "spdif", "mout_user_aclk66_peric",
> +                       GATE_IP_PERIC, 26, 0, 0),
> +       GATE(CLK_USI4, "usi4", "mout_user_aclk66_peric",
> +                       GATE_IP_PERIC, 28, 0, 0),
> +       GATE(CLK_USI5, "usi5", "mout_user_aclk66_peric",
> +                       GATE_IP_PERIC, 30, 0, 0),
> +       GATE(CLK_USI6, "usi6", "mout_user_aclk66_peric",
> +                       GATE_IP_PERIC, 31, 0, 0),
> +
> +       GATE(CLK_KEYIF, "keyif", "mout_user_aclk66_peric",
> +                       GATE_BUS_PERIC, 22, 0, 0),
>  
>         /* PERIS Block */
>         GATE(CLK_CHIPID, "chipid", "aclk66_psgen",
> diff --git a/include/dt-bindings/clock/exynos5420.h b/include/dt-bindings/clock/exynos5420.h
> index 97dcb89..14e1c8f 100644
> --- a/include/dt-bindings/clock/exynos5420.h
> +++ b/include/dt-bindings/clock/exynos5420.h
> @@ -63,7 +63,6 @@
>  #define CLK_SCLK_MPHY_IXTAL24  161
>  
>  /* gate clocks */
> -#define CLK_ACLK66_PERIC       256
>  #define CLK_UART0              257
>  #define CLK_UART1              258
>  #define CLK_UART2              259
> -- 
> 2.0.0.526.g5318336
> 

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

* [PATCH v3] clk: exynos5420: Remove aclk66_peric from the clock tree description
  2014-06-06  0:03     ` Mike Turquette
@ 2014-06-06  0:46       ` Doug Anderson
  2014-06-06 22:31         ` Mike Turquette
  0 siblings, 1 reply; 22+ messages in thread
From: Doug Anderson @ 2014-06-06  0:46 UTC (permalink / raw)
  To: linux-arm-kernel

Mike,

On Thu, Jun 5, 2014 at 5:03 PM, Mike Turquette <mturquette@linaro.org> wrote:
> Quoting Doug Anderson (2014-06-05 13:35:14)
>> The "aclk66_peric" clock is a gate clock with a whole bunch of gates
>> underneath it.  This big gate isn't very useful to include in our
>> clock tree.  If any of the children need to be turned on then the big
>> gate will need to be on anyway.  ...and there are plenty of other "big
>> gates" that aren't described in our clock tree, some of which shut off
>> collections of clocks that have no relationship in the hierarchy so
>> are hard to model.
>
> I think this is a common problem. On OMAP we have something similar to
> this called "clock domains" or "clkdm" and it has been historically
> handled outside of the Linux clock framework[1]. There is a relationship
> to the clock framework of course and in the future it might be
> worthwhile to see if there is a generic way to handle this stuff.

That sounds like something that would be nice to solve, but it's not
going to happen now.

On the off chance that the user manual mentioned the existence of one
of these "big gate" bits, it tends to not be very specific about
_exactly_ which sets of clocks it disables.

Tracking down every one of these would be hugely time consuming.
Also: as Tomasz has indicated they don't provide a huge amount of
benefit since we're already dealing with clocks on a more fine-grained
level...


>> "aclk66_peric" is causing earlyprintk problems since it gets disabled
>> as part of the boot process, so let's just remove it.
>>
>> Strangely (and for no good reason) this clock is exported as part of
>> the common clock bindings.  Remove it since there are no in-kernel
>> device trees using it and no reason anyone out of tree should refer to
>> it either.
>
> So Linux has no control over the big gate now, correct? You are
> dependent on the bootloader to ungate this thing?

A better way to put it is that you're dependent on the bootloader not
to gate it.

...but that's also true for pretty much any clock marked IGNORE_UNUSED
and not explicitly enabled anywhere.


Are you opposed to this landing as-is to unblock things and people can
continue to work on the clock driver to make it even better?

-Doug

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

* [PATCH v3] clk: exynos5420: Remove aclk66_peric from the clock tree description
  2014-06-06  0:46       ` Doug Anderson
@ 2014-06-06 22:31         ` Mike Turquette
  2014-06-06 23:19           ` Doug Anderson
  0 siblings, 1 reply; 22+ messages in thread
From: Mike Turquette @ 2014-06-06 22:31 UTC (permalink / raw)
  To: linux-arm-kernel

Quoting Doug Anderson (2014-06-05 17:46:23)
> Mike,
> 
> On Thu, Jun 5, 2014 at 5:03 PM, Mike Turquette <mturquette@linaro.org> wrote:
> > Quoting Doug Anderson (2014-06-05 13:35:14)
> >> The "aclk66_peric" clock is a gate clock with a whole bunch of gates
> >> underneath it.  This big gate isn't very useful to include in our
> >> clock tree.  If any of the children need to be turned on then the big
> >> gate will need to be on anyway.  ...and there are plenty of other "big
> >> gates" that aren't described in our clock tree, some of which shut off
> >> collections of clocks that have no relationship in the hierarchy so
> >> are hard to model.
> >
> > I think this is a common problem. On OMAP we have something similar to
> > this called "clock domains" or "clkdm" and it has been historically
> > handled outside of the Linux clock framework[1]. There is a relationship
> > to the clock framework of course and in the future it might be
> > worthwhile to see if there is a generic way to handle this stuff.
> 
> That sounds like something that would be nice to solve, but it's not
> going to happen now.
> 
> On the off chance that the user manual mentioned the existence of one
> of these "big gate" bits, it tends to not be very specific about
> _exactly_ which sets of clocks it disables.
> 
> Tracking down every one of these would be hugely time consuming.
> Also: as Tomasz has indicated they don't provide a huge amount of
> benefit since we're already dealing with clocks on a more fine-grained
> level...

Sounds like you are dealing with crappy documentation :-(

> 
> 
> >> "aclk66_peric" is causing earlyprintk problems since it gets disabled
> >> as part of the boot process, so let's just remove it.
> >>
> >> Strangely (and for no good reason) this clock is exported as part of
> >> the common clock bindings.  Remove it since there are no in-kernel
> >> device trees using it and no reason anyone out of tree should refer to
> >> it either.
> >
> > So Linux has no control over the big gate now, correct? You are
> > dependent on the bootloader to ungate this thing?
> 
> A better way to put it is that you're dependent on the bootloader not
> to gate it.
> 
> ...but that's also true for pretty much any clock marked IGNORE_UNUSED
> and not explicitly enabled anywhere.
> 
> 
> Are you opposed to this landing as-is to unblock things and people can
> continue to work on the clock driver to make it even better?

No. I'm just trying to understand how things work so that we can arrive
to the right decision. I know what it is like to try and quickly unblock
everyone else and the rush to do so often leads to less awesome
solutions.

Anyways, getting back on point, Tomasz was right about the whole clk_get
thing. So I'm happy to take either V1 or V3 of your patch. I will be
submitting a second PR for 3.16 next week and it will include whichever
version you and Tomasz agree is best.

Regards,
Mike

> 
> -Doug

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

* [PATCH v3] clk: exynos5420: Remove aclk66_peric from the clock tree description
  2014-06-06 22:31         ` Mike Turquette
@ 2014-06-06 23:19           ` Doug Anderson
  0 siblings, 0 replies; 22+ messages in thread
From: Doug Anderson @ 2014-06-06 23:19 UTC (permalink / raw)
  To: linux-arm-kernel

Mike,

On Fri, Jun 6, 2014 at 3:31 PM, Mike Turquette <mturquette@linaro.org> wrote:
> Anyways, getting back on point, Tomasz was right about the whole clk_get
> thing. So I'm happy to take either V1 or V3 of your patch. I will be
> submitting a second PR for 3.16 next week and it will include whichever
> version you and Tomasz agree is best.

I like V3 slightly better and it has Tomasz's Ack.  Unless he emails
and suggests that he really V1 better then I'd say go with V3.  If we
go back to V1 we'll need to add the "return 0", which I'm happy to do.

Thanks!

-Doug

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

* [PATCH v3] clk: exynos5420: Remove aclk66_peric from the clock tree description
  2014-06-05 22:26     ` Tomasz Figa
@ 2014-06-06 23:41       ` Mike Turquette
  2014-06-09 18:56         ` Doug Anderson
  0 siblings, 1 reply; 22+ messages in thread
From: Mike Turquette @ 2014-06-06 23:41 UTC (permalink / raw)
  To: linux-arm-kernel

Quoting Tomasz Figa (2014-06-05 15:26:31)
> On 05.06.2014 22:35, Doug Anderson wrote:
> > The "aclk66_peric" clock is a gate clock with a whole bunch of gates
> > underneath it.  This big gate isn't very useful to include in our
> > clock tree.  If any of the children need to be turned on then the big
> > gate will need to be on anyway.  ...and there are plenty of other "big
> > gates" that aren't described in our clock tree, some of which shut off
> > collections of clocks that have no relationship in the hierarchy so
> > are hard to model.
> > 
> > "aclk66_peric" is causing earlyprintk problems since it gets disabled
> > as part of the boot process, so let's just remove it.
> > 
> > Strangely (and for no good reason) this clock is exported as part of
> > the common clock bindings.  Remove it since there are no in-kernel
> > device trees using it and no reason anyone out of tree should refer to
> > it either.
> > 
> > Signed-off-by: Doug Anderson <dianders@chromium.org>
> > ---
> > Changes in v3:
> > - Now just remove aclk66_peric from the tree as suggested by Tomasz.
> > 
> > Changes in v2:
> > - Use GATE_A and clk_get().  Save the clock for putting later.
> > - Return 0 from exynos5420_clk_late_init().
> > 
> >  drivers/clk/samsung/clk-exynos5420.c   | 85 ++++++++++++++++++++++------------
> >  include/dt-bindings/clock/exynos5420.h |  1 -
> >  2 files changed, 55 insertions(+), 31 deletions(-)
> > 
> 
> Mike, I can take this patch to my tree as a fix for 3.16-rc, or if still
> possible and you don't mind, feel free to apply it directly with my ACK:
> 
> Acked-by: Tomasz Figa <t.figa@samsung.com>

I'll send a second PR next week that includes this.

Regards,
Mike

> 
> Best regards,
> Tomasz

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

* [PATCH v3] clk: exynos5420: Remove aclk66_peric from the clock tree description
  2014-06-06 23:41       ` Mike Turquette
@ 2014-06-09 18:56         ` Doug Anderson
  0 siblings, 0 replies; 22+ messages in thread
From: Doug Anderson @ 2014-06-09 18:56 UTC (permalink / raw)
  To: linux-arm-kernel

Tomasz,

On Fri, Jun 6, 2014 at 4:41 PM, Mike Turquette <mturquette@linaro.org> wrote:
> Quoting Tomasz Figa (2014-06-05 15:26:31)
>> On 05.06.2014 22:35, Doug Anderson wrote:
>> > The "aclk66_peric" clock is a gate clock with a whole bunch of gates
>> > underneath it.  This big gate isn't very useful to include in our
>> > clock tree.  If any of the children need to be turned on then the big
>> > gate will need to be on anyway.  ...and there are plenty of other "big
>> > gates" that aren't described in our clock tree, some of which shut off
>> > collections of clocks that have no relationship in the hierarchy so
>> > are hard to model.
>> >
>> > "aclk66_peric" is causing earlyprintk problems since it gets disabled
>> > as part of the boot process, so let's just remove it.
>> >
>> > Strangely (and for no good reason) this clock is exported as part of
>> > the common clock bindings.  Remove it since there are no in-kernel
>> > device trees using it and no reason anyone out of tree should refer to
>> > it either.
>> >
>> > Signed-off-by: Doug Anderson <dianders@chromium.org>
>> > ---
>> > Changes in v3:
>> > - Now just remove aclk66_peric from the tree as suggested by Tomasz.
>> >
>> > Changes in v2:
>> > - Use GATE_A and clk_get().  Save the clock for putting later.
>> > - Return 0 from exynos5420_clk_late_init().
>> >
>> >  drivers/clk/samsung/clk-exynos5420.c   | 85 ++++++++++++++++++++++------------
>> >  include/dt-bindings/clock/exynos5420.h |  1 -
>> >  2 files changed, 55 insertions(+), 31 deletions(-)
>> >
>>
>> Mike, I can take this patch to my tree as a fix for 3.16-rc, or if still
>> possible and you don't mind, feel free to apply it directly with my ACK:
>>
>> Acked-by: Tomasz Figa <t.figa@samsung.com>
>
> I'll send a second PR next week that includes this.

This doesn't apply cleanly to Mike's tree.  Can you add it to your
tree and send it out for 3.16?  Mike said you should add his Ack and
I've confirmed that the patch applies cleanly to the most recent
linuxnext (next-20140606) as well as to the top of your
'samsung-clk-next' tree (2ce16c5 clk: samsung: exynos3250: Add clocks
using common clock framework).

Thanks!

-Doug

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

* [PATCH v3] clk: exynos5420: Remove aclk66_peric from the clock tree description
  2014-06-05 20:35   ` [PATCH v3] clk: exynos5420: Remove aclk66_peric from the clock tree description Doug Anderson
  2014-06-05 22:26     ` Tomasz Figa
  2014-06-06  0:03     ` Mike Turquette
@ 2014-06-30 13:48     ` Tomasz Figa
  2 siblings, 0 replies; 22+ messages in thread
From: Tomasz Figa @ 2014-06-30 13:48 UTC (permalink / raw)
  To: linux-arm-kernel

On 05.06.2014 22:35, Doug Anderson wrote:
> The "aclk66_peric" clock is a gate clock with a whole bunch of gates
> underneath it.  This big gate isn't very useful to include in our
> clock tree.  If any of the children need to be turned on then the big
> gate will need to be on anyway.  ...and there are plenty of other "big
> gates" that aren't described in our clock tree, some of which shut off
> collections of clocks that have no relationship in the hierarchy so
> are hard to model.
> 
> "aclk66_peric" is causing earlyprintk problems since it gets disabled
> as part of the boot process, so let's just remove it.
> 
> Strangely (and for no good reason) this clock is exported as part of
> the common clock bindings.  Remove it since there are no in-kernel
> device trees using it and no reason anyone out of tree should refer to
> it either.
> 
> Signed-off-by: Doug Anderson <dianders@chromium.org>
> ---
> Changes in v3:
> - Now just remove aclk66_peric from the tree as suggested by Tomasz.
> 
> Changes in v2:
> - Use GATE_A and clk_get().  Save the clock for putting later.
> - Return 0 from exynos5420_clk_late_init().
> 
>  drivers/clk/samsung/clk-exynos5420.c   | 85 ++++++++++++++++++++++------------
>  include/dt-bindings/clock/exynos5420.h |  1 -
>  2 files changed, 55 insertions(+), 31 deletions(-)

Applied as a fix for 3.16.

Best regards,
Tomasz

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

end of thread, other threads:[~2014-06-30 13:48 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-29 21:21 [PATCH] clk: exynos5420: Keep aclk66_peric enabled during boot Doug Anderson
2014-05-29 22:29 ` Mike Turquette
2014-05-30  5:02   ` Tomasz Figa
2014-05-30 16:28     ` Doug Anderson
2014-05-30 14:00 ` Javier Martinez Canillas
2014-05-30 16:29   ` Doug Anderson
2014-05-30 16:32 ` [PATCH v2] " Doug Anderson
2014-06-05 18:48   ` Doug Anderson
2014-06-05 19:14     ` Tomasz Figa
2014-06-05 19:22       ` Doug Anderson
2014-06-05 19:31         ` Tomasz Figa
2014-06-05 20:10           ` Doug Anderson
2014-06-05 20:42             ` Doug Anderson
2014-06-05 20:35   ` [PATCH v3] clk: exynos5420: Remove aclk66_peric from the clock tree description Doug Anderson
2014-06-05 22:26     ` Tomasz Figa
2014-06-06 23:41       ` Mike Turquette
2014-06-09 18:56         ` Doug Anderson
2014-06-06  0:03     ` Mike Turquette
2014-06-06  0:46       ` Doug Anderson
2014-06-06 22:31         ` Mike Turquette
2014-06-06 23:19           ` Doug Anderson
2014-06-30 13:48     ` Tomasz Figa

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