Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dcd1bfd5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

Pull timer fixes from Ingo Molnar:
 "Three clocksource driver fixes"

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  clocksource/drivers/vt8500: Increase the minimum delta
  clocksource/drivers/fsl_ftm_timer: Fix CLKSRC_MMIO dependency
  clocksource/drivers: Fix dependencies for !HAS_IOMEM archs
parents 747a9b0a 1f16f116
Loading
Loading
Loading
Loading
+8 −5
Original line number Original line Diff line number Diff line
@@ -152,7 +152,7 @@ config CLKSRC_EFM32


config CLKSRC_LPC32XX
config CLKSRC_LPC32XX
	bool "Clocksource for LPC32XX" if COMPILE_TEST
	bool "Clocksource for LPC32XX" if COMPILE_TEST
	depends on GENERIC_CLOCKEVENTS
	depends on GENERIC_CLOCKEVENTS && HAS_IOMEM
	select CLKSRC_MMIO
	select CLKSRC_MMIO
	select CLKSRC_OF
	select CLKSRC_OF
	help
	help
@@ -160,6 +160,7 @@ config CLKSRC_LPC32XX


config CLKSRC_PISTACHIO
config CLKSRC_PISTACHIO
	bool "Clocksource for Pistachio SoC" if COMPILE_TEST
	bool "Clocksource for Pistachio SoC" if COMPILE_TEST
	depends on HAS_IOMEM
	select CLKSRC_OF
	select CLKSRC_OF
	help
	help
	  Enables the clocksource for the Pistachio SoC.
	  Enables the clocksource for the Pistachio SoC.
@@ -256,6 +257,7 @@ config CLKSRC_SAMSUNG_PWM
config FSL_FTM_TIMER
config FSL_FTM_TIMER
	bool "Freescale FlexTimer Module driver" if COMPILE_TEST
	bool "Freescale FlexTimer Module driver" if COMPILE_TEST
	depends on GENERIC_CLOCKEVENTS
	depends on GENERIC_CLOCKEVENTS
	select CLKSRC_MMIO
	help
	help
	  Support for Freescale FlexTimer Module (FTM) timer.
	  Support for Freescale FlexTimer Module (FTM) timer.


@@ -269,7 +271,7 @@ config SYS_SUPPORTS_SH_CMT


config MTK_TIMER
config MTK_TIMER
	bool "Mediatek timer driver" if COMPILE_TEST
	bool "Mediatek timer driver" if COMPILE_TEST
	depends on GENERIC_CLOCKEVENTS
	depends on GENERIC_CLOCKEVENTS && HAS_IOMEM
	select CLKSRC_OF
	select CLKSRC_OF
	select CLKSRC_MMIO
	select CLKSRC_MMIO
	help
	help
@@ -365,20 +367,20 @@ config CLKSRC_PXA


config H8300_TMR8
config H8300_TMR8
        bool "Clockevent timer for the H8300 platform" if COMPILE_TEST
        bool "Clockevent timer for the H8300 platform" if COMPILE_TEST
        depends on GENERIC_CLOCKEVENTS
        depends on GENERIC_CLOCKEVENTS && HAS_IOMEM
	help
	help
	  This enables the 8 bits timer for the H8300 platform.
	  This enables the 8 bits timer for the H8300 platform.


config H8300_TMR16
config H8300_TMR16
        bool "Clockevent timer for the H83069 platform" if COMPILE_TEST
        bool "Clockevent timer for the H83069 platform" if COMPILE_TEST
        depends on GENERIC_CLOCKEVENTS
        depends on GENERIC_CLOCKEVENTS && HAS_IOMEM
	help
	help
	  This enables the 16 bits timer for the H8300 platform with the
	  This enables the 16 bits timer for the H8300 platform with the
	  H83069 cpu.
	  H83069 cpu.


config H8300_TPU
config H8300_TPU
        bool "Clocksource for the H8300 platform" if COMPILE_TEST
        bool "Clocksource for the H8300 platform" if COMPILE_TEST
        depends on GENERIC_CLOCKEVENTS
        depends on GENERIC_CLOCKEVENTS && HAS_IOMEM
	help
	help
	  This enables the clocksource for the H8300 platform with the
	  This enables the clocksource for the H8300 platform with the
	  H8S2678 cpu.
	  H8S2678 cpu.
@@ -391,6 +393,7 @@ config CLKSRC_IMX_GPT
config CLKSRC_ST_LPC
config CLKSRC_ST_LPC
	bool "Low power clocksource found in the LPC" if COMPILE_TEST
	bool "Low power clocksource found in the LPC" if COMPILE_TEST
	select CLKSRC_OF if OF
	select CLKSRC_OF if OF
	depends on HAS_IOMEM
	help
	help
	  Enable this option to use the Low Power controller timer
	  Enable this option to use the Low Power controller timer
	  as clocksource.
	  as clocksource.
+4 −2
Original line number Original line Diff line number Diff line
@@ -49,6 +49,8 @@


#define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * t)
#define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * t)


#define MIN_OSCR_DELTA		16

static void __iomem *regbase;
static void __iomem *regbase;


static cycle_t vt8500_timer_read(struct clocksource *cs)
static cycle_t vt8500_timer_read(struct clocksource *cs)
@@ -79,7 +81,7 @@ static int vt8500_timer_set_next_event(unsigned long cycles,
		cpu_relax();
		cpu_relax();
	writel((unsigned long)alarm, regbase + TIMER_MATCH_VAL);
	writel((unsigned long)alarm, regbase + TIMER_MATCH_VAL);


	if ((signed)(alarm - clocksource.read(&clocksource)) <= 16)
	if ((signed)(alarm - clocksource.read(&clocksource)) <= MIN_OSCR_DELTA)
		return -ETIME;
		return -ETIME;


	writel(1, regbase + TIMER_IER_VAL);
	writel(1, regbase + TIMER_IER_VAL);
@@ -150,7 +152,7 @@ static void __init vt8500_timer_init(struct device_node *np)
		pr_err("%s: setup_irq failed for %s\n", __func__,
		pr_err("%s: setup_irq failed for %s\n", __func__,
							clockevent.name);
							clockevent.name);
	clockevents_config_and_register(&clockevent, VT8500_TIMER_HZ,
	clockevents_config_and_register(&clockevent, VT8500_TIMER_HZ,
					4, 0xf0000000);
					MIN_OSCR_DELTA * 2, 0xf0000000);
}
}


CLOCKSOURCE_OF_DECLARE(vt8500, "via,vt8500-timer", vt8500_timer_init);
CLOCKSOURCE_OF_DECLARE(vt8500, "via,vt8500-timer", vt8500_timer_init);