<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/clocksource, branch linux-4.5.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>clocksource/drivers/tango-xtal: Fix boot hang due to incorrect test</title>
<updated>2016-05-11T09:21:22+00:00</updated>
<author>
<name>Daniel Lezcano</name>
<email>daniel.lezcano@linaro.org</email>
</author>
<published>2016-04-19T13:43:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=42ff5fc8661040f37a67a4a95c231f6765d6f59c'/>
<id>42ff5fc8661040f37a67a4a95c231f6765d6f59c</id>
<content type='text'>
commit 16eeed7e5558a3dcf30f75526a896b2632f299f9 upstream.

Commit 0881841f7e78 introduced a regression by inverting a test check
after calling clocksource_mmio_init(). That results on the system to
hang at boot time.

Fix it by inverting the test again.

Fixes: 0881841f7e78 ("Replace code by clocksource_mmio_init")
Reported-by: Marc Gonzalez &lt;marc_gonzalez@sigmadesigns.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 16eeed7e5558a3dcf30f75526a896b2632f299f9 upstream.

Commit 0881841f7e78 introduced a regression by inverting a test check
after calling clocksource_mmio_init(). That results on the system to
hang at boot time.

Fix it by inverting the test again.

Fixes: 0881841f7e78 ("Replace code by clocksource_mmio_init")
Reported-by: Marc Gonzalez &lt;marc_gonzalez@sigmadesigns.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2016-01-31T23:49:06+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-01-31T23:49:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=dc799d0179baa7f62d2e73a8217a273ca82adbdf'/>
<id>dc799d0179baa7f62d2e73a8217a273ca82adbdf</id>
<content type='text'>
Pull timer fixes from Thomas Gleixner:
 "The timer departement delivers:

   - a regression fix for the NTP code along with a proper selftest
   - prevent a spurious timer interrupt in the NOHZ lowres code
   - a fix for user space interfaces returning the remaining time on
     architectures with CONFIG_TIME_LOW_RES=y
   - a few patches to fix COMPILE_TEST fallout"

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  tick/nohz: Set the correct expiry when switching to nohz/lowres mode
  clocksource: Fix dependencies for archs w/o HAS_IOMEM
  clocksource: Select CLKSRC_MMIO where needed
  tick/sched: Hide unused oneshot timer code
  kselftests: timers: Add adjtimex SETOFFSET validity tests
  ntp: Fix ADJ_SETOFFSET being used w/ ADJ_NANO
  itimers: Handle relative timers with CONFIG_TIME_LOW_RES proper
  posix-timers: Handle relative timers with CONFIG_TIME_LOW_RES proper
  timerfd: Handle relative timers with CONFIG_TIME_LOW_RES proper
  hrtimer: Handle remaining time proper for TIME_LOW_RES
  clockevents/tcb_clksrc: Prevent disabling an already disabled clock
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull timer fixes from Thomas Gleixner:
 "The timer departement delivers:

   - a regression fix for the NTP code along with a proper selftest
   - prevent a spurious timer interrupt in the NOHZ lowres code
   - a fix for user space interfaces returning the remaining time on
     architectures with CONFIG_TIME_LOW_RES=y
   - a few patches to fix COMPILE_TEST fallout"

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  tick/nohz: Set the correct expiry when switching to nohz/lowres mode
  clocksource: Fix dependencies for archs w/o HAS_IOMEM
  clocksource: Select CLKSRC_MMIO where needed
  tick/sched: Hide unused oneshot timer code
  kselftests: timers: Add adjtimex SETOFFSET validity tests
  ntp: Fix ADJ_SETOFFSET being used w/ ADJ_NANO
  itimers: Handle relative timers with CONFIG_TIME_LOW_RES proper
  posix-timers: Handle relative timers with CONFIG_TIME_LOW_RES proper
  timerfd: Handle relative timers with CONFIG_TIME_LOW_RES proper
  hrtimer: Handle remaining time proper for TIME_LOW_RES
  clockevents/tcb_clksrc: Prevent disabling an already disabled clock
</pre>
</div>
</content>
</entry>
<entry>
<title>clocksource: Fix dependencies for archs w/o HAS_IOMEM</title>
<updated>2016-01-26T15:26:07+00:00</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2016-01-25T22:24:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d7023e62c5128bf9f150d792a3ea8c758cb431a3'/>
<id>d7023e62c5128bf9f150d792a3ea8c758cb431a3</id>
<content type='text'>
Not every arch has io memory.
So, unbreak the build by fixing the dependencies.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Cc: user-mode-linux-devel@lists.sourceforge.net
Cc: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: http://lkml.kernel.org/r/1453760661-1444-21-git-send-email-richard@nod.at
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Not every arch has io memory.
So, unbreak the build by fixing the dependencies.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Cc: user-mode-linux-devel@lists.sourceforge.net
Cc: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: http://lkml.kernel.org/r/1453760661-1444-21-git-send-email-richard@nod.at
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>clocksource: Select CLKSRC_MMIO where needed</title>
<updated>2016-01-26T15:26:07+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2016-01-25T16:02:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2be6d9bfef53d185975b44fd808aece36595e83e'/>
<id>2be6d9bfef53d185975b44fd808aece36595e83e</id>
<content type='text'>
The Tegra clocksource implementation uses the clocksource_mmio helper
functions, but currently can be configured without them, which fails:

drivers/clocksource/built-in.o: In function `tegra20_init_timer':
:(.init.text+0xac): undefined reference to `clocksource_mmio_init'
:(.init.text+0x140): undefined reference to `clocksource_mmio_readl_up'

The same problem exists for Digicolor:

drivers/clocksource/built-in.o: In function `digicolor_timer_init':
:(.init.text+0xfa): undefined reference to `clocksource_mmio_init'
:(.init.text+0x14c): undefined reference to `clocksource_mmio_readl_down'

I've inspected the Kconfig file to look for other cases that I have not
yet run into, and added an explicit 'select' to each one to ensure we
can successfully link the drivers.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: linux-arm-kernel@lists.infradead.org
Cc: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: http://lkml.kernel.org/r/1453737776-1960372-1-git-send-email-arnd@arndb.de
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The Tegra clocksource implementation uses the clocksource_mmio helper
functions, but currently can be configured without them, which fails:

drivers/clocksource/built-in.o: In function `tegra20_init_timer':
:(.init.text+0xac): undefined reference to `clocksource_mmio_init'
:(.init.text+0x140): undefined reference to `clocksource_mmio_readl_up'

The same problem exists for Digicolor:

drivers/clocksource/built-in.o: In function `digicolor_timer_init':
:(.init.text+0xfa): undefined reference to `clocksource_mmio_init'
:(.init.text+0x14c): undefined reference to `clocksource_mmio_readl_down'

I've inspected the Kconfig file to look for other cases that I have not
yet run into, and added an explicit 'select' to each one to ensure we
can successfully link the drivers.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: linux-arm-kernel@lists.infradead.org
Cc: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Link: http://lkml.kernel.org/r/1453737776-1960372-1-git-send-email-arnd@arndb.de
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'armsoc-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc</title>
<updated>2016-01-21T01:55:20+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-01-21T01:55:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=5083c54264d21bf9b8a4766068f51581854d772c'/>
<id>5083c54264d21bf9b8a4766068f51581854d772c</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>clockevents/tcb_clksrc: Prevent disabling an already disabled clock</title>
<updated>2016-01-15T10:40:44+00:00</updated>
<author>
<name>Alexandre Belloni</name>
<email>alexandre.belloni@free-electrons.com</email>
</author>
<published>2016-01-15T10:34:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f02b4b72d12cbae7020a959e2ed0410a464b4cc4'/>
<id>f02b4b72d12cbae7020a959e2ed0410a464b4cc4</id>
<content type='text'>
clockevents_exchange_device is calling clockevents_shutdown() on the new
clockenvents device but it may have never been enabled in the first place.
This results in the tcb clock being disabled without being enabled first:

------------[ cut here ]------------
WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:680 clk_disable+0x28/0x34()
Modules linked in:
CPU: 0 PID: 1 Comm: swapper Not tainted 4.4.0+ #6
Hardware name: Atmel AT91SAM9
[&lt;c000f2b8&gt;] (unwind_backtrace) from [&lt;c000d01c&gt;] (show_stack+0x10/0x14)
[&lt;c000d01c&gt;] (show_stack) from [&lt;c00172f0&gt;] (warn_slowpath_common+0x78/0xa0)
[&lt;c00172f0&gt;] (warn_slowpath_common) from [&lt;c00173a8&gt;] (warn_slowpath_null+0x18/0x20)
[&lt;c00173a8&gt;] (warn_slowpath_null) from [&lt;c0361528&gt;] (clk_disable+0x28/0x34)
[&lt;c0361528&gt;] (clk_disable) from [&lt;c034d560&gt;] (tc_shutdown+0x38/0x4c)
[&lt;c034d560&gt;] (tc_shutdown) from [&lt;c0059ad4&gt;] (clockevents_switch_state+0x38/0x6c)
[&lt;c0059ad4&gt;] (clockevents_switch_state) from [&lt;c0059b18&gt;] (clockevents_shutdown+0x10/0x24)
[&lt;c0059b18&gt;] (clockevents_shutdown) from [&lt;c005a458&gt;] (tick_check_new_device+0x84/0xac)
[&lt;c005a458&gt;] (tick_check_new_device) from [&lt;c0059660&gt;] (clockevents_register_device+0x7c/0x108)
[&lt;c0059660&gt;] (clockevents_register_device) from [&lt;c06b5a68&gt;] (tcb_clksrc_init+0x390/0x3e8)
[&lt;c06b5a68&gt;] (tcb_clksrc_init) from [&lt;c00097cc&gt;] (do_one_initcall+0x114/0x1d4)
[&lt;c00097cc&gt;] (do_one_initcall) from [&lt;c069bd54&gt;] (kernel_init_freeable+0xfc/0x1b8)
[&lt;c069bd54&gt;] (kernel_init_freeable) from [&lt;c04c3818&gt;] (kernel_init+0x8/0xe0)
[&lt;c04c3818&gt;] (kernel_init) from [&lt;c000a410&gt;] (ret_from_fork+0x14/0x24)
---[ end trace 0000000000000001 ]---

Check what state we were in before trying to disable the clock.

Fixes: cf4541c101ea ("clockevents/drivers/tcb_clksrc: Migrate to new 'set-state' interface")
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Cc: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
Cc: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Cc: linux-arm-kernel@lists.infradead.org
Cc: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/1452854061-30370-1-git-send-email-alexandre.belloni@free-electrons.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
clockevents_exchange_device is calling clockevents_shutdown() on the new
clockenvents device but it may have never been enabled in the first place.
This results in the tcb clock being disabled without being enabled first:

------------[ cut here ]------------
WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:680 clk_disable+0x28/0x34()
Modules linked in:
CPU: 0 PID: 1 Comm: swapper Not tainted 4.4.0+ #6
Hardware name: Atmel AT91SAM9
[&lt;c000f2b8&gt;] (unwind_backtrace) from [&lt;c000d01c&gt;] (show_stack+0x10/0x14)
[&lt;c000d01c&gt;] (show_stack) from [&lt;c00172f0&gt;] (warn_slowpath_common+0x78/0xa0)
[&lt;c00172f0&gt;] (warn_slowpath_common) from [&lt;c00173a8&gt;] (warn_slowpath_null+0x18/0x20)
[&lt;c00173a8&gt;] (warn_slowpath_null) from [&lt;c0361528&gt;] (clk_disable+0x28/0x34)
[&lt;c0361528&gt;] (clk_disable) from [&lt;c034d560&gt;] (tc_shutdown+0x38/0x4c)
[&lt;c034d560&gt;] (tc_shutdown) from [&lt;c0059ad4&gt;] (clockevents_switch_state+0x38/0x6c)
[&lt;c0059ad4&gt;] (clockevents_switch_state) from [&lt;c0059b18&gt;] (clockevents_shutdown+0x10/0x24)
[&lt;c0059b18&gt;] (clockevents_shutdown) from [&lt;c005a458&gt;] (tick_check_new_device+0x84/0xac)
[&lt;c005a458&gt;] (tick_check_new_device) from [&lt;c0059660&gt;] (clockevents_register_device+0x7c/0x108)
[&lt;c0059660&gt;] (clockevents_register_device) from [&lt;c06b5a68&gt;] (tcb_clksrc_init+0x390/0x3e8)
[&lt;c06b5a68&gt;] (tcb_clksrc_init) from [&lt;c00097cc&gt;] (do_one_initcall+0x114/0x1d4)
[&lt;c00097cc&gt;] (do_one_initcall) from [&lt;c069bd54&gt;] (kernel_init_freeable+0xfc/0x1b8)
[&lt;c069bd54&gt;] (kernel_init_freeable) from [&lt;c04c3818&gt;] (kernel_init+0x8/0xe0)
[&lt;c04c3818&gt;] (kernel_init) from [&lt;c000a410&gt;] (ret_from_fork+0x14/0x24)
---[ end trace 0000000000000001 ]---

Check what state we were in before trying to disable the clock.

Fixes: cf4541c101ea ("clockevents/drivers/tcb_clksrc: Migrate to new 'set-state' interface")
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Cc: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
Cc: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Cc: linux-arm-kernel@lists.infradead.org
Cc: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/1452854061-30370-1-git-send-email-alexandre.belloni@free-electrons.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branches 'clockevents/4.4-fixes' and 'clockevents/4.5-fixes' of http://git.linaro.org/people/daniel.lezcano/linux into timers/urgent</title>
<updated>2016-01-12T10:01:12+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2016-01-12T10:01:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=1f16f116b01c110db20ab808562c8b8bc3ee3d6e'/>
<id>1f16f116b01c110db20ab808562c8b8bc3ee3d6e</id>
<content type='text'>
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)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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)
</pre>
</div>
</content>
</entry>
<entry>
<title>clocksource/drivers/vt8500: Increase the minimum delta</title>
<updated>2016-01-11T21:49:07+00:00</updated>
<author>
<name>Roman Volkov</name>
<email>rvolkov@v1ros.org</email>
</author>
<published>2016-01-01T13:24:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f9eccf24615672896dc13251410c3f2f33a14f95'/>
<id>f9eccf24615672896dc13251410c3f2f33a14f95</id>
<content type='text'>
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 &lt;linux@arm.linux.org.uk&gt;
Acked-by: Alexey Charkov &lt;alchark@gmail.com&gt;
Signed-off-by: Roman Volkov &lt;rvolkov@v1ros.org&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;linux@arm.linux.org.uk&gt;
Acked-by: Alexey Charkov &lt;alchark@gmail.com&gt;
Signed-off-by: Roman Volkov &lt;rvolkov@v1ros.org&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>clocksource/drivers/fsl_ftm_timer: Fix CLKSRC_MMIO dependency</title>
<updated>2016-01-11T17:45:26+00:00</updated>
<author>
<name>Daniel Lezcano</name>
<email>daniel.lezcano@linaro.org</email>
</author>
<published>2016-01-08T13:21:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=03724ac3d48f8f0e3caf1d30fa134f8fd96c94e2'/>
<id>03724ac3d48f8f0e3caf1d30fa134f8fd96c94e2</id>
<content type='text'>
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 &lt;rdunlap@infradead.org&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;rdunlap@infradead.org&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>clocksource/drivers: Fix dependencies for !HAS_IOMEM archs</title>
<updated>2016-01-11T17:45:12+00:00</updated>
<author>
<name>Richard Weinberger</name>
<email>richard@nod.at</email>
</author>
<published>2016-01-02T22:06:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=863ee050726b67db82869e8e4221a7385a28b067'/>
<id>863ee050726b67db82869e8e4221a7385a28b067</id>
<content type='text'>
Not every arch has io memory.

So, unbreak the build by fixing the dependencies.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Not every arch has io memory.

So, unbreak the build by fixing the dependencies.

Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
