<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/clocksource/arm_arch_timer.c, branch v4.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.0</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-01-07T03:29:20Z</updated>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2015-01-07T03:29:20Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2015-01-07T03:29:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=44d84d7272e5848878a96029b8a8b6e86854f146'/>
<id>urn:sha1:44d84d7272e5848878a96029b8a8b6e86854f146</id>
<content type='text'>
</content>
</entry>
<entry>
<title>arm_arch_timer: include clocksource.h directly</title>
<updated>2015-01-06T18:18:50Z</updated>
<author>
<name>Richard Cochran</name>
<email>richardcochran@gmail.com</email>
</author>
<published>2015-01-06T13:26:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7c8f1e78612f3155bfd10c020b38bcb4ca175223'/>
<id>urn:sha1:7c8f1e78612f3155bfd10c020b38bcb4ca175223</id>
<content type='text'>
This driver makes use of the clocksource code. Previously it had only
included the proper header indirectly, but that chain was inadvertently
broken by 74d23cc "time: move the timecounter/cyclecounter code into its
own file."

This patch fixes the issue by including clocksource.h directly.

Signed-off-by: Richard Cochran &lt;richardcochran@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>clocksource: arch_timer: Only use the virtual counter (CNTVCT) on arm64</title>
<updated>2014-12-16T21:26:44Z</updated>
<author>
<name>Catalin Marinas</name>
<email>catalin.marinas@arm.com</email>
</author>
<published>2014-12-10T11:02:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d6ad36913083d683aad4e02e53580c995f1a6ede'/>
<id>urn:sha1:d6ad36913083d683aad4e02e53580c995f1a6ede</id>
<content type='text'>
Commit 0b46b8a718c6 (clocksource: arch_timer: Fix code to use physical
timers when requested) introduces the use of physical counters in the
ARM architected timer driver. However, he arm64 kernel uses CNTVCT in
VDSO. When booting in EL2, the kernel switches to the physical timers to
make things easier for KVM but it continues to use the virtual counter
both in user and kernel. While in such scenario CNTVCT == CNTPCT (since
CNTVOFF is initialised by the kernel to 0), we want to spot firmware
bugs corrupting CNTVOFF early (which would affect CNTVCT).

Signed-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Tested-by: Yingjoe Chen &lt;yingjoe.chen@mediatek.com&gt;
Cc: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
</content>
</entry>
<entry>
<title>Merge branch 'clocksource/physical-timers' into next/drivers</title>
<updated>2014-12-05T07:32:16Z</updated>
<author>
<name>Olof Johansson</name>
<email>olof@lixom.net</email>
</author>
<published>2014-12-05T07:32:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6b34df9e30c8b596f9d0173ca17714076474458e'/>
<id>urn:sha1:6b34df9e30c8b596f9d0173ca17714076474458e</id>
<content type='text'>
* clocksource/physical-timers:
  clocksource: arch_timer: Allow the device tree to specify uninitialized timer registers
  clocksource: arch_timer: Fix code to use physical timers when requested
</content>
</entry>
<entry>
<title>clocksource: arch_timer: Allow the device tree to specify uninitialized timer registers</title>
<updated>2014-12-05T07:31:55Z</updated>
<author>
<name>Doug Anderson</name>
<email>dianders@chromium.org</email>
</author>
<published>2014-10-08T07:33:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=65b5732d241b8b39e07653794eefffd0d8028cbb'/>
<id>urn:sha1:65b5732d241b8b39e07653794eefffd0d8028cbb</id>
<content type='text'>
Some 32-bit (ARMv7) systems are architected like this:

* The firmware doesn't know and doesn't care about hypervisor mode and
  we don't want to add the complexity of hypervisor there.

* The firmware isn't involved in SMP bringup or resume.

* The ARCH timer come up with an uninitialized offset (CNTVOFF)
  between the virtual and physical counters.  Each core gets a
  different random offset.

* The device boots in "Secure SVC" mode.

* Nothing has touched the reset value of CNTHCTL.PL1PCEN or
  CNTHCTL.PL1PCTEN (both default to 1 at reset)

On systems like the above, it doesn't make sense to use the virtual
counter.  There's nobody managing the offset and each time a core goes
down and comes back up it will get reinitialized to some other random
value.

This adds an optional property which can inform the kernel of this
situation, and firmware is free to remove the property if it is going
to initialize the CNTVOFF registers when each CPU comes out of reset.

Currently, the best course of action in this case is to use the
physical timer, which is why it is important that CNTHCTL hasn't been
changed from its reset value and it's a reasonable assumption given
that the firmware has never entered HYP mode.

Note that it's been said that on ARMv8 systems the firmware and
kernel really can't be architected as described above.  That means
using the physical timer like this really only makes sense for ARMv7
systems.

Signed-off-by: Doug Anderson &lt;dianders@chromium.org&gt;
Signed-off-by: Sonny Rao &lt;sonnyrao@chromium.org&gt;
Reviewed-by: Mark Rutland &lt;mark.rutland@arm.com&gt;
Acked-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Acked-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Signed-off-by: Olof Johansson &lt;olof@lixom.net&gt;
</content>
</entry>
<entry>
<title>clocksource: arch_timer: Fix code to use physical timers when requested</title>
<updated>2014-12-05T07:30:26Z</updated>
<author>
<name>Sonny Rao</name>
<email>sonnyrao@chromium.org</email>
</author>
<published>2014-11-24T07:02:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0b46b8a718c6e90910a1b1b0fe797be3c167e186'/>
<id>urn:sha1:0b46b8a718c6e90910a1b1b0fe797be3c167e186</id>
<content type='text'>
This is a bug fix for using physical arch timers when
the arch_timer_use_virtual boolean is false.  It restores the
arch_counter_get_cntpct() function after removal in

