Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

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