Hi,
This is my third attempt to migrate clockevent drivers to use set_dev_mode(). I
have tried to fix all issues raised by Frederic/Kevin on V2.
Please let me know if I missed something. Though patches 2-7 look big, it should
be fairly easy to review them now, so do try that :)
---------
A clockevent device should be stopped, or its events should be masked, if next
event is expected at KTIME_MAX, i.e. no events are required for very long time.
This would normally happen with NO_HZ (both NO_HZ_IDLE and NO_HZ_FULL) when
tick-sched timer is removed and we don't have any more timers scheduled for
long.
If we don't STOP clockevent device, we are guaranteed to receive at least one
spurious interrupt, as hrtimer_force_reprogram() isn't reprogramming the event
device (on expires == KTIME_MAX). Depending on particular implementation of
clockevent device, this can be a spurious interrupt at tick-rate.. (When driver
is emulating ONESHOT over PERIODIC mode. This was observed on at-least one
implementation: arm_arch_timer.c).
A simple (yet hacky) solution to get this fixed could be: update
hrtimer_force_reprogram() to always reprogram clockevent device and update
clockevent drivers to STOP generating events (or delay it to max time), when
'expires' is set to KTIME_MAX. But the drawback here is that every clockevent
driver has to be hacked for this particular case and its very easy for new ones
to miss this.
However, Thomas suggested to add an optional mode: ONESHOT_STOPPED
(lkml.org/lkml/2014/5/9/508) to solve this problem.
clockevents core would need to reconfigure mode later, when event is required
again, for platforms that implement ONESHOT_STOPPED mode and so it must know
which platforms implement it and which don't. This requires ->set_mode()
callback to have capability to return 'success' or 'failure'. Currently its
return type is 'void'.
To change return type of set_mode(), Thomas suggested to implement another
callback: ->set_dev_mode(), with return type 'int'. We can then convert
clockevent drivers to use this interface instead of existing ->set_mode() and
then finally remove ->set_mode()'s support.
This patchset first adds another callback with return capability,
set_dev_mode(), then it migrates all drivers one by one and finally removes
earlier callback set_mode() when nobody is using it.
NOTE: Following issue is still unresolved as this patchset isn't making it
worse. But it should be fixed before addition of ONESHOT_STOPPED mode.
Few clockevent drivers have disabled clock events as soon as we enter their
->set_dev_mode() callbacks and so they stay disabled for unsupported modes as
well.
All clockevent drivers are handling modes in ->set_dev_mode() with help of a
'switch' block. For the currently available modes none of them would ever get
down to the 'default case' of switch block.
And so we would never hit the BUG where we failed to change mode and still
disabled clock events.
But as soon as any new mode would be introduced in clockevents core, some of
these might behave unexpectedly. Like, core may expect events to be enabled as
call to ->set_dev_mode() returned failure and may not try enabling events again.
V2->V3:
- s/WARN_ON/WARN_ON_ONCE
- improved logs
- V2 had code belonging to problem mentioned in "NOTE" above, its dropped now
and would be addressed separately.
Viresh Kumar (8):
clockevents: add ->set_dev_mode() to struct clock_event_device
clockevents: arm: migrate to ->set_dev_mode()
clockevents: mips: migrate to ->set_dev_mode()
clockevents: sparc: migrate to ->set_dev_mode()
clockevents: x86: migrate to ->set_dev_mode()
clockevents: drivers/: migrate to ->set_dev_mode()
clockevents: misc: migrate to ->set_dev_mode()
clockevents: remove ->set_mode() from struct clock_event_device
arch/alpha/kernel/time.c | 32 ++++++++++++++++++----
arch/arc/kernel/time.c | 11 +++++---
arch/arm/common/timer-sp.c | 9 ++++---
arch/arm/kernel/smp_twd.c | 10 ++++---
arch/arm/mach-at91/at91rm9200_time.c | 7 +++--
arch/arm/mach-at91/at91sam926x_time.c | 11 ++++----
arch/arm/mach-clps711x/common.c | 9 ++++---
arch/arm/mach-cns3xxx/core.c | 10 ++++---
arch/arm/mach-davinci/time.c | 7 +++--
arch/arm/mach-footbridge/dc21285-timer.c | 7 +++--
arch/arm/mach-gemini/time.c | 7 ++---
arch/arm/mach-imx/epit.c | 11 ++++----
arch/arm/mach-imx/time.c | 11 ++++----
arch/arm/mach-integrator/integrator_ap.c | 8 +++---
arch/arm/mach-ixp4xx/common.c | 8 +++---
arch/arm/mach-ks8695/time.c | 22 ++++++++++-----
arch/arm/mach-lpc32xx/timer.c | 11 ++++----
arch/arm/mach-mmp/time.c | 12 +++++----
arch/arm/mach-netx/time.c | 11 ++++----
arch/arm/mach-omap1/time.c | 7 +++--
arch/arm/mach-omap1/timer32k.c | 7 +++--
arch/arm/mach-omap2/timer.c | 7 +++--
arch/arm/mach-pxa/time.c | 8 +++---
arch/arm/mach-sa1100/time.c | 8 +++---
arch/arm/mach-spear/time.c | 10 +++----
arch/arm/mach-w90x900/time.c | 7 +++--
arch/arm/plat-iop/time.c | 8 +++---
arch/arm/plat-orion/time.c | 20 ++++++++++----
arch/avr32/kernel/time.c | 7 ++---
arch/blackfin/kernel/time-ts.c | 14 +++++++---
arch/c6x/platforms/timer64.c | 7 +++--
arch/hexagon/kernel/time.c | 11 +++++---
arch/m68k/platform/coldfire/pit.c | 7 +++--
arch/microblaze/kernel/timer.c | 7 +++--
arch/mips/alchemy/common/time.c | 14 ++++++++--
arch/mips/include/asm/cevt-r4k.h | 2 +-
arch/mips/jazz/irq.c | 14 ++++++++--
arch/mips/jz4740/time.c | 9 ++++---
arch/mips/kernel/cevt-bcm1480.c | 11 +++++---
arch/mips/kernel/cevt-ds1287.c | 12 ++++++---
arch/mips/kernel/cevt-gic.c | 14 ++++++++--
arch/mips/kernel/cevt-gt641xx.c | 12 ++++++---
arch/mips/kernel/cevt-r4k.c | 14 ++++++++--
arch/mips/kernel/cevt-sb1250.c | 11 +++++---
arch/mips/kernel/cevt-smtc.c | 2 +-
arch/mips/kernel/cevt-txx9.c | 7 +++--
arch/mips/loongson/common/cs5536/cs5536_mfgpt.c | 12 ++++-----
arch/mips/ralink/cevt-rt3352.c | 13 +++++----
arch/mips/sgi-ip27/ip27-timer.c | 14 ++++++++--
arch/mips/sni/time.c | 9 ++++---
arch/mn10300/kernel/cevt-mn10300.c | 14 ++++++++--
arch/openrisc/kernel/time.c | 11 ++++----
arch/powerpc/kernel/time.c | 16 ++++++++---
arch/s390/kernel/time.c | 14 ++++++++--
arch/score/kernel/time.c | 8 +++---
arch/sh/kernel/localtimer.c | 15 +++++++++--
arch/sparc/kernel/time_32.c | 18 ++++++++-----
arch/sparc/kernel/time_64.c | 11 ++++----
arch/tile/kernel/time.c | 16 ++++++++---
arch/um/kernel/time.c | 7 +++--
arch/unicore32/kernel/time.c | 8 +++---
arch/x86/kernel/apic/apic.c | 10 ++++---
arch/x86/kernel/hpet.c | 19 +++++++------
arch/x86/lguest/boot.c | 9 ++++---
arch/x86/platform/uv/uv_time.c | 10 ++++---
arch/x86/xen/time.c | 23 +++++++---------
arch/xtensa/kernel/time.c | 9 ++++---
drivers/clocksource/arm_arch_timer.c | 36 ++++++++++++++-----------
drivers/clocksource/arm_global_timer.c | 9 ++++---
drivers/clocksource/bcm2835_timer.c | 8 +++---
drivers/clocksource/bcm_kona_timer.c | 10 ++++---
drivers/clocksource/cadence_ttc_timer.c | 7 +++--
drivers/clocksource/cs5535-clockevt.c | 17 +++++++++---
drivers/clocksource/dummy_timer.c | 15 +++++++++--
drivers/clocksource/dw_apb_timer.c | 7 +++--
drivers/clocksource/em_sti.c | 11 +++++---
drivers/clocksource/exynos_mct.c | 16 +++++++----
drivers/clocksource/i8253.c | 8 ++++--
drivers/clocksource/metag_generic.c | 11 ++++----
drivers/clocksource/moxart_timer.c | 8 +++---
drivers/clocksource/mxs_timer.c | 10 +++----
drivers/clocksource/nomadik-mtu.c | 7 +++--
drivers/clocksource/qcom-timer.c | 11 ++++----
drivers/clocksource/samsung_pwm_timer.c | 7 +++--
drivers/clocksource/sh_cmt.c | 9 ++++---
drivers/clocksource/sh_mtu2.c | 9 ++++---
drivers/clocksource/sh_tmu.c | 9 ++++---
drivers/clocksource/sun4i_timer.c | 9 ++++---
drivers/clocksource/tcb_clksrc.c | 11 +++++---
drivers/clocksource/tegra20_timer.c | 7 +++--
drivers/clocksource/time-armada-370-xp.c | 20 +++++++++-----
drivers/clocksource/time-efm32.c | 7 +++--
drivers/clocksource/time-orion.c | 17 +++++++++---
drivers/clocksource/timer-keystone.c | 9 ++++---
drivers/clocksource/timer-marco.c | 10 ++++---
drivers/clocksource/timer-prima2.c | 10 +++----
drivers/clocksource/timer-sun5i.c | 10 ++++---
drivers/clocksource/timer-u300.c | 7 +++--
drivers/clocksource/vf_pit_timer.c | 12 ++++++---
drivers/clocksource/vt8500_timer.c | 8 +++---
drivers/clocksource/zevio-timer.c | 9 +++----
include/linux/clockchips.h | 4 +--
kernel/time/clockevents.c | 7 +++--
kernel/time/tick-broadcast-hrtimer.c | 11 +++++---
kernel/time/timer_list.c | 2 +-
105 files changed, 756 insertions(+), 376 deletions(-)
--
2.0.0.rc2
Implement and enable context tracking for arm64 (which is
a prerequisite for FULL_NOHZ support). This patchset
builds upon earlier work by Kevin Hilman and is based on
Will Deacon's tree.
Changes v6 to v7:
* Rename parameter of ct_user_exit from restore to syscall
Changes v5 to v6:
* Don't save far_el1 in x26 in el0_dbg path (not needed)
* TIF_NOHZ processes go through the slow path (so no register
save/restore is needed in ct_user_enter)
Changes v4 to v5:
* Improvement to code restoring far_el1 (suggested by Christopher Covington)
* Improvement to register save/restore in ct_user_enter
Changes v3 to v4:
* Rename parameter of ct_user_exit from save to restore
* Rebased patch to Will Deacon's tree (branch remotes/origin/aarch64
of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git)
Changes v2 to v3:
* Save/restore necessary registers in ct_user_enter and ct_user_exit
* Annotate "error paths" out of el0_sync with ct_user_exit
Changes v1 to v2:
* Save far_el1 in x26 temporarily
Larry Bassel (2):
arm64: adjust el0_sync so that a function can be called
arm64: enable context tracking
arch/arm64/Kconfig | 1 +
arch/arm64/include/asm/thread_info.h | 4 +++
arch/arm64/kernel/entry.S | 58 +++++++++++++++++++++++++++++++-----
3 files changed, 56 insertions(+), 7 deletions(-)
--
1.8.3.2
Quoting Sebastian Capella (2014-02-28 10:17:31)
> Quoting Russell King - ARM Linux (2014-02-28 02:20:18)
> > On Thu, Feb 27, 2014 at 06:19:49PM -0800, Stephen Boyd wrote:
> > > On 02/27/14 17:47, Russ Dill wrote:
> > > > On 02/27/2014 04:09 PM, Stephen Boyd wrote:
> > > >> On 02/27/14 15:57, Sebastian Capella wrote:
> > > >>> diff --git a/arch/arm/include/asm/memory.h
> > > >>> b/arch/arm/include/asm/memory.h index 8756e4b..1079ea8 100644 ---
> > > >>> a/arch/arm/include/asm/memory.h +++
> > > >>> b/arch/arm/include/asm/memory.h @@ -291,6 +291,7 @@ static inline
> > > >>> void *phys_to_virt(phys_addr_t x) */ #define __pa(x)
> > > >>> __virt_to_phys((unsigned long)(x)) #define __va(x) ((void
> > > >>> *)__phys_to_virt((phys_addr_t)(x))) +#define __pa_symbol(x)
> > > >>> __pa(RELOC_HIDE((unsigned long)(x), 0))
> > > >> Just curious, is there a reason for the RELOC_HIDE() here? Or
> > > >> __pa_symbol() for that matter? It looks like only x86 uses this on
> > > >> the __nosave_{begin,end} symbol. Maybe it's copy-pasta?
> > > > From my understanding this needs to stick around so long as gcc 3.x is
> > > > supported (did it get dropped yet?) on ARM Linux since it doesn't
> > > > support -fno-strict-overflow.
> > >
> > > I don't think it's been dropped yet but I wonder if anyone has tried
> > > recent kernels with such a compiler?
> > >
> > > Would the usage of &__pv_table_begin in arch/arm/mm/mmu.c also need the
> > > same treatment?
> >
> > We've never had to play these kinds of games on ARM irrespective of
> > compiler version.
>
> I am using gcc 4.6.3. I can try removing it but I suspect it will just
> work without it. Let me see if I can get an older compiler and try both
> ways.
Hi,
I've been struggling a bit to test 3.x compilers on this.
I'm running an armv7 board, but the 3.x compilers I'm trying
don't appear to suport armv7.
Anyone have any suggestions? Is this a worthwhile effort?
Thanks!
Sebastian
Doug raised many important concerns on V3:
https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg645134.html
and so here is another iteration with improvements.
@Stephen: I have dropped you Tested-by's as patches are updated and requires a
retest, sorry for that :(
Douglas Anderson, recently pointed out an interesting problem due to which
udelay() was expiring earlier than it should.
While transitioning between frequencies few platforms may temporarily switch to
a stable frequency, waiting for the main PLL to stabilize.
For example: When we transition between very low frequencies on exynos, like
between 200MHz and 300MHz, we may temporarily switch to a PLL running at 800MHz.
No CPUFREQ notification is sent for that. That means there's a period of time
when we're running at 800MHz but loops_per_jiffy is calibrated at between 200MHz
and 300MHz. And so udelay behaves badly.
To get this fixed in a generic way, lets introduce another set of callbacks
get_intermediate() and target_intermediate(), only for drivers with
target_index() and CPUFREQ_ASYNC_NOTIFICATION unset.
get_intermediate should return a stable intermediate frequency platform wants to
switch to, and target_intermediate() should set CPU to to that frequency, before
jumping to the frequency corresponding to 'index'. Core will take care of
sending notifications and driver doesn't have to handle them in
target_intermediate() or target_index().
This patchset also update Tegra to use this new infrastructure and is already
tested by Stephen.
V3->V4:
- Allow get_intermediate() to return zero when we don't need to switch to
intermediate first
- Get rid of 'goto' and create another routine for handling intermediate freqs
- Allow target_index() to fail, its not a crime :)
- Fix tegra driver to return zero from get_intermediate() for few situations
(refer to patch 3/4)
- Fix issues with tegra's patch, like s/rate/rate * 1000
- Overall there are more modifications that what Doug requested as I felt we
need better support from core.
- Looks much better now, thanks Doug :)
V2-V3:
- Fix spelling error: s/Uset/Used
- Update tegra with the changes Stephen suggested
- Include a dependency patch sent separately earlier (3/4)
V1-V2: Almost changed completely, V1 was here: https://lkml.org/lkml/2014/5/15/40
Viresh Kumar (3):
cpufreq: handle calls to ->target_index() in separate routine
cpufreq: add support for intermediate (stable) frequencies
cpufreq: Tegra: implement intermediate frequency callbacks
Documentation/cpu-freq/cpu-drivers.txt | 29 ++++++++-
drivers/cpufreq/cpufreq.c | 111 ++++++++++++++++++++++++++-------
drivers/cpufreq/tegra-cpufreq.c | 81 ++++++++++++++----------
include/linux/cpufreq.h | 25 ++++++++
4 files changed, 186 insertions(+), 60 deletions(-)
--
2.0.0.rc2
Hi,
This patch series fixes support for AFTR idle mode on boards with
secure firmware enabled (it also includes fix for register setup on
EXYNOS4x12 SoCs). It has been tested on Trats2 target but should
also work on (EXYNOS4412 based) Insignal Origen board.
This patchset depends on "[PATCH V5 00/20] ARM: exynos: cpuidle:
Move the driver to drivers/cpuidle" patch series from Daniel Lezcano
("http://www.spinics.net/lists/linux-samsung-soc/msg28494.html").
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
Bartlomiej Zolnierkiewicz (5):
ARM: EXYNOS: add AFTR mode support to firmware do_idle method
ARM: EXYNOS: PM: replace EXYNOS_BOOT_VECTOR_* macros by static inlines
ARM: EXYNOS: PM: use c15resume firmware method if secure firmware is
enabled
ARM: EXYNOS: PM: fix register setup on EXYNOS4x12 for AFTR mode code
ARM: EXYNOS: cpuidle: add secure firmware support to AFTR mode code
Kyungmin Park (1):
arm: firmware: Check firmware is running or not
Tomasz Figa (1):
ARM: EXYNOS: add support for firmware-assisted c15resume
arch/arm/common/firmware.c | 5 +++++
arch/arm/include/asm/firmware.h | 14 +++++++++++++-
arch/arm/mach-exynos/firmware.c | 18 ++++++++++++++++--
arch/arm/mach-exynos/pm.c | 40 ++++++++++++++++++++++++++++++++--------
drivers/cpuidle/cpuidle-exynos.c | 7 ++++++-
5 files changed, 72 insertions(+), 12 deletions(-)
--
1.8.2.3