aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clocksource/vt8500_timer.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-01-12Merge branches 'clockevents/4.4-fixes' and 'clockevents/4.5-fixes' of http://git.linaro.org/people/daniel.lezcano/linux into timers/urgentThomas Gleixner1-2/+4
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-11clocksource/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>
2015-12-15clocksource/drivers/vt8500: Remove unneeded headerDaniel Lezcano1-1/+0
Remove the <asm/time.h> header inclusion which is pointless. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-08-10clockevents/drivers/vt8500: Migrate to new 'set-state' interfaceViresh Kumar1-19/+10
Migrate vt8500 driver to the new 'set-state' interface provided by clockevents core, the earlier 'set-mode' interface is marked obsolete now. This also enables us to implement callbacks for new states of clockevent devices, for example: ONESHOT_STOPPED. Cc: Tony Prisk <linux@prisktech.co.nz> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2013-12-11clocksource: vt8500: Remove deprecated IRQF_DISABLEDMichael Opdenacker1-1/+1
This patch removes the use of the IRQF_DISABLED flag. It's a NOOP since 2.6.35 and it will be removed one day. [dlezcano] : slightly changed the changelog Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2013-10-02clocksource: Put nodes passed to CLOCKSOURCE_OF_DECLARE callbacks centrallyUwe Kleine-König1-2/+0
Instead of letting each driver call of_node_put do it centrally in the loop that also calls the CLOCKSOURCE_OF_DECLARE callbacks. This is less prone to error and also moves getting and putting the references into the same function. Consequently all respective of_node_put calls in drivers are removed. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Acked-by: David Brown <davidb@codeaurora.org>
2013-03-28clocksource: make CLOCKSOURCE_OF_DECLARE type safeArnd Bergmann1-1/+1
This ensures that a function pointer passed into CLOCKSOURCE_OF_DECLARE takes the same arguments that we use for calling that function later. Also fix the extraneous semicolon at end of the CLOCKSOURCE_OF_DECLARE definition. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Rob Herring <rob.herring@calxeda.com>
2013-03-11clocksource: pass DT node pointer to init functionsRob Herring1-13/+1
In cases where we have multiple nodes of the same type, we may need the node pointer to know which node was matched. Passing the node pointer also keeps the init function from having to match the node a 2nd time. Update bcm2835, vt8500, and tegra20 init functions for the new function prototype. Further tegra20 clean-ups are in follow-up commit. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Cc: John Stultz <johnstul@us.ibm.com> Cc: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Stephen Warren <swarren@nvidia.com> Tested-by: Stephen Warren <swarren@nvidia.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Tony Prisk <linux@prisktech.co.nz> Tested-by: Michal Simek <michal.simek@xilinx.com>
2013-01-15Merge branch 'vt8500/timer' into next/cleanupOlof Johansson1-1/+2
* vt8500/timer: timer: vt8500: Convert vt8500 to use CLKSRC_OF Signed-off-by: Olof Johansson <olof@lixom.net>
2013-01-15timer: vt8500: Convert vt8500 to use CLKSRC_OFTony Prisk1-1/+2
This patch converts arch-vt8500 to make use of CLKSRC_OF. Doing so removes the need for include/linux/vt8500_timer.h as vt8500_timer_init no longer needs to be visible outside vt8500_timer.c Signed-off-by: Tony Prisk <linux@prisktech.co.nz> Reviewed-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Olof Johansson <olof@lixom.net>
2013-01-14Merge tag 'vt8500/timer' of git://server.prisktech.co.nz/git/linuxwmt into next/cleanupOlof Johansson1-0/+179
From Tony Prisk: Move arch-vt8500/timer.c to drivers/clocksource/vt8500-timer.c * tag 'vt8500/timer' of git://server.prisktech.co.nz/git/linuxwmt: timer: vt8500: Move timer code to drivers/clocksource Signed-off-by: Olof Johansson <olof@lixom.net>
2013-01-14timer: vt8500: Move timer code to drivers/clocksourceTony Prisk1-0/+184
This patch moves arch-vt8500/timer.c into drivers/clocksource and updates the necessary Kconfig/Makefile options. Signed-off-by: Tony Prisk <linux@prisktech.co.nz>