LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] arm: ls1021a: setup hrtimer based tick broadcast
@ 2014-12-05  9:07 Jingchang Lu
  2014-12-05 10:27 ` Mark Rutland
  0 siblings, 1 reply; 3+ messages in thread
From: Jingchang Lu @ 2014-12-05  9:07 UTC (permalink / raw)
  To: shawn.guo; +Cc: linux-arm-kernel, linux-kernel, Jingchang Lu

This adds setup of hrtimer based tick broadcast to utilize
the hrtimer in SMP without other broadcast tick devices.

Signed-off-by: Jingchang Lu <jingchang.lu@freescale.com>
---
 arch/arm/mach-imx/mach-ls1021a.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/mach-imx/mach-ls1021a.c b/arch/arm/mach-imx/mach-ls1021a.c
index b89c858..4d074cf 100644
--- a/arch/arm/mach-imx/mach-ls1021a.c
+++ b/arch/arm/mach-imx/mach-ls1021a.c
@@ -7,6 +7,10 @@
  * (at your option) any later version.
  */
 
+#include <linux/clockchips.h>
+#include <linux/clk-provider.h>
+#include <linux/clocksource.h>
+
 #include <asm/mach/arch.h>
 
 #include "common.h"
@@ -16,7 +20,15 @@ static const char * const ls1021a_dt_compat[] __initconst = {
 	NULL,
 };
 
+static void __init ls1021a_init_time(void)
+{
+	of_clk_init(NULL);
+	clocksource_of_init();
+	tick_setup_hrtimer_broadcast();
+}
+
 DT_MACHINE_START(LS1021A, "Freescale LS1021A")
 	.smp		= smp_ops(ls1021a_smp_ops),
+	.init_time	= ls1021a_init_time,
 	.dt_compat	= ls1021a_dt_compat,
 MACHINE_END
-- 
1.8.0


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

* Re: [PATCH] arm: ls1021a: setup hrtimer based tick broadcast
  2014-12-05  9:07 [PATCH] arm: ls1021a: setup hrtimer based tick broadcast Jingchang Lu
@ 2014-12-05 10:27 ` Mark Rutland
  2014-12-05 10:57   ` Preeti U Murthy
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Rutland @ 2014-12-05 10:27 UTC (permalink / raw)
  To: Jingchang Lu
  Cc: shawn.guo, linux-kernel, linux-arm-kernel, Lorenzo Pieralisi,
	Will Deacon, Preeti U Murthy

Hi,

On Fri, Dec 05, 2014 at 09:07:29AM +0000, Jingchang Lu wrote:
> This adds setup of hrtimer based tick broadcast to utilize
> the hrtimer in SMP without other broadcast tick devices.
> 
> Signed-off-by: Jingchang Lu <jingchang.lu@freescale.com>

This shouldn't live in board code.

Similarly to what happens with the generic dummy timer on all arches
that select it (and the broadcast hrtimer on all arches that use it so
far), we should just unconditionally register the broadcast hrtimer.

A real broadcast-capable clock event device will take preference if
present, so we don't need to add board-specific code to only register
this in certain conditions.

Mark.

> ---
>  arch/arm/mach-imx/mach-ls1021a.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/arch/arm/mach-imx/mach-ls1021a.c b/arch/arm/mach-imx/mach-ls1021a.c
> index b89c858..4d074cf 100644
> --- a/arch/arm/mach-imx/mach-ls1021a.c
> +++ b/arch/arm/mach-imx/mach-ls1021a.c
> @@ -7,6 +7,10 @@
>   * (at your option) any later version.
>   */
>  
> +#include <linux/clockchips.h>
> +#include <linux/clk-provider.h>
> +#include <linux/clocksource.h>
> +
>  #include <asm/mach/arch.h>
>  
>  #include "common.h"
> @@ -16,7 +20,15 @@ static const char * const ls1021a_dt_compat[] __initconst = {
>  	NULL,
>  };
>  
> +static void __init ls1021a_init_time(void)
> +{
> +	of_clk_init(NULL);
> +	clocksource_of_init();
> +	tick_setup_hrtimer_broadcast();
> +}
> +
>  DT_MACHINE_START(LS1021A, "Freescale LS1021A")
>  	.smp		= smp_ops(ls1021a_smp_ops),
> +	.init_time	= ls1021a_init_time,
>  	.dt_compat	= ls1021a_dt_compat,
>  MACHINE_END
> -- 
> 1.8.0
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

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

* Re: [PATCH] arm: ls1021a: setup hrtimer based tick broadcast
  2014-12-05 10:27 ` Mark Rutland
@ 2014-12-05 10:57   ` Preeti U Murthy
  0 siblings, 0 replies; 3+ messages in thread
From: Preeti U Murthy @ 2014-12-05 10:57 UTC (permalink / raw)
  To: Mark Rutland, Jingchang Lu
  Cc: shawn.guo, linux-kernel, linux-arm-kernel, Lorenzo Pieralisi,
	Will Deacon

On 12/05/2014 03:57 PM, Mark Rutland wrote:
> Hi,
> 
> On Fri, Dec 05, 2014 at 09:07:29AM +0000, Jingchang Lu wrote:
>> This adds setup of hrtimer based tick broadcast to utilize
>> the hrtimer in SMP without other broadcast tick devices.
>>
>> Signed-off-by: Jingchang Lu <jingchang.lu@freescale.com>
> 
> This shouldn't live in board code.
> 
> Similarly to what happens with the generic dummy timer on all arches
> that select it (and the broadcast hrtimer on all arches that use it so
> far), we should just unconditionally register the broadcast hrtimer.
> 
> A real broadcast-capable clock event device will take preference if
> present, so we don't need to add board-specific code to only register
> this in certain conditions.

Hmm.. this makes sense to me. Let me send out a patch to do this.

Regards
Preeti U Murthy
> 
> Mark.
> 
>> ---
>>  arch/arm/mach-imx/mach-ls1021a.c | 12 ++++++++++++
>>  1 file changed, 12 insertions(+)
>>
>> diff --git a/arch/arm/mach-imx/mach-ls1021a.c b/arch/arm/mach-imx/mach-ls1021a.c
>> index b89c858..4d074cf 100644
>> --- a/arch/arm/mach-imx/mach-ls1021a.c
>> +++ b/arch/arm/mach-imx/mach-ls1021a.c
>> @@ -7,6 +7,10 @@
>>   * (at your option) any later version.
>>   */
>>  
>> +#include <linux/clockchips.h>
>> +#include <linux/clk-provider.h>
>> +#include <linux/clocksource.h>
>> +
>>  #include <asm/mach/arch.h>
>>  
>>  #include "common.h"
>> @@ -16,7 +20,15 @@ static const char * const ls1021a_dt_compat[] __initconst = {
>>  	NULL,
>>  };
>>  
>> +static void __init ls1021a_init_time(void)
>> +{
>> +	of_clk_init(NULL);
>> +	clocksource_of_init();
>> +	tick_setup_hrtimer_broadcast();
>> +}
>> +
>>  DT_MACHINE_START(LS1021A, "Freescale LS1021A")
>>  	.smp		= smp_ops(ls1021a_smp_ops),
>> +	.init_time	= ls1021a_init_time,
>>  	.dt_compat	= ls1021a_dt_compat,
>>  MACHINE_END
>> -- 
>> 1.8.0
>>
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>>
> 


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

end of thread, other threads:[~2014-12-05 10:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-05  9:07 [PATCH] arm: ls1021a: setup hrtimer based tick broadcast Jingchang Lu
2014-12-05 10:27 ` Mark Rutland
2014-12-05 10:57   ` Preeti U Murthy

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