History

Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull timer fixes from Thomas Gleixner: "A set of small fixes plus the removal of stale board support code: - Remove the board support code from the clpx711x clocksource driver. This change had fallen through the cracks and I'm sending it now rather than dealing with people who want to improve that stale code for 3 month. - Use the proper clocksource mask on RICSV - Make local scope functions and variables static" * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: clocksource/drivers/clps711x: Remove board support clocksource/drivers/riscv: Fix clocksource mask clocksource/drivers/mips-gic-timer: Make gic_compare_irqaction static clocksource/drivers/timer-ti-dm: Make omap_dm_timer_set_load_start() static clocksource/drivers/tcb_clksrc: Make tc_clksrc_suspend/resume() static clocksource/drivers/clps711x: Make clps711x_clksrc_init() static time/jiffies: Make refined_jiffies static

Linus Torvalds committed 7 years ago

Commit a75eda72 parents f6cc519 2a6a8e26 files · +21 −40Browse files

Unified · Split

6 files
  1. drivers/clocksource/clps711x-timer.c +13 −31
  2. drivers/clocksource/mips-gic-timer.c +1 −1
  3. drivers/clocksource/tcb_clksrc.c +2 −2
  4. drivers/clocksource/timer-riscv.c +2 −3
  5. drivers/clocksource/timer-ti-dm.c +2 −2
  6. kernel/time/jiffies.c +1 −1
