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
This commit is contained in:
commit
a75eda7bce
|
@ -31,16 +31,9 @@ static u64 notrace clps711x_sched_clock_read(void)
|
||||||
return ~readw(tcd);
|
return ~readw(tcd);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __init _clps711x_clksrc_init(struct clk *clock, void __iomem *base)
|
static void __init clps711x_clksrc_init(struct clk *clock, void __iomem *base)
|
||||||
{
|
{
|
||||||
unsigned long rate;
|
unsigned long rate = clk_get_rate(clock);
|
||||||
|
|
||||||
if (!base)
|
|
||||||
return -ENOMEM;
|
|
||||||
if (IS_ERR(clock))
|
|
||||||
return PTR_ERR(clock);
|
|
||||||
|
|
||||||
rate = clk_get_rate(clock);
|
|
||||||
|
|
||||||
tcd = base;
|
tcd = base;
|
||||||
|
|
||||||
|
@ -48,8 +41,6 @@ static int __init _clps711x_clksrc_init(struct clk *clock, void __iomem *base)
|
||||||
clocksource_mmio_readw_down);
|
clocksource_mmio_readw_down);
|
||||||
|
|
||||||
sched_clock_register(clps711x_sched_clock_read, 16, rate);
|
sched_clock_register(clps711x_sched_clock_read, 16, rate);
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static irqreturn_t clps711x_timer_interrupt(int irq, void *dev_id)
|
static 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,
|
||||||
struct clock_event_device *clkevt;
|
struct clock_event_device *clkevt;
|
||||||
unsigned long rate;
|
unsigned long rate;
|
||||||
|
|
||||||
if (!irq)
|
|
||||||
return -EINVAL;
|
|
||||||
if (!base)
|
|
||||||
return -ENOMEM;
|
|
||||||
if (IS_ERR(clock))
|
|
||||||
return PTR_ERR(clock);
|
|
||||||
|
|
||||||
clkevt = kzalloc(sizeof(*clkevt), GFP_KERNEL);
|
clkevt = kzalloc(sizeof(*clkevt), GFP_KERNEL);
|
||||||
if (!clkevt)
|
if (!clkevt)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
@ -93,31 +77,29 @@ static int __init _clps711x_clkevt_init(struct clk *clock, void __iomem *base,
|
||||||
"clps711x-timer", clkevt);
|
"clps711x-timer", clkevt);
|
||||||
}
|
}
|
||||||
|
|
||||||
void __init clps711x_clksrc_init(void __iomem *tc1_base, void __iomem *tc2_base,
|
|
||||||
unsigned int irq)
|
|
||||||
{
|
|
||||||
struct clk *tc1 = clk_get_sys("clps711x-timer.0", NULL);
|
|
||||||
struct clk *tc2 = clk_get_sys("clps711x-timer.1", NULL);
|
|
||||||
|
|
||||||
BUG_ON(_clps711x_clksrc_init(tc1, tc1_base));
|
|
||||||
BUG_ON(_clps711x_clkevt_init(tc2, tc2_base, irq));
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CONFIG_TIMER_OF
|
|
||||||
static int __init clps711x_timer_init(struct device_node *np)
|
static int __init clps711x_timer_init(struct device_node *np)
|
||||||
{
|
{
|
||||||
unsigned int irq = irq_of_parse_and_map(np, 0);
|
unsigned int irq = irq_of_parse_and_map(np, 0);
|
||||||
struct clk *clock = of_clk_get(np, 0);
|
struct clk *clock = of_clk_get(np, 0);
|
||||||
void __iomem *base = of_iomap(np, 0);
|
void __iomem *base = of_iomap(np, 0);
|
||||||
|
|
||||||
|
if (!base)
|
||||||
|
return -ENOMEM;
|
||||||
|
if (!irq)
|
||||||
|
return -EINVAL;
|
||||||
|
if (IS_ERR(clock))
|
||||||
|
return PTR_ERR(clock);
|
||||||
|
|
||||||
switch (of_alias_get_id(np, "timer")) {
|
switch (of_alias_get_id(np, "timer")) {
|
||||||
case CLPS711X_CLKSRC_CLOCKSOURCE:
|
case CLPS711X_CLKSRC_CLOCKSOURCE:
|
||||||
return _clps711x_clksrc_init(clock, base);
|
clps711x_clksrc_init(clock, base);
|
||||||
|
break;
|
||||||
case CLPS711X_CLKSRC_CLOCKEVENT:
|
case CLPS711X_CLKSRC_CLOCKEVENT:
|
||||||
return _clps711x_clkevt_init(clock, base, irq);
|
return _clps711x_clkevt_init(clock, base, irq);
|
||||||
default:
|
default:
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
TIMER_OF_DECLARE(clps711x, "cirrus,ep7209-timer", clps711x_timer_init);
|
TIMER_OF_DECLARE(clps711x, "cirrus,ep7209-timer", clps711x_timer_init);
|
||||||
#endif
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ static irqreturn_t gic_compare_interrupt(int irq, void *dev_id)
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct irqaction gic_compare_irqaction = {
|
static struct irqaction gic_compare_irqaction = {
|
||||||
.handler = gic_compare_interrupt,
|
.handler = gic_compare_interrupt,
|
||||||
.percpu_dev_id = &gic_clockevent_device,
|
.percpu_dev_id = &gic_clockevent_device,
|
||||||
.flags = IRQF_PERCPU | IRQF_TIMER,
|
.flags = IRQF_PERCPU | IRQF_TIMER,
|
||||||
|
|
|
@ -71,7 +71,7 @@ static u64 tc_get_cycles32(struct clocksource *cs)
|
||||||
return readl_relaxed(tcaddr + ATMEL_TC_REG(0, CV));
|
return readl_relaxed(tcaddr + ATMEL_TC_REG(0, CV));
|
||||||
}
|
}
|
||||||
|
|
||||||
void tc_clksrc_suspend(struct clocksource *cs)
|
static void tc_clksrc_suspend(struct clocksource *cs)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ void tc_clksrc_suspend(struct clocksource *cs)
|
||||||
bmr_cache = readl(tcaddr + ATMEL_TC_BMR);
|
bmr_cache = readl(tcaddr + ATMEL_TC_BMR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void tc_clksrc_resume(struct clocksource *cs)
|
static void tc_clksrc_resume(struct clocksource *cs)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ static u64 riscv_sched_clock(void)
|
||||||
static DEFINE_PER_CPU(struct clocksource, riscv_clocksource) = {
|
static DEFINE_PER_CPU(struct clocksource, riscv_clocksource) = {
|
||||||
.name = "riscv_clocksource",
|
.name = "riscv_clocksource",
|
||||||
.rating = 300,
|
.rating = 300,
|
||||||
.mask = CLOCKSOURCE_MASK(BITS_PER_LONG),
|
.mask = CLOCKSOURCE_MASK(64),
|
||||||
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
|
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
|
||||||
.read = riscv_clocksource_rdtime,
|
.read = riscv_clocksource_rdtime,
|
||||||
};
|
};
|
||||||
|
@ -120,8 +120,7 @@ static int __init riscv_timer_init_dt(struct device_node *n)
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
sched_clock_register(riscv_sched_clock,
|
sched_clock_register(riscv_sched_clock, 64, riscv_timebase);
|
||||||
BITS_PER_LONG, riscv_timebase);
|
|
||||||
|
|
||||||
error = cpuhp_setup_state(CPUHP_AP_RISCV_TIMER_STARTING,
|
error = cpuhp_setup_state(CPUHP_AP_RISCV_TIMER_STARTING,
|
||||||
"clockevents/riscv/timer:starting",
|
"clockevents/riscv/timer:starting",
|
||||||
|
|
|
@ -586,8 +586,8 @@ static int omap_dm_timer_set_load(struct omap_dm_timer *timer, int autoreload,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Optimized set_load which removes costly spin wait in timer_start */
|
/* Optimized set_load which removes costly spin wait in timer_start */
|
||||||
int omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload,
|
static int omap_dm_timer_set_load_start(struct omap_dm_timer *timer,
|
||||||
unsigned int load)
|
int autoreload, unsigned int load)
|
||||||
{
|
{
|
||||||
u32 l;
|
u32 l;
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ struct clocksource * __init __weak clocksource_default_clock(void)
|
||||||
return &clocksource_jiffies;
|
return &clocksource_jiffies;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct clocksource refined_jiffies;
|
static struct clocksource refined_jiffies;
|
||||||
|
|
||||||
int register_refined_jiffies(long cycles_per_second)
|
int register_refined_jiffies(long cycles_per_second)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue