summaryrefslogtreecommitdiff
path: root/drivers/clocksource
AgeCommit message (Collapse)AuthorFilesLines
2016-01-21Merge tag 'armsoc-cleanup' of ↵Linus Torvalds1-3/+6
git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM SoC cleanups from Olof Johansson: "A smallish number of general cleanup commits this release cycle. Some of these are minor tweaks: - shmobile change of binding for their GIC (using arm,pl390 now) - ARCH_RENESAS introduction - Misc other renesas updates There's also a couple of treewide commits from Masahiro Yamada cleaning up const/__initconst for SMP operation structs and a switch to using "depends on" instead of if-constructs on most of the Kconfig platform targets" * tag 'armsoc-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: staging: board: armadillo800eva: Use "arm,pl390" staging: board: kzm9d: Use "arm,pl390" ARM: shmobile: r8a7778 dtsi: Use "arm,pl390" for GIC ARM: shmobile: emev2 dtsi: Use "arm,pl390" for GIC ARM: shmobile: r8a7740 dtsi: Use "arm,pl390" for GIC ARM: shmobile: r7s72100 dtsi: Use "arm,pl390" for GIC ARM: use "depends on" for SoC configs instead of "if" after prompt ARM/clocksource: use automatic DT probing for ux500 PRCMU ARM: use const and __initconst for smp_operations ARM: hisi: do not export smp_operations structures ARM: mvebu: remove unused mach/gpio.h ARM: shmobile: Remove legacy mach/irqs.h ARM: shmobile: Introduce ARCH_RENESAS MAINTAINERS: Remove link to oss.renesas.com which is closed
2016-01-12Merge branches 'clockevents/4.4-fixes' and 'clockevents/4.5-fixes' of ↵Thomas Gleixner2-3/+5
http://git.linaro.org/people/daniel.lezcano/linux into timers/urgent Pull in fixes from Daniel Lezcano: - Fix the vt8500 timer leading to a system lock up when dealing with too small delta (Roman Volkov) - Select the CLKSRC_MMIO when the fsl_ftm_timer is enabled with COMPILE_TEST (Daniel Lezcano) - Prevent to compile timers using the 'iomem' API when the architecture has not HAS_IOMEM set (Richard Weinberger)
2016-01-12clocksource/drivers/vt8500: Increase the minimum deltaRoman Volkov1-2/+4
The vt8500 clocksource driver declares itself as capable to handle the minimum delay of 4 cycles by passing the value into clockevents_config_and_register(). The vt8500_timer_set_next_event() requires the passed cycles value to be at least 16. The impact is that userspace hangs in nanosleep() calls with small delay intervals. This problem is reproducible in Linux 4.2 starting from: c6eb3f70d448 ('hrtimer: Get rid of hrtimer softirq') From Russell King, more detailed explanation: "It's a speciality of the StrongARM/PXA hardware. It takes a certain number of OSCR cycles for the value written to hit the compare registers. So, if a very small delta is written (eg, the compare register is written with a value of OSCR + 1), the OSCR will have incremented past this value before it hits the underlying hardware. The result is, that you end up waiting a very long time for the OSCR to wrap before the event fires. So, we introduce a check in set_next_event() to detect this and return -ETIME if the calculated delta is too small, which causes the generic clockevents code to retry after adding the min_delta specified in clockevents_config_and_register() to the current time value. min_delta must be sufficient that we don't re-trip the -ETIME check - if we do, we will return -ETIME, forward the next event time, try to set it, return -ETIME again, and basically lock the system up. So, min_delta must be larger than the check inside set_next_event(). A factor of two was chosen to ensure that this situation would never occur. The PXA code worked on PXA systems for years, and I'd suggest no one changes this mechanism without access to a wide range of PXA systems, otherwise they're risking breakage." Cc: stable@vger.kernel.org Cc: Russell King <linux@arm.linux.org.uk> Acked-by: Alexey Charkov <alchark@gmail.com> Signed-off-by: Roman Volkov <rvolkov@v1ros.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2016-01-11clocksource/drivers/fsl_ftm_timer: Fix CLKSRC_MMIO dependencyDaniel Lezcano1-0/+1
Select CLKSRC_MMIO when FSL_FTM_TIMER is enabled. Otherwise it fails to compile on i386 with COMPILE_TEST=y. " on i386: when CLKSRC_MMIO is not enabled: drivers/built-in.o: In function `ftm_timer_init': fsl_ftm_timer.c:(.init.text+0x6842): undefined reference to `clocksource_mmio_readl_up' fsl_ftm_timer.c:(.init.text+0x6855): undefined reference to `clocksource_mmio_init' " Reported-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2016-01-11clocksource/drivers: Fix dependencies for !HAS_IOMEM archsRichard Weinberger1-5/+7
Not every arch has io memory. So, unbreak the build by fixing the dependencies. Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-29clocksource/drivers/acpi_pm: Convert to pr_* macrosAndy Shevchenko1-17/+10
Like it's already done in one place in the driver, convert the rest to use pr_* macros instead of printk(KERN_LEVEL) calls. While here, join strings to be one string for one line to make grep on them easier. There is no functional change. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Link: http://lkml.kernel.org/r/1451310085-113182-1-git-send-email-andriy.shevchenko@linux.intel.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2015-12-16clocksource/drivers/h8300: Use ioread / iowriteYoshinori Sato3-43/+50
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-16clocksource/drivers/h8300: Initializer cleanup.Yoshinori Sato1-9/+6
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-16clocksource/drivers/h8300: Simplify delta handlingYoshinori Sato1-34/+6
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-16clocksource/drivers/h8300: Fix timer not overflow caseYoshinori Sato1-2/+4
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-16clocksource/drivers/h8300: Change to overflow interruptYoshinori Sato1-7/+7
Counter overflow detection use for overflow interrupt Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-16clocksource/drivers/lpc32: Correct pr_err() output formatVladimir Zapolskiy1-2/+2
If by some reason timerclk is not available, both clockevent and clocksource initializations correctly exit, but output of errno to kernel log buffer may be confusing: lpc32xx_clk_init: failed to map system control block registers lpc32xx_clocksource_init: clock get failed (4294966779) lpc32xx_clockevent_init: clock get failed (4294966779) Use signed integer output in the correspondent pr_err() string formats: lpc32xx_clocksource_init: clock get failed (-517) lpc32xx_clockevent_init: clock get failed (-517) Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-16clocksource/drivers/arm_global_timer: Fix suspend resumeGrygorii Strashko1-0/+11
Now the System stall is observed on TI AM437x based board (am437x-gp-evm) during resuming from System suspend when ARM Global timer is selected as clocksource device (CPUIdle not enabled) - SysRq are working, but nothing else. The reason of stall is that ARM Global timer loses its contexts during System suspend: GT_CONTROL.TIMER_ENABLE = 0 (unbanked) GT_COUNTERx = 0 Hence, update ARM Global timer driver to reflect above behaviour - re-enable ARM Global timer on resume (GT_CONTROL.TIMER_ENABLE = 1) if not enabled. CC: Arnd Bergmann <arnd@arndb.de> Cc: John Stultz <john.stultz@linaro.org> Cc: Felipe Balbi <balbi@ti.com> Cc: Tony Lindgren <tony@atomide.com> Cc: Marc Zyngier <marc.zyngier@arm.com> Reviewed-by: Santosh Shilimkar <ssantosh@kernel.org> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-16clocksource/drivers/pistachio: Fix wrong calculated clocksource read valueJisheng Zhang1-1/+1
Let's assume the counter value is 0xf0000000, the pistachio clocksource read cycles function should return ~0x0fffffff but actually it returns 0xffffffff0fffffff. That occurs because: ~(cycle_t)value is different from (cycle_t)~value. unsigned long val = ~(unsigned long)0xf0000000; 40049a: 48 b8 ff ff ff 0f ff movabs $0xffffffff0fffffff,%rax unsigned long val = (unsigned long)~0xf0000000; 40049a: 48 c7 45 f8 ff ff ff movq $0xfffffff,-0x8(%rbp) We fix this issue by calculating bitwise-not counter, then cast to cycle_t. Signed-off-by: Jisheng Zhang <jszhang@marvell.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-16clockevents/drivers/arm_global_timer: Use writel_relaxed in gt_compare_setJisheng Zhang1-5/+5
Use the relaxed version to improve performance. we measured time of 4096 rounds of gt_compare_set() spent on Marvell BG2Q: before the patch: 3690648ns on average after the patch: 1083023ns on average improved by 70%! Signed-off-by: Jisheng Zhang <jszhang@marvell.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/dw_apb_timer: Inline apbt_readl and apbt_writelJisheng Zhang1-3/+3
It seems gcc can automatically inline apbt_writel() for us, but apbt_real isn't inlined. This patch makes them inline to get a trivial performance improvement: 4096 rounds of __apbt_read_clocksource() call spend time on Marvell BG4CT platform: before the patch 1275240ns on average after the patch 1263240ns on average so we get 1% performance improvement. Signed-off-by: Jisheng Zhang <jszhang@marvell.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/dw_apb_timer: Use {readl|writel}_relaxed in critical pathJisheng Zhang1-6/+18
It's safe to use the relaxed version. From another side, the relaxed io accessor macros are available on all architectures now, so we can use the relaxed versions to get a trivial system performance improvement, we measured time the following functions spent on Marvell BG4CT: 4096 rounds of __apbt_read_clocksource() call: before the patch: 1263240ns on average after the patch: 1250080ns on average improved by 1% 4096 rounds of apbt_eoi() call: before the patch: 1290960ns on average after the patch: 1248240ns on average 4096 rounds of apbt_next_event() call: before the patch: 3333660ns on average after the patch: 1322040ns on average improved by 60%! Signed-off-by: Jisheng Zhang <jszhang@marvell.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/dw_apb_timer: Fix apbt_readl return typesJisheng Zhang1-10/+10
On Marvell BG4CT platform, we observed the __apbt_read_clocksource() return wrong value: Let's assume the APBTMR_N_CURRENT_VALUE value is 0xf0000000, we got 0xffffffff0fffffff, but it should be 0xfffffff. This issue should be common on all 64bit platforms. We fix the issue by letting aptb_readl() return u32. apbt_writel() is also updated to write u32 val rather than unsigned long. Signed-off-by: Jisheng Zhang <jszhang@marvell.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/tango-xtal: Replace code by clocksource_mmio_initDaniel Lezcano2-15/+4
The current code to initialize, register and read the clocksource is already factored out in mmio.c via the clocksource_mmio_init function. Factor out the code with the clocksource_mmio_init function. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/h8300: Increase the compilation test coverageDaniel Lezcano1-3/+14
Add the COMPILE_TEST option so the drivers can be compiled on different architecture with the 'allyesconfig' kernel configuration. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15h8300: Rename ctlr_out/in[bwl] to raw_read/write[bwl]Daniel Lezcano3-45/+45
For the sake of consistency, let rename all ctrl_out/in calls to the write/read calls so we have the same API consistent with the other architectures hence open the door for the increasing of the test compilation coverage. The unsigned long coercive cast is removed because all variables are set to the right type "void __iomem *". Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/h8300_timer8: Separate the Kconfig option from the archDaniel Lezcano2-1/+4
The current Kconfig option is the H8300 arch option. In order to comply to the current rule, let's create a specific option for the timer8 and select it from the arch's Kconfig. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/timer_sun5i: Replace code by clocksource_mmio_initDaniel Lezcano1-14/+2
The current code to initialize, register and read the clocksource is already factored out in mmio.c via the clocksource_mmio_init function. The only difference is the readl vs readl_relaxed. Factor out the code with the clocksource_mmio_init function. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2015-12-15clocksource/drivers/h8300_timer16: Remove pointless lockDaniel Lezcano1-5/+1
The lock in the timer16_clocksource_read is not needed, remove it. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/h8300_timer16: Fix irq return value checkDaniel Lezcano1-1/+1
The function irq_of_parse_and_map returns zero in case of failure. Fix the return code test to check against zero. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/h8300_timer16: Remove unused fields in timer16_privDaniel Lezcano1-2/+0
The fields are not used in the code, remove them. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/h8300_timer16: Remove unused macrosDaniel Lezcano1-18/+0
The macros are no longer used in the code, remove them. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/h8300_timer16: Remove pointless headersDaniel Lezcano1-10/+0
The headers are not needed, remove them. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/h8300_timer8: Retrieve the clock rate at init timeDaniel Lezcano1-12/+14
The current code retrieves the rate value when the timer is enabled which occurs each time a timer is re-armed. Except if the clock frequency has changed magically I don't see why this should be done each time. Retrieve the clock rate value at init time only. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/h8300_timer8: Remove irq and lock legacy codeDaniel Lezcano1-16/+0
The time framawork takes care of disabling the interrupts and takes a lock to prevent races. Remove the legacy code in the driver taking care of the races. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/h8300_timer8: Remove pointless irq re-entrant safe codeDaniel Lezcano1-9/+6
The current code assumes the interrupt function is re-entrant. That is not correct. An interrupt handler is never invoked concurrently. The interrupt line is masked on all processors. Remove the chewing flags in the code. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/h8300_timer8: Fix irq return value checkDaniel Lezcano1-1/+1
The value returned in case of error for the 'irq_of_parse_and_map' function is zero in case of error. Fix the check in the init code. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/h8300_timer8: Remove PERIODIC and ONESHOT macroDaniel Lezcano1-7/+4
Specify the delta as parameter for the timer8_clock_event_start function instead of using a macro to tell PERIODIC or ONESHOT. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/h8300_timer8: Remove unused macrosDaniel Lezcano1-4/+0
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/h8300_timer8: Remove unused headersDaniel Lezcano1-5/+0
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/h8300_tpu: Remove pointless headers for TPUDaniel Lezcano1-5/+0
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/h8300_tpu: Remove unused macrosDaniel Lezcano1-10/+3
Some macros are unused, delete them. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/h8300_timer8: Fix compilation error with dev_warnDaniel Lezcano1-1/+1
The dev_warn is using the platform driver which was removed in the previous patch. Let's replace dev_warn by pr_warn. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/h8300: Cleanup startup and remove module code.Yoshinori Sato3-264/+144
Remove some legacy code and replace it by the clksrc-of code. Do some cleanup and code consolidation. Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/dw_apb_timer_of: Implement ARM delay timerJisheng Zhang1-0/+16
Implement an ARM delay timer to be used for udelay(). This allows us to skip the delay loop calibration at boot on Marvell BG2, BG2Q, BG2CD platforms. And after this patch, udelay() will be unaffected by CPU frequency changes. Note: Although in case there are several possible delay timers, we may not select the "best" delay timer. Take one Marvell Berlin platform for example: we have arch timer and dw-apb timer. The arch timer freq is 25MHZ while the dw-apb timer freq is 100MHZ, current selection would choose the dw-apb timer. But the dw apb timer is on the APB bus while arch timer sits in CPU, the cost of accessing the apb timer is higher than the arch timer. We could introduce "rating" concept to delay timer, but this approach "brings a lot of complexity and workarounds in the code for a small benefit" as pointed out by Daniel. Later, Arnd pointed out "However, we could argue that this actually doesn't matter at all, because the entire point of the ndelay()/ udelay()/mdelay() functions is to waste CPU cycles doing not much at all, so we can just as well waste them reading the timer register than spinning on the CPU reading the arch timer more often.", so we just simply register the dw apb base delay timer. Signed-off-by: Jisheng Zhang <jszhang@marvell.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/Kconfig: Add missing GENERIC_CLOCKEVENTS dependencyDaniel Lezcano1-0/+11
In order to compile on all arch without error with 'allyesconfig' make sure the platform selected the GENERIC_CLOCKEVENTS. Without this patch the new added drivers will prevent the kernel to compile on PARISC. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/fsl-ftm: Add the COMPILE_TEST optionDaniel Lezcano1-1/+1
Increase the compilation test coverage by adding the COMPILE_TEST option. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/samsung-pwm: Add the COMPILE_TEST optionDaniel Lezcano1-1/+1
Increase the compilation test coverage by adding the COMPILE_TEST option. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/exynos_mct: Fix Kconfig and add COMPILE_TEST optionDaniel Lezcano1-2/+2
Let the platform's Kconfig to select the clock instead of having a reverse dependency from the driver to the platform options. Add the COMPILE_TEST option for the compilation test coverage. Due to the non portable 'delay' code, this driver is only compilable on ARM. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
2015-12-15clocksource/drivers/prcmu: Fix Kconfig and add COMPILE_TEST optionDaniel Lezcano1-3/+1
Let the platform's Kconfig to select the clock instead of having a reverse dependency from the driver to the platform options. Add the COMPILE_TEST option for the compilation test coverage. This change is debatable as the option itself in the Kconfig allows to select the driver for the platform or not. This change will make the prcmu timer always selected. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org>
2015-12-15clocksource/drivers/nomadik_mtu: Add the COMPILE_TEST optionDaniel Lezcano1-2/+2
Increase the compilation test coverage by adding the COMPILE_TEST option. Due to the non portable code for the delay timer, this option is only available for the ARM architecture. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/lpc32xx: Add the COMPILE_TEST optionDaniel Lezcano1-1/+3
Increase the compilation test coverage by adding the COMPILE_TEST option. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/asm9260: Add the COMPILE_TEST optionDaniel Lezcano1-1/+3
Increase the compilation test coverage by adding the COMPILE_TEST option. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/cadence_ttc: Add the COMPILE_TEST optionDaniel Lezcano1-1/+4
Increase the compilation test coverage by adding the COMPILE_TEST option. The driver depends on the common clock framework, thus the dependency added on COMMON_CLK. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15clocksource/drivers/vt8500: Add the COMPILE_TEST optionDaniel Lezcano1-1/+3
Increase the compilation test coverage by adding the COMPILE_TEST option. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>