27 Feb, 2020

1 commit

  • request_irq() is preferred over setup_irq(). The early boot setup_irq()
    invocations happen either via 'init_IRQ()' or 'time_init()', while
    memory allocators are ready by 'mm_init()'.

    Per tglx[1], setup_irq() existed in olden days when allocators were not
    ready by the time early interrupts were initialized.

    Hence replace setup_irq() by request_irq().

    Seldom remove_irq() usage has been observed coupled with setup_irq(),
    wherever that has been found, it too has been replaced by free_irq().

    A build error that was reported by kbuild test robot
    in the previous version of the patch also has been fixed.

    [1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos

    Signed-off-by: afzal mohammed
    Signed-off-by: Daniel Lezcano
    Link: https://lore.kernel.org/r/91961c77c1cf93d41523f5e1ac52043f32f97077.1582799709.git.afzal.mohd.ma@gmail.com

    afzal mohammed
     

19 Dec, 2018

2 commits


23 May, 2018

2 commits


14 Jun, 2017

1 commit

  • The CLOCKSOURCE_OF_DECLARE macro is used widely for the timers to declare the
    clocksource at early stage. However, this macro is also used to initialize
    the clockevent if any, or the clockevent only.

    It was originally suggested to declare another macro to initialize a
    clockevent, so in order to separate the two entities even they belong to the
    same IP. This was not accepted because of the impact on the DT where splitting
    a clocksource/clockevent definition does not make sense as it is a Linux
    concept not a hardware description.

    On the other side, the clocksource has not interrupt declared while the
    clockevent has, so it is easy from the driver to know if the description is
    for a clockevent or a clocksource, IOW it could be implemented at the driver
    level.

    So instead of dealing with a named clocksource macro, let's use a more generic
    one: TIMER_OF_DECLARE.

    The patch has not functional changes.

    Signed-off-by: Daniel Lezcano
    Acked-by: Heiko Stuebner
    Acked-by: Neil Armstrong
    Acked-by: Arnd Bergmann
    Acked-by: Matthias Brugger
    Reviewed-by: Linus Walleij

    Daniel Lezcano
     

28 Jun, 2016

2 commits

  • All the clocksource drivers's init function are now converted to return
    an error code. CLOCKSOURCE_OF_DECLARE is no longer used as well as the
    clksrc-of table.

    Let's convert back the names:
    - CLOCKSOURCE_OF_DECLARE_RET => CLOCKSOURCE_OF_DECLARE
    - clksrc-of-ret => clksrc-of

    Signed-off-by: Daniel Lezcano

    For exynos_mct and samsung_pwm_timer:
    Acked-by: Krzysztof Kozlowski

    For arch/arc:
    Acked-by: Vineet Gupta

    For mediatek driver:
    Acked-by: Matthias Brugger

    For the Rockchip-part
    Acked-by: Heiko Stuebner

    For STi :
    Acked-by: Patrice Chotard

    For the mps2-timer.c and versatile.c changes:
    Acked-by: Liviu Dudau

    For the OXNAS part :
    Acked-by: Neil Armstrong

    For LPC32xx driver:
    Acked-by: Sylvain Lemieux

    For Broadcom Kona timer change:
    Acked-by: Ray Jui

    For Sun4i and Sun5i:
    Acked-by: Chen-Yu Tsai

    For Meson6:
    Acked-by: Carlo Caione

    For Keystone:
    Acked-by: Santosh Shilimkar

    For NPS:
    Acked-by: Noam Camus

    For bcm2835:
    Acked-by: Eric Anholt

    Daniel Lezcano
     
  • The init functions do not return any error. They behave as the following:

    - panic, thus leading to a kernel crash while another timer may work and
    make the system boot up correctly

    or

    - print an error and let the caller unaware if the state of the system

    Change that by converting the init functions to return an error conforming
    to the CLOCKSOURCE_OF_RET prototype.

    Proper error handling (rollback, errno value) will be changed later case
    by case, thus this change just return back an error or success in the init
    function.

    Signed-off-by: Daniel Lezcano

    Daniel Lezcano
     

15 Oct, 2015

1 commit

  • Allow the timer core to change the smp affinity of the broadcast timer
    irq by setting CLOCK_EVT_FEAT_DYNIRQ flag. For this to work the timer
    core needs to be told about the used irq.

    This reduces interrupt pressure and wakeups on CPU0 as well as vastly
    reducing the number of timer broadcast IPIs.

    Signed-off-by: Lucas Stach
    Signed-off-by: Daniel Lezcano

    Lucas Stach
     

02 Sep, 2015

1 commit

  • Pull timer updates from Thomas Gleixner:
    "Rather large, but nothing exiting:

    - new range check for settimeofday() to prevent that boot time
    becomes negative.
    - fix for file time rounding
    - a few simplifications of the hrtimer code
    - fix for the proc/timerlist code so the output of clock realtime
    timers is accurate
    - more y2038 work
    - tree wide conversion of clockevent drivers to the new callbacks"

    * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (88 commits)
    hrtimer: Handle failure of tick_init_highres() gracefully
    hrtimer: Unconfuse switch_hrtimer_base() a bit
    hrtimer: Simplify get_target_base() by returning current base
    hrtimer: Drop return code of hrtimer_switch_to_hres()
    time: Introduce timespec64_to_jiffies()/jiffies_to_timespec64()
    time: Introduce current_kernel_time64()
    time: Introduce struct itimerspec64
    time: Add the common weak version of update_persistent_clock()
    time: Always make sure wall_to_monotonic isn't positive
    time: Fix nanosecond file time rounding in timespec_trunc()
    timer_list: Add the base offset so remaining nsecs are accurate for non monotonic timers
    cris/time: Migrate to new 'set-state' interface
    kernel: broadcast-hrtimer: Migrate to new 'set-state' interface
    xtensa/time: Migrate to new 'set-state' interface
    unicore/time: Migrate to new 'set-state' interface
    um/time: Migrate to new 'set-state' interface
    sparc/time: Migrate to new 'set-state' interface
    sh/localtimer: Migrate to new 'set-state' interface
    score/time: Migrate to new 'set-state' interface
    s390/time: Migrate to new 'set-state' interface
    ...

    Linus Torvalds
     

20 Aug, 2015

1 commit

  • Commit 6dd747825b20 ("ARM: imx: move timer resources into a structure")
    moved initialization parameters into a data structure, but neglected to set
    the irq field in that data structure for non-DT boots. This causes the system
    to hang if a non-DT boot is attempted.

    Fixes: 6dd747825b20 ("ARM: imx: move timer resources into a structure")
    Signed-off-by: Guenter Roeck
    Cc: Shawn Guo
    Cc: Daniel Lezcano
    Link: http://lkml.kernel.org/r/1440066441-13930-1-git-send-email-linux@roeck-us.net
    Signed-off-by: Thomas Gleixner

    Guenter Roeck
     

10 Aug, 2015

1 commit

  • Migrate timer-imx-gpt 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.

    Also drop:
    - 'imx_timer.cem': It was caching the last state of the clockevent
    device. The same behavior can be achieved by using clockevents state
    helpers. These helpers are only required for oneshot mode as
    shutdown/resume wouldn't be done twice by the core.

    - 'clock_event_mode_label': CLOCK_EVT_MODE_* shouldn't be used anymore
    by drivers. The prints are modified to print the set-state functions
    name now to debug the driver.

    Cc: Shawn Guo
    Cc: Daniel Lezcano
    Signed-off-by: Viresh Kumar
    Signed-off-by: Daniel Lezcano

    Viresh Kumar
     

07 Jul, 2015

1 commit

  • The rework of the imx clocksource driver missed to add an entry for
    imx27 which results in a boot failure on those machines.

    Add the proper CLOCKSOURCE_OF_DECLARE() entry for imx27 and map it to
    the imx21 init.

    Fixes: bef11c881ba5 'ARM: imx: initialize gpt device type for DT boot'
    Signed-off-by: Philippe Reynes
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: daniel.lezcano@linaro.org
    Cc: fabio.estevam@freescale.com
    Cc: shawnguo@kernel.org
    Cc: kernel@pengutronix.de
    Link: http://lkml.kernel.org/r/1435439504-406-1-git-send-email-tremyfr@gmail.com
    Signed-off-by: Thomas Gleixner

    Philippe Reynes
     

03 Jun, 2015

2 commits