0d651e4e "clocksource: arch_timer: use virtual counters"

We need this on certain ARMv7 systems which are architected like this:

* The firmware doesn't know and doesn't care about hypervisor mode and
  we don't want to add the complexity of hypervisor there.

* The firmware isn't involved in SMP bringup or resume.

* The ARCH timer come up with an uninitialized offset between the
  virtual and physical counters.  Each core gets a different random
  offset.

* The device boots in "Secure SVC" mode.

* Nothing has touched the reset value of CNTHCTL.PL1PCEN or
  CNTHCTL.PL1PCTEN (both default to 1 at reset)

One example of such as system is RK3288 where it is much simpler to
use the physical counter since there's nobody managing the offset and
each time a core goes down and comes back up it will get reinitialized
to some other random value.

Fixes: 0d651e4e65e9 ("clocksource: arch_timer: use virtual counters")
Cc: stable@vger.kernel.org
Signed-off-by: Sonny Rao &lt;sonnyrao@chromium.org&gt;
Acked-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Acked-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Signed-off-by: Olof Johansson &lt;olof@lixom.net&gt;
</content>
</entry>
<entry>
<title>ARM/ARM64: arch-timer: fix arch_timer_probed logic</title>
<updated>2014-10-26T19:50:00Z</updated>
<author>
<name>Marc Zyngier</name>
<email>marc.zyngier@arm.com</email>
</author>
<published>2014-10-15T15:06:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=59aa896db80479dec29f471a7ca2b9eeeeb7d38e'/>
<id>urn:sha1:59aa896db80479dec29f471a7ca2b9eeeeb7d38e</id>
<content type='text'>
Commit c387f07e6205 (clocksource: arm_arch_timer: Discard unavailable
timers correctly) changed the way the driver makes sure both the memory
and system-register timers have been probed before finalizing the probing.

There is a interesting flaw in this logic that leads to this final step
never to be executed. Things seems to work pretty well until something
actually needs the data that is produced during this final stage.

For example, KVM explodes on the first run of a guest when executed on
a platform that has both memory and sysreg nodes (Juno, for example).

Just fix the damned logic, and enjoy booting VMs again.

Tested on a Juno system.

Cc: Sudeep Holla &lt;sudeep.holla@arm.com&gt;
Cc: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Cc: Christoffer Dall &lt;christoffer.dall@linaro.org&gt;
Reported-by: Riku Voipio &lt;riku.voipio@linaro.org&gt;
Acked-by: Mark Rutland &lt;mark.rutland@arm.com&gt;
Acked-by: Sudeep Holla &lt;sudeep.holla@arm.com&gt;
Tested-by: Sudeep Holla &lt;sudeep.holla@arm.com&gt;
Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
</content>
</entry>
<entry>
<title>clocksource: arm_arch_timer: Consolidate arch_timer_evtstrm_enable</title>
<updated>2014-09-28T23:59:26Z</updated>
<author>
<name>Nathan Lynch</name>
<email>nathan_lynch@mentor.com</email>
</author>
<published>2014-09-28T23:50:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e1ce5c7adc735ce96a35806ca32ceb78e607a283'/>
<id>urn:sha1:e1ce5c7adc735ce96a35806ca32ceb78e607a283</id>
<content type='text'>
The arch_timer_evtstrm_enable hooks in arm and arm64 are substantially
similar, the only difference being a CONFIG_COMPAT-conditional section
which is relevant only for arm64.  Copy the arm64 version to the
driver, removing the arch-specific hooks.

Signed-off-by: Nathan Lynch &lt;nathan_lynch@mentor.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Acked-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
</entry>
<entry>
<title>clocksource: arm_arch_timer: Enable counter access for 32-bit ARM</title>
<updated>2014-09-28T23:59:25Z</updated>
<author>
<name>Nathan Lynch</name>
<email>nathan_lynch@mentor.com</email>
</author>
<published>2014-09-28T23:50:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8b8dde00347ef409b29abd97e5833ffdb4ed7508'/>
<id>urn:sha1:8b8dde00347ef409b29abd97e5833ffdb4ed7508</id>
<content type='text'>
The only difference between arm and arm64's implementations of
arch_counter_set_user_access is that 32-bit ARM does not enable user
access to the virtual counter.  We want to enable this access for the
32-bit ARM VDSO, so copy the arm64 version to the driver itself, and
remove the arch-specific implementations.

Signed-off-by: Nathan Lynch &lt;nathan_lynch@mentor.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Acked-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
</entry>
<entry>
<title>clocksource: arm_arch_timer: Change clocksource name if CP15 unavailable</title>
<updated>2014-09-28T23:59:24Z</updated>
<author>
<name>Nathan Lynch</name>
<email>nathan_lynch@mentor.com</email>
</author>
<published>2014-09-28T23:50:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=423bd69e69f565167ba14e2fe61df76c3c4a0d26'/>
<id>urn:sha1:423bd69e69f565167ba14e2fe61df76c3c4a0d26</id>
<content type='text'>
The arm and arm64 VDSOs need CP15 access to the architected counter.
If this is unavailable (which is allowed by ARM v7), indicate this by
changing the clocksource name to "arch_mem_counter" before registering
the clocksource.

Suggested by Stephen Boyd.

Signed-off-by: Nathan Lynch &lt;nathan_lynch@mentor.com&gt;
Reviewed-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@linaro.org&gt;
Acked-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
</entry>
</feed>
