Skip to content

Commit

Permalink
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…linux/kernel/git/tip/tip

Pull timer updates from Thomas Gleixner:
 "This update provides the following changes:

   - The rework of the timer wheel which addresses the shortcomings of
     the current wheel (cascading, slow search for next expiring timer,
     etc).  That's the first major change of the wheel in almost 20
     years since Finn implemted it.

   - A large overhaul of the clocksource drivers init functions to
     consolidate the Device Tree initialization

   - Some more Y2038 updates

   - A capability fix for timerfd

   - Yet another clock chip driver

   - The usual pile of updates, comment improvements all over the place"

* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (130 commits)
  tick/nohz: Optimize nohz idle enter
  clockevents: Make clockevents_subsys static
  clocksource/drivers/time-armada-370-xp: Fix return value check
  timers: Implement optimization for same expiry time in mod_timer()
  timers: Split out index calculation
  timers: Only wake softirq if necessary
  timers: Forward the wheel clock whenever possible
  timers/nohz: Remove pointless tick_nohz_kick_tick() function
  timers: Optimize collect_expired_timers() for NOHZ
  timers: Move __run_timers() function
  timers: Remove set_timer_slack() leftovers
  timers: Switch to a non-cascading wheel
  timers: Reduce the CPU index space to 256k
  timers: Give a few structs and members proper names
  hlist: Add hlist_is_singular_node() helper
  signals: Use hrtimer for sigtimedwait()
  timers: Remove the deprecated mod_timer_pinned() API
  timers, net/ipv4/inet: Initialize connection request timers as pinned
  timers, drivers/tty/mips_ejtag: Initialize the poll timer as pinned
  timers, drivers/tty/metag_da: Initialize the poll timer as pinned
  ...
  • Loading branch information
Linus Torvalds committed Jul 26, 2016
2 parents c410614 + 1f3b0f8 commit 55392c4
Show file tree
Hide file tree
Showing 111 changed files with 2,460 additions and 1,208 deletions.
17 changes: 17 additions & 0 deletions Documentation/devicetree/bindings/timer/oxsemi,rps-timer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Oxford Semiconductor OXNAS SoCs Family RPS Timer
================================================

Required properties:
- compatible: Should be "oxsemi,ox810se-rps-timer"
- reg : Specifies base physical address and size of the registers.
- interrupts : The interrupts of the two timers
- clocks : The phandle of the timer clock source

example:

