public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHv5 1/2] clocksource: dw_apb_timer_of: Fix read_sched_clock
@ 2013-12-10 16:07 dinguyen
  2013-12-10 16:07 ` [PATCHv5 2/2] clocksource: dw_apb_timer_of: Fix support for dts binding "snps,dw-apb-timer" dinguyen
  2013-12-10 18:53 ` [PATCHv5 1/2] clocksource: dw_apb_timer_of: Fix read_sched_clock Daniel Lezcano
  0 siblings, 2 replies; 4+ messages in thread
From: dinguyen @ 2013-12-10 16:07 UTC (permalink / raw)
  To: dinh.linux, mingo, daniel.lezcano, tglx
  Cc: jamie, linus.walleij, linux-kernel, heiko, Dinh Nguyen

From: Dinh Nguyen <dinguyen@altera.com>

The read_sched_clock should return the ~value because the clock is a
countdown implementation. read_sched_clock() should be the same as
 __apbt_read_clocksource().

Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
---
v5: Split up into 2 patches
v4: Simplify the fix by simply returning ~__raw_readl(sched_io_base)
v3: Use APBTMR_N_CURRENT_VALUE define in read_sched_clock()
v2: Maintain backwards compatibility for "dw-apb-timer-sp" and
      "dw-apb-timer-osc".
---
 drivers/clocksource/dw_apb_timer_of.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/dw_apb_timer_of.c b/drivers/clocksource/dw_apb_timer_of.c
index 45ba8ae..b29d7cd 100644
--- a/drivers/clocksource/dw_apb_timer_of.c
+++ b/drivers/clocksource/dw_apb_timer_of.c
@@ -108,7 +108,7 @@ static void __init add_clocksource(struct device_node *source_timer)
 
 static u64 read_sched_clock(void)
 {
-	return __raw_readl(sched_io_base);
+	return ~__raw_readl(sched_io_base);
 }
 
 static const struct of_device_id sptimer_ids[] __initconst = {
-- 
1.7.9.5



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

* [PATCHv5 2/2] clocksource: dw_apb_timer_of: Fix support for dts binding "snps,dw-apb-timer"
  2013-12-10 16:07 [PATCHv5 1/2] clocksource: dw_apb_timer_of: Fix read_sched_clock dinguyen
@ 2013-12-10 16:07 ` dinguyen
  2013-12-10 18:53 ` [PATCHv5 1/2] clocksource: dw_apb_timer_of: Fix read_sched_clock Daniel Lezcano
  1 sibling, 0 replies; 4+ messages in thread
From: dinguyen @ 2013-12-10 16:07 UTC (permalink / raw)
  To: dinh.linux, mingo, daniel.lezcano, tglx
  Cc: jamie, linus.walleij, linux-kernel, heiko, Dinh Nguyen

From: Dinh Nguyen <dinguyen@altera.com>

In commit 620f5e1cbf (dts: Rename DW APB timer compatible strings), both
"snps,dw-apb-timer-sp" and "snps,dw-apb-timer-osc" were deprecated in place
of "snps,dw-apb-timer". But the driver also needs to be udpated in order to
support this new binding "snps,dw-apb-timer".

Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
---
v5: Separate patch to fix bindings
v4: none
v3: none
v2: none
---
 drivers/clocksource/dw_apb_timer_of.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/clocksource/dw_apb_timer_of.c b/drivers/clocksource/dw_apb_timer_of.c
index b29d7cd..8d6e5f6 100644
--- a/drivers/clocksource/dw_apb_timer_of.c
+++ b/drivers/clocksource/dw_apb_timer_of.c
@@ -113,7 +113,6 @@ static u64 read_sched_clock(void)
 
 static const struct of_device_id sptimer_ids[] __initconst = {
 	{ .compatible = "picochip,pc3x2-rtc" },
-	{ .compatible = "snps,dw-apb-timer-sp" },
 	{ /* Sentinel */ },
 };
 
@@ -151,4 +150,7 @@ static void __init dw_apb_timer_init(struct device_node *timer)
 	num_called++;
 }
 CLOCKSOURCE_OF_DECLARE(pc3x2_timer, "picochip,pc3x2-timer", dw_apb_timer_init);
-CLOCKSOURCE_OF_DECLARE(apb_timer, "snps,dw-apb-timer-osc", dw_apb_timer_init);
+CLOCKSOURCE_OF_DECLARE(apb_timer_osc, "snps,dw-apb-timer-osc", dw_apb_timer_init);
+CLOCKSOURCE_OF_DECLARE(apb_timer_sp, "snps,dw-apb-timer-sp", dw_apb_timer_init);
+CLOCKSOURCE_OF_DECLARE(apb_timer, "snps,dw-apb-timer", dw_apb_timer_init);
+
-- 
1.7.9.5



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