drivers/clocksource/clps711x-timer.c+13−31
@@ -31,16 +31,9 @@ static u64 notrace clps711x_sched_clock_read(void) · 30 unmodified lines
31 return ~readw(tcd);31 return ~readw(tcd);
32}32}
33 33
34static int __init _clps711x_clksrc_init(struct clk *clock, void __iomem *base)34static void __init clps711x_clksrc_init(struct clk *clock, void __iomem *base)
35{35{
36 unsigned long rate;36 unsigned long rate = clk_get_rate(clock);
37
38 if (!base)
39 return -ENOMEM;
40 if (IS_ERR(clock))
41 return PTR_ERR(clock);
42
43 rate = clk_get_rate(clock);
44 37
45 tcd = base;38 tcd = base;
46 39
@@ -48,8 +41,6 @@ static int __init _clps711x_clksrc_init(struct clk *clock, void __iomem *base) · 1 unmodified line
48 clocksource_mmio_readw_down);41 clocksource_mmio_readw_down);
49 42
50 sched_clock_register(clps711x_sched_clock_read, 16, rate);43 sched_clock_register(clps711x_sched_clock_read, 16, rate);
51
52 return 0;
53}44}
54 45
55static irqreturn_t clps711x_timer_interrupt(int irq, void *dev_id)46static irqreturn_t clps711x_timer_interrupt(int irq, void *dev_id)
@@ -67,13 +58,6 @@ static int __init _clps711x_clkevt_init(struct clk *clock, void __iomem *base, · 11 unmodified lines
67 struct clock_event_device *clkevt;58 struct clock_event_device *clkevt;
68 unsigned long rate;59 unsigned long rate;
69 60
70 if (!irq)
71 return -EINVAL;
72 if (!base)
73 return -ENOMEM;
74 if (IS_ERR(clock))
75 return PTR_ERR(clock);
76
77 clkevt = kzalloc(sizeof(*clkevt), GFP_KERNEL);61 clkevt = kzalloc(sizeof(*clkevt), GFP_KERNEL);
78 if (!clkevt)62 if (!clkevt)
79 return -ENOMEM;63 return -ENOMEM;
@@ -93,31 +77,29 @@ static int __init _clps711x_clkevt_init(struct clk *clock, void __iomem *base, · 13 unmodified lines
93 "clps711x-timer", clkevt);77 "clps711x-timer", clkevt);
94}78}
95 79
96void __init clps711x_clksrc_init(void __iomem *tc1_base, void __iomem *tc2_base,
97 unsigned int irq)
98{
99 struct clk *tc1 = clk_get_sys("clps711x-timer.0", NULL);
100 struct clk *tc2 = clk_get_sys("clps711x-timer.1", NULL);
101
102 BUG_ON(_clps711x_clksrc_init(tc1, tc1_base));
103 BUG_ON(_clps711x_clkevt_init(tc2, tc2_base, irq));
104}
105
106#ifdef CONFIG_TIMER_OF
107static int __init clps711x_timer_init(struct device_node *np)80static int __init clps711x_timer_init(struct device_node *np)
108{81{
109 unsigned int irq = irq_of_parse_and_map(np, 0);82 unsigned int irq = irq_of_parse_and_map(np, 0);
110 struct clk *clock = of_clk_get(np, 0);83 struct clk *clock = of_clk_get(np, 0);
111 void __iomem *base = of_iomap(np, 0);84 void __iomem *base = of_iomap(np, 0);
112 85
86 if (!base)
87 return -ENOMEM;
88 if (!irq)
89 return -EINVAL;
90 if (IS_ERR(clock))
91 return PTR_ERR(clock);
92
113 switch (of_alias_get_id(np, "timer")) {93 switch (of_alias_get_id(np, "timer")) {
114 case CLPS711X_CLKSRC_CLOCKSOURCE:94 case CLPS711X_CLKSRC_CLOCKSOURCE:
115 return _clps711x_clksrc_init(clock, base);95 clps711x_clksrc_init(clock, base);
96 break;
116 case CLPS711X_CLKSRC_CLOCKEVENT:97 case CLPS711X_CLKSRC_CLOCKEVENT:
117 return _clps711x_clkevt_init(clock, base, irq);98 return _clps711x_clkevt_init(clock, base, irq);
118 default:99 default:
119 return -EINVAL;100 return -EINVAL;
120 }101 }
102
103 return 0;
121}104}
122TIMER_OF_DECLARE(clps711x, "cirrus,ep7209-timer", clps711x_timer_init);105TIMER_OF_DECLARE(clps711x, "cirrus,ep7209-timer", clps711x_timer_init);
123#endif
drivers/clocksource/mips-gic-timer.c+1−1
@@ -67,7 +67,7 @@ static irqreturn_t gic_compare_interrupt(int irq, void *dev_id) · 66 unmodified lines
67 return IRQ_HANDLED;67 return IRQ_HANDLED;
68}68}
69 69
70struct irqaction gic_compare_irqaction = {70static struct irqaction gic_compare_irqaction = {
71 .handler = gic_compare_interrupt,71 .handler = gic_compare_interrupt,
72 .percpu_dev_id = &gic_clockevent_device,72 .percpu_dev_id = &gic_clockevent_device,
73 .flags = IRQF_PERCPU | IRQF_TIMER,73 .flags = IRQF_PERCPU | IRQF_TIMER,
drivers/clocksource/tcb_clksrc.c+2−2
@@ -71,7 +71,7 @@ static u64 tc_get_cycles32(struct clocksource *cs) · 70 unmodified lines
71 return readl_relaxed(tcaddr + ATMEL_TC_REG(0, CV));71 return readl_relaxed(tcaddr + ATMEL_TC_REG(0, CV));
72}72}
73 73
74void tc_clksrc_suspend(struct clocksource *cs)74static void tc_clksrc_suspend(struct clocksource *cs)
75{75{
76 int i;76 int i;
77 77
@@ -86,7 +86,7 @@ void tc_clksrc_suspend(struct clocksource *cs) · 8 unmodified lines
86 bmr_cache = readl(tcaddr + ATMEL_TC_BMR);86 bmr_cache = readl(tcaddr + ATMEL_TC_BMR);
87}87}
88 88
89void tc_clksrc_resume(struct clocksource *cs)89static void tc_clksrc_resume(struct clocksource *cs)
90{90{
91 int i;91 int i;
92 92
drivers/clocksource/timer-riscv.c+2−3
@@ -58,7 +58,7 @@ static u64 riscv_sched_clock(void) · 57 unmodified lines
58static DEFINE_PER_CPU(struct clocksource, riscv_clocksource) = {58static DEFINE_PER_CPU(struct clocksource, riscv_clocksource) = {
59 .name = "riscv_clocksource",59 .name = "riscv_clocksource",
60 .rating = 300,60 .rating = 300,
61 .mask = CLOCKSOURCE_MASK(BITS_PER_LONG),61 .mask = CLOCKSOURCE_MASK(64),
62 .flags = CLOCK_SOURCE_IS_CONTINUOUS,62 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
63 .read = riscv_clocksource_rdtime,63 .read = riscv_clocksource_rdtime,
64};64};
@@ -120,8 +120,7 @@ static int __init riscv_timer_init_dt(struct device_node *n) · 55 unmodified lines
120 return error;120 return error;
121 }121 }
122 122
123 sched_clock_register(riscv_sched_clock,123 sched_clock_register(riscv_sched_clock, 64, riscv_timebase);
124 BITS_PER_LONG, riscv_timebase);
125 124
126 error = cpuhp_setup_state(CPUHP_AP_RISCV_TIMER_STARTING,125 error = cpuhp_setup_state(CPUHP_AP_RISCV_TIMER_STARTING,
127 "clockevents/riscv/timer:starting",126 "clockevents/riscv/timer:starting",
drivers/clocksource/timer-ti-dm.c+2−2
@@ -586,8 +586,8 @@ static int omap_dm_timer_set_load(struct omap_dm_timer *timer, int autoreload, · 585 unmodified lines
586}586}
587 587
588/* Optimized set_load which removes costly spin wait in timer_start */588/* Optimized set_load which removes costly spin wait in timer_start */
589int omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload,589static int omap_dm_timer_set_load_start(struct omap_dm_timer *timer,
590 unsigned int load)590 int autoreload, unsigned int load)
591{591{
592 u32 l;592 u32 l;
593 593
kernel/time/jiffies.c+1−1
@@ -89,7 +89,7 @@ struct clocksource * __init __weak clocksource_default_clock(void) · 88 unmodified lines
89 return &clocksource_jiffies;89 return &clocksource_jiffies;
90}90}
91 91
92struct clocksource refined_jiffies;92static struct clocksource refined_jiffies;
93 93
94int register_refined_jiffies(long cycles_per_second)94int register_refined_jiffies(long cycles_per_second)
95{95{