timer0: timer@200 {
compatible = "oxsemi,ox810se-rps-timer";
reg = <0x200 0x40>;
clocks = <&rpsclk>;
interrupts = <4 5>;
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
Rockchip rk3288 timer
Rockchip rk timer

Required properties:
- compatible: shall be "rockchip,rk3288-timer"
- compatible: shall be one of:
"rockchip,rk3288-timer" - for rk3066, rk3036, rk3188, rk322x, rk3288, rk3368
"rockchip,rk3399-timer" - for rk3399
- reg: base address of the timer register starting with TIMERS CONTROL register
- interrupts: should contain the interrupts for Timer0
- clocks : must contain an entry for each entry in clock-names
Expand Down
8 changes: 8 additions & 0 deletions Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,14 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
[SPARC64] tick
[X86-64] hpet,tsc

clocksource.arm_arch_timer.evtstrm=
[ARM,ARM64]
Format: <bool>
Enable/disable the eventstream feature of the ARM
architected timer so that code using WFE-based polling
loops can be debugged more effectively on production
systems.

clearcpuid=BITNUM [X86]
Disable CPUID feature X for the kernel. See
arch/x86/include/asm/cpufeatures.h for the valid bit
Expand Down
63 changes: 39 additions & 24 deletions arch/arc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,19 @@ static struct clocksource arc_counter_gfrc = {
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};

static void __init arc_cs_setup_gfrc(struct device_node *node)
static int __init arc_cs_setup_gfrc(struct device_node *node)
{
int exists = cpuinfo_arc700[0].extn.gfrc;
int ret;

if (WARN(!exists, "Global-64-bit-Ctr clocksource not detected"))
return;
return -ENXIO;

ret = arc_get_timer_clk(node);
if (ret)
return;
return ret;

clocksource_register_hz(&arc_counter_gfrc, arc_timer_freq);
return clocksource_register_hz(&arc_counter_gfrc, arc_timer_freq);
}
CLOCKSOURCE_OF_DECLARE(arc_gfrc, "snps,archs-timer-gfrc", arc_cs_setup_gfrc);

Expand Down Expand Up @@ -172,25 +172,25 @@ static struct clocksource arc_counter_rtc = {
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};

static void __init arc_cs_setup_rtc(struct device_node *node)
static int __init arc_cs_setup_rtc(struct device_node *node)
{
int exists = cpuinfo_arc700[smp_processor_id()].extn.rtc;
int ret;

if (WARN(!exists, "Local-64-bit-Ctr clocksource not detected"))
return;
return -ENXIO;

/* Local to CPU hence not usable in SMP */
if (WARN(IS_ENABLED(CONFIG_SMP), "Local-64-bit-Ctr not usable in SMP"))
return;
return -EINVAL;

ret = arc_get_timer_clk(node);
if (ret)
return;
return ret;

write_aux_reg(AUX_RTC_CTRL, 1);

clocksource_register_hz(&arc_counter_rtc, arc_timer_freq);
return clocksource_register_hz(&arc_counter_rtc, arc_timer_freq);
}
CLOCKSOURCE_OF_DECLARE(arc_rtc, "snps,archs-timer-rtc", arc_cs_setup_rtc);

Expand All @@ -213,23 +213,23 @@ static struct clocksource arc_counter_timer1 = {
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};

static void __init arc_cs_setup_timer1(struct device_node *node)
static int __init arc_cs_setup_timer1(struct device_node *node)
{
int ret;

/* Local to CPU hence not usable in SMP */
if (IS_ENABLED(CONFIG_SMP))
return;
return -EINVAL;

ret = arc_get_timer_clk(node);
if (ret)
return;
return ret;

write_aux_reg(ARC_REG_TIMER1_LIMIT, ARC_TIMER_MAX);
write_aux_reg(ARC_REG_TIMER1_CNT, 0);
write_aux_reg(ARC_REG_TIMER1_CTRL, TIMER_CTRL_NH);

clocksource_register_hz(&arc_counter_timer1, arc_timer_freq);
return clocksource_register_hz(&arc_counter_timer1, arc_timer_freq);
}

/********** Clock Event Device *********/
Expand Down Expand Up @@ -324,20 +324,28 @@ static struct notifier_block arc_timer_cpu_nb = {
/*
* clockevent setup for boot CPU
*/
static void __init arc_clockevent_setup(struct device_node *node)
static int __init arc_clockevent_setup(struct device_node *node)
{
struct clock_event_device *evt = this_cpu_ptr(&arc_clockevent_device);
int ret;

register_cpu_notifier(&arc_timer_cpu_nb);
ret = register_cpu_notifier(&arc_timer_cpu_nb);
if (ret) {
pr_err("Failed to register cpu notifier");
return ret;
}

arc_timer_irq = irq_of_parse_and_map(node, 0);
if (arc_timer_irq <= 0)
panic("clockevent: missing irq");
if (arc_timer_irq <= 0) {
pr_err("clockevent: missing irq");
return -EINVAL;
}

ret = arc_get_timer_clk(node);
if (ret)
panic("clockevent: missing clk");
if (ret) {
pr_err("clockevent: missing clk");
return ret;
}

evt->irq = arc_timer_irq;
evt->cpumask = cpumask_of(smp_processor_id());
Expand All @@ -347,22 +355,29 @@ static void __init arc_clockevent_setup(struct device_node *node)
/* Needs apriori irq_set_percpu_devid() done in intc map function */
ret = request_percpu_irq(arc_timer_irq, timer_irq_handler,
"Timer0 (per-cpu-tick)", evt);
if (ret)
panic("clockevent: unable to request irq\n");
if (ret) {
pr_err("clockevent: unable to request irq\n");
return ret;
}

enable_percpu_irq(arc_timer_irq, 0);

return 0;
}

static void __init arc_of_timer_init(struct device_node *np)
static int __init arc_of_timer_init(struct device_node *np)
{
static int init_count = 0;
int ret;

if (!init_count) {
init_count = 1;
arc_clockevent_setup(np);
ret = arc_clockevent_setup(np);
} else {
arc_cs_setup_timer1(np);
ret = arc_cs_setup_timer1(np);
}

return ret;
}
CLOCKSOURCE_OF_DECLARE(arc_clkevt, "snps,arc-timer", arc_of_timer_init);

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,10 @@ config ARCH_CLPS711X
bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
select ARCH_REQUIRE_GPIOLIB
select AUTO_ZRELADDR
select CLKSRC_MMIO
select COMMON_CLK
select CPU_ARM720T
select GENERIC_CLOCKEVENTS
select CLPS711X_TIMER
select MFD_SYSCON
select SOC_BUS
help
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/kernel/smp_twd.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ int __init twd_local_timer_register(struct twd_local_timer *tlt)
}

#ifdef CONFIG_OF
static void __init twd_local_timer_of_register(struct device_node *np)
static int __init twd_local_timer_of_register(struct device_node *np)
{
int err;

Expand All @@ -410,6 +410,7 @@ static void __init twd_local_timer_of_register(struct device_node *np)

out:
WARN(err, "twd_local_timer_of_register failed (%d)\n", err);
return err;
}
CLOCKSOURCE_OF_DECLARE(arm_twd_a9, "arm,cortex-a9-twd-timer", twd_local_timer_of_register);
CLOCKSOURCE_OF_DECLARE(arm_twd_a5, "arm,cortex-a5-twd-timer", twd_local_timer_of_register);
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-bcm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ config ARCH_BCM_MOBILE
select HAVE_ARM_ARCH_TIMER
select PINCTRL
select ARCH_BCM_MOBILE_SMP if SMP
select BCM_KONA_TIMER
help
This enables support for systems based on Broadcom mobile SoCs.

Expand Down Expand Up @@ -143,6 +144,7 @@ config ARCH_BCM2835
select ARM_TIMER_SP804
select HAVE_ARM_ARCH_TIMER if ARCH_MULTI_V7
select CLKSRC_OF
select BCM2835_TIMER
select PINCTRL
select PINCTRL_BCM2835
help
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-integrator/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if ARCH_INTEGRATOR

config ARCH_INTEGRATOR_AP
bool "Support Integrator/AP and Integrator/PP2 platforms"
select CLKSRC_MMIO
select INTEGRATOR_AP_TIMER
select MIGHT_HAVE_PCI
select SERIAL_AMBA_PL010 if TTY
select SERIAL_AMBA_PL010_CONSOLE if TTY
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-keystone/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ config ARCH_KEYSTONE
depends on ARM_PATCH_PHYS_VIRT
select ARM_GIC
select HAVE_ARM_ARCH_TIMER
select CLKSRC_MMIO
select KEYSTONE_TIMER
select ARM_ERRATA_798181 if SMP
select COMMON_CLK_KEYSTONE
select ARCH_SUPPORTS_BIG_ENDIAN
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-moxart/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ menuconfig ARCH_MOXART
depends on ARCH_MULTI_V4
select CPU_FA526
select ARM_DMA_MEM_BUFFERABLE
select CLKSRC_MMIO
select MOXART_TIMER
select GENERIC_IRQ_CHIP
select ARCH_REQUIRE_GPIOLIB
select PHYLIB if NETDEVICES
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-mxs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ config ARCH_MXS
bool "Freescale MXS (i.MX23, i.MX28) support"
depends on ARCH_MULTI_V5
select ARCH_REQUIRE_GPIOLIB
select CLKSRC_MMIO
select MXS_TIMER
select PINCTRL
select SOC_BUS
select SOC_IMX23
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-nspire/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ config ARCH_NSPIRE
select ARM_AMBA
select ARM_VIC
select ARM_TIMER_SP804
select NSPIRE_TIMER
help
This enables support for systems using the TI-NSPIRE CPU
2 changes: 2 additions & 0 deletions arch/arm/mach-prima2/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ config ARCH_ATLAS7
default y
select ARM_GIC
select CPU_V7
select ATLAS7_TIMER
select HAVE_ARM_SCU if SMP
select HAVE_SMP
help
Expand All @@ -38,6 +39,7 @@ config ARCH_PRIMA2
default y
select SIRF_IRQ
select ZONE_DMA
select PRIMA2_TIMER
help
Support for CSR SiRFSoC ARM Cortex A9 Platform

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-u300/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ menuconfig ARCH_U300
select ARCH_REQUIRE_GPIOLIB
select ARM_AMBA
select ARM_VIC
select CLKSRC_MMIO
select U300_TIMER
select CPU_ARM926T
select HAVE_TCM
select PINCTRL
Expand Down
8 changes: 8 additions & 0 deletions arch/arm64/boot/dts/rockchip/rk3399.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,14 @@
interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>;
};

rktimer: rktimer@ff850000 {
compatible = "rockchip,rk3399-timer";
reg = <0x0 0xff850000 0x0 0x1000>;
interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&cru PCLK_TIMER0>, <&cru SCLK_TIMER00>;
clock-names = "pclk", "timer";
};

spdif: spdif@ff870000 {
compatible = "rockchip,rk3399-spdif";
reg = <0x0 0xff870000 0x0 0x1000>;
Expand Down
Loading

0 comments on commit 55392c4

Please sign in to comment.