Convert setup_sched_clock() users in drivers/clocksource
cover Convert setup_sched_clock() users in drivers/clocksource
Daniel,
These patches convert the remaining few users in drivers/clocksource to the new sched_clock_register() API. These were new drivers to this directory after I sent out the sched_clock conversion patches a few months back. Patches are based on Linus' tip, compile tested only.
Stephen Boyd (4):
clocksource: arm_global_timer: Switch to sched_clock_register()
clocksource: cadence_ttc_timer: Switch to sched_clock_register()
clocksource: sun4i: Switch to sched_clock_register()
clocksource: orion: Switch to sched_clock_register()
drivers/clocksource/arm_global_timer.c | 4 ++-- drivers/clocksource/cadence_ttc_timer.c | 4 ++-- drivers/clocksource/sun4i_timer.c | 4 ++-- drivers/clocksource/time-orion.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-)
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
PATCH 2/4 clocksource: cadence_ttc_timer: Switch to sched_clock_register()
The 32 bit sched_clock interface now supports 64 bits. Upgrade to the 64 bit function to allow us to remove the 32 bit registration interface.
--- drivers/clocksource/cadence_ttc_timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clocksource/cadence_ttc_timer.c +2 -2
@@ -158,7 +158,7 @@ static cycle_t __ttc_clocksource_read(struct clocksource *cs) TTC_COUNT_VAL_OFFSET); } -static u32 notrace ttc_sched_clock_read(void) +static u64 notrace ttc_sched_clock_read(void) {return __raw_readl (ttc_sched_clock_val_reg); }
@@ -306,7 +306,7 @@ static void __init ttc_setup_clocksource(struct clk *clk, void __iomem *base) } ttc_sched_clock_val_reg = base +TTC_COUNT_VAL_OFFSET ; -setup_sched_clock (ttc_sched_clock_read,16 , +sched_clock_register (ttc_sched_clock_read,16 ,clk_get_rate (ttccs->ttc.clk) /PRESCALE ); }
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
PATCH 3/4 clocksource: sun4i: Switch to sched_clock_register()
In reply to Stephen BoydThe 32 bit sched_clock interface now supports 64 bits. Upgrade to the 64 bit function to allow us to remove the 32 bit registration interface. While we're here, mark the sched_clock function as notrace to prevent ftrace recursion crashes.
--- drivers/clocksource/sun4i_timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clocksource/sun4i_timer.c +2 -2
@@ -138,7 +138,7 @@ static struct irqaction sun4i_timer_irq = { .dev_id = &sun4i_clockevent, }; -static u32 sun4i_timer_sched_read (void ) +static u64 notrace sun4i_timer_sched_read(void) {return ~readl (timer_base +TIMER_CNTVAL_REG (1 )); }
@@ -170,7 +170,7 @@ static void __init sun4i_timer_init(struct device_node *node)TIMER_CTL_CLK_SRC (TIMER_CTL_CLK_SRC_OSC24M ), timer_base + TIMER_CTL_REG(1)); -setup_sched_clock (sun4i_timer_sched_read,32 , rate); +sched_clock_register (sun4i_timer_sched_read,32 , rate);clocksource_mmio_init (timer_base +TIMER_CNTVAL_REG (1 ), node->name, rate,300 ,32 , clocksource_mmio_readl_down);
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
PATCH 4/4 clocksource: orion: Switch to sched_clock_register()
In reply to Stephen BoydThe 32 bit sched_clock interface now supports 64 bits. Upgrade to the 64 bit function to allow us to remove the 32 bit registration interface.
--- drivers/clocksource/time-orion.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clocksource/time-orion.c +2 -2
@@ -53,7 +53,7 @@ EXPORT_SYMBOL(orion_timer_ctrl_clrset);/* * Free-running clocksource handling. */ -static u32 notrace orion_read_sched_clock(void) +static u64 notrace orion_read_sched_clock(void) {return ~readl (timer_base +TIMER0_VAL ); }
@@ -135,7 +135,7 @@ static void __init orion_timer_init(struct device_node *np)clocksource_mmio_init (timer_base +TIMER0_VAL ,"orion_clocksource" ,clk_get_rate (clk),300 ,32 , clocksource_mmio_readl_down); -setup_sched_clock (orion_read_sched_clock,32 ,clk_get_rate (clk)); +sched_clock_register (orion_read_sched_clock,32 ,clk_get_rate (clk));/* setup timer1 as clockevent timer */ if (setup_irq (irq, &orion_clkevt_irq))
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
PATCH 1/4 clocksource: arm_global_timer: Switch to sched_clock_register()
In reply to Stephen BoydThe 32 bit sched_clock interface now supports 64 bits. Upgrade to the 64 bit function to allow us to remove the 32 bit registration interface. While we're here increase the number of bits that sched_clock can handle to 64 to make full use of the counter.
--- drivers/clocksource/arm_global_timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clocksource/arm_global_timer.c +2 -2
@@ -202,7 +202,7 @@ static struct clocksource gt_clocksource = { };#ifdef CONFIG_CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK -static u32 notrace gt_sched_clock_read(void) +static u64 notrace gt_sched_clock_read(void) {return gt_counter_read (); }
@@ -217,7 +217,7 @@ static void __init gt_clocksource_init(void)writel (GT_CONTROL_TIMER_ENABLE , gt_base +GT_CONTROL );#ifdef CONFIG_CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK -setup_sched_clock (gt_sched_clock_read,32 , gt_clk_rate); +sched_clock_register (gt_sched_clock_read,64 , gt_clk_rate);#endif clocksource_register_hz (>_clocksource, gt_clk_rate); }
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
Re: [PATCH 2/4] clocksource: cadence_ttc_timer: Switch to sched_clock_register()
In reply to Stephen BoydQuoted 7 lines · Stephen Boyd
The 32 bit
sched_clockinterface now supports 64 bits. Upgrade to the 64 bit function to allow us to remove the 32 bit registration interface.Cc Soren Brinkmann <[email protected]>Cc Michal Simek <[email protected]>Signed-off-by Stephen Boyd <[email protected]>
Small enough of a change to quickly test. Works fine.
Thanks,
Sören
Re: [PATCH 4/4] clocksource: orion: Switch to sched_clock_register()
In reply to Stephen BoydQuoted 6 lines · Stephen Boyd
The 32 bit
sched_clockinterface now supports 64 bits. Upgrade to the 64 bit function to allow us to remove the 32 bit registration interface.Cc Sebastian Hesselbarth <[email protected]>Signed-off-by Stephen Boyd <[email protected]>
Thanks!
Quoted 27 lines
--- drivers/clocksource/time-orion.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/clocksource/time-orion.c +2
-2@@ -53,7 +53,7 @@ EXPORT_SYMBOL(orion_timer_ctrl_clrset);/* * Free-running clocksource handling. */ -static u32 notrace orion_read_sched_clock(void) +static u64 notrace orion_read_sched_clock(void) {return ~readl (timer_base +TIMER0_VAL ); }@@ -135,7 +135,7 @@ static void __init orion_timer_init(struct device_node *np)clocksource_mmio_init (timer_base +TIMER0_VAL ,"orion_clocksource" ,clk_get_rate (clk),300 ,32 , clocksource_mmio_readl_down); -setup_sched_clock (orion_read_sched_clock,32 ,clk_get_rate (clk)); +sched_clock_register (orion_read_sched_clock,32 ,clk_get_rate (clk));/* setup timer1 as clockevent timer */ if (setup_irq (irq, &orion_clkevt_irq))
Re: [PATCH 1/4] clocksource: arm_global_timer: Switch to sched_clock_register()
In reply to Stephen Boyddrivers/clocksource/arm_global_timer.c static struct clocksource gt_clocksource = {
Quoted 17 lines · Stephen Boyd
The 32 bit
sched_clockinterface now supports 64 bits. Upgrade to the 64 bit function to allow us to remove the 32 bit registration interface. While we're here increase the number of bits thatsched_clockcan handle to 64 to make full use of the counter.Cc Stuart Menefy <[email protected]>Cc Srinivas Kandagatla <[email protected]>Signed-off-by Stephen Boyd <[email protected]>--- drivers/clocksource/arm_global_timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/clocksource/arm_global_timer.c +0
-0@@ -202,7 +202,7 @@ static struct clocksource gt_clocksource = {
Thankyou for the patch.
Re: [PATCH 1/4] clocksource: arm_global_timer: Switch to sched_clock_register()
In reply to Stephen BoydLooks good, thanks.
Quoted 35 lines · Stephen Boyd
The 32 bit
sched_clockinterface now supports 64 bits. Upgrade to the 64 bit function to allow us to remove the 32 bit registration interface. While we're here increase the number of bits thatsched_clockcan handle to 64 to make full use of the counter.Cc Stuart Menefy <[email protected]>Cc Srinivas Kandagatla <[email protected]>Signed-off-by Stephen Boyd <[email protected]>--- drivers/clocksource/arm_global_timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/clocksource/arm_global_timer.c +2
-2@@ -202,7 +202,7 @@ static struct clocksource gt_clocksource = { };#ifdef CONFIG_CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK -static u32 notrace gt_sched_clock_read(void) +static u64 notrace gt_sched_clock_read(void) {return gt_counter_read (); }@@ -217,7 +217,7 @@ static void __init gt_clocksource_init(void)writel (GT_CONTROL_TIMER_ENABLE , gt_base +GT_CONTROL );#ifdef CONFIG_CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK -setup_sched_clock (gt_sched_clock_read,32 , gt_clk_rate); +sched_clock_register (gt_sched_clock_read,64 , gt_clk_rate);#endif clocksource_register_hz (>_clocksource, gt_clk_rate); }
Re: [PATCH 3/4] clocksource: sun4i: Switch to sched_clock_register()
In reply to Stephen BoydQuoted 8 lines · Stephen Boyd
The 32 bit
sched_clockinterface now supports 64 bits. Upgrade to the 64 bit function to allow us to remove the 32 bit registration interface. While we're here, mark thesched_clockfunction as notrace to prevent ftrace recursion crashes.Cc Maxime Ripard <[email protected]>Signed-off-by Stephen Boyd <[email protected]>---
Hi Maxime,
could you have look to this patch ?
Thanks
-- Daniel
Quoted 24 lines
drivers/clocksource/sun4i_timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/clocksource/sun4i_timer.c +2
-2@@ -138,7 +138,7 @@ static struct irqaction sun4i_timer_irq = { .dev_id = &sun4i_clockevent, }; -static u32 sun4i_timer_sched_read (void ) +static u64 notrace sun4i_timer_sched_read(void) {return ~readl (timer_base +TIMER_CNTVAL_REG (1 )); }@@ -170,7 +170,7 @@ static void __init sun4i_timer_init(struct device_node *node)TIMER_CTL_CLK_SRC (TIMER_CTL_CLK_SRC_OSC24M ), timer_base + TIMER_CTL_REG(1)); -setup_sched_clock (sun4i_timer_sched_read,32 , rate); +sched_clock_register (sun4i_timer_sched_read,32 , rate);clocksource_mmio_init (timer_base +TIMER_CNTVAL_REG (1 ), node->name, rate,300 ,32 , clocksource_mmio_readl_down);
Signature · 5 lines
<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
Re: [PATCH 3/4] clocksource: sun4i: Switch to sched_clock_register()
In reply to Stephen BoydQuoted 7 lines · Stephen Boyd
The 32 bit
sched_clockinterface now supports 64 bits. Upgrade to the 64 bit function to allow us to remove the 32 bit registration interface. While we're here, mark thesched_clockfunction as notrace to prevent ftrace recursion crashes.Cc Maxime Ripard <[email protected]>Signed-off-by Stephen Boyd <[email protected]>
Thanks!
Maxime
Signature · 3 lines
Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
Daniel Lezcano
AppliedQuoted 20 lines · Stephen Boyd
Daniel,
These patches convert the remaining few users in
drivers/clocksourceto the newsched_clock_register()API. These were new drivers to this directory after I sent out thesched_clockconversion patches a few months back. Patches are based on Linus' tip, compile tested only.Cc Stuart Menefy <[email protected]>Cc Srinivas Kandagatla <[email protected]>Cc Soren Brinkmann <[email protected]>Cc Michal Simek <[email protected]>Cc Maxime Ripard <[email protected]>Cc Sebastian Hesselbarth <[email protected]>Stephen Boyd (4):
clocksource:arm_global_timer: Switch tosched_clock_register()
clocksource:cadence_ttc_timer: Switch tosched_clock_register()
clocksource: sun4i: Switch tosched_clock_register()
clocksource: orion: Switch tosched_clock_register()
Quoted 5 lines
drivers/clocksource/arm_global_timer.c | 4 ++-- drivers/clocksource/cadence_ttc_timer.c | 4 ++-- drivers/clocksource/sun4i_timer.c | 4 ++-- drivers/clocksource/time-orion.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-)
Hi Stephen,
applied to my tree for 3.14.
Thanks !
Signature · 5 lines
<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