* Re: [PATCHv5 1/2] clocksource: dw_apb_timer_of: Fix read_sched_clock
  2013-12-10 16:07 [PATCHv5 1/2] clocksource: dw_apb_timer_of: Fix read_sched_clock dinguyen
  2013-12-10 16:07 ` [PATCHv5 2/2] clocksource: dw_apb_timer_of: Fix support for dts binding "snps,dw-apb-timer" dinguyen
@ 2013-12-10 18:53 ` Daniel Lezcano
  2013-12-10 19:26   ` Dinh Nguyen
  1 sibling, 1 reply; 4+ messages in thread
From: Daniel Lezcano @ 2013-12-10 18:53 UTC (permalink / raw)
  To: dinguyen, dinh.linux, mingo, tglx
  Cc: jamie, linus.walleij, linux-kernel, heiko

On 12/10/2013 05:07 PM, dinguyen@altera.com wrote:
> From: Dinh Nguyen <dinguyen@altera.com>
>
> The read_sched_clock should return the ~value because the clock is a
> countdown implementation. read_sched_clock() should be the same as
>   __apbt_read_clocksource().
>
> Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
> ---
> v5: Split up into 2 patches
> v4: Simplify the fix by simply returning ~__raw_readl(sched_io_base)
> v3: Use APBTMR_N_CURRENT_VALUE define in read_sched_clock()
> v2: Maintain backwards compatibility for "dw-apb-timer-sp" and
>        "dw-apb-timer-osc".
> ---
>   drivers/clocksource/dw_apb_timer_of.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clocksource/dw_apb_timer_of.c b/drivers/clocksource/dw_apb_timer_of.c
> index 45ba8ae..b29d7cd 100644
> --- a/drivers/clocksource/dw_apb_timer_of.c
> +++ b/drivers/clocksource/dw_apb_timer_of.c
> @@ -108,7 +108,7 @@ static void __init add_clocksource(struct device_node *source_timer)
>
>   static u64 read_sched_clock(void)
>   {
> -	return __raw_readl(sched_io_base);
> +	return ~__raw_readl(sched_io_base);
>   }

Dinh,

I dropped the patch moving the macro definitions as it is not applied 
for urgent and I assume it is not needed for the 3.14 as there are no 
more patches depending on it.

   -- Daniel

>   static const struct of_device_id sptimer_ids[] __initconst = {
>


-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


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

* Re: [PATCHv5 1/2] clocksource: dw_apb_timer_of: Fix read_sched_clock
  2013-12-10 18:53 ` [PATCHv5 1/2] clocksource: dw_apb_timer_of: Fix read_sched_clock Daniel Lezcano
@ 2013-12-10 19:26   ` Dinh Nguyen
  0 siblings, 0 replies; 4+ messages in thread
From: Dinh Nguyen @ 2013-12-10 19:26 UTC (permalink / raw)
  To: Daniel Lezcano
  Cc: dinh.linux, mingo, tglx, jamie, linus.walleij, linux-kernel,
	heiko

On Tue, 2013-12-10 at 19:53 +0100, Daniel Lezcano wrote:
> On 12/10/2013 05:07 PM, dinguyen@altera.com wrote:
> > From: Dinh Nguyen <dinguyen@altera.com>
> >
> > The read_sched_clock should return the ~value because the clock is a
> > countdown implementation. read_sched_clock() should be the same as
> >   __apbt_read_clocksource().
> >
> > Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
> > ---
> > v5: Split up into 2 patches
> > v4: Simplify the fix by simply returning ~__raw_readl(sched_io_base)
> > v3: Use APBTMR_N_CURRENT_VALUE define in read_sched_clock()
> > v2: Maintain backwards compatibility for "dw-apb-timer-sp" and
> >        "dw-apb-timer-osc".
> > ---
> >   drivers/clocksource/dw_apb_timer_of.c |    2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/clocksource/dw_apb_timer_of.c b/drivers/clocksource/dw_apb_timer_of.c
> > index 45ba8ae..b29d7cd 100644
> > --- a/drivers/clocksource/dw_apb_timer_of.c
> > +++ b/drivers/clocksource/dw_apb_timer_of.c
> > @@ -108,7 +108,7 @@ static void __init add_clocksource(struct device_node *source_timer)
> >
> >   static u64 read_sched_clock(void)
> >   {
> > -	return __raw_readl(sched_io_base);
> > +	return ~__raw_readl(sched_io_base);
> >   }
> 
> Dinh,
> 
> I dropped the patch moving the macro definitions as it is not applied 
> for urgent and I assume it is not needed for the 3.14 as there are no 
> more patches depending on it.

That's fine. Thanks Daniel!

Dinh
> 
>    -- Daniel
> 
> >   static const struct of_device_id sptimer_ids[] __initconst = {
> >
> 
> 




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

end of thread, other threads:[~2013-12-10 19:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-10 16:07 [PATCHv5 1/2] clocksource: dw_apb_timer_of: Fix read_sched_clock dinguyen
2013-12-10 16:07 ` [PATCHv5 2/2] clocksource: dw_apb_timer_of: Fix support for dts binding "snps,dw-apb-timer" dinguyen
2013-12-10 18:53 ` [PATCHv5 1/2] clocksource: dw_apb_timer_of: Fix read_sched_clock Daniel Lezcano
2013-12-10 19:26   ` Dinh Nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox