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
     

31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version this program is distributed in the
    hope that it will be useful but without any warranty without even
    the implied warranty of merchantability or fitness for a particular
    purpose see the gnu general public license for more details you
    should have received a copy of the gnu general public license along
    with this program if not write to the free software foundation inc
    59 temple place suite 330 boston ma 02111 1307 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 1334 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Richard Fontana
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070033.113240726@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

19 Dec, 2018

1 commit

  • The function of_find_node_by_path() acquires a reference to the node
    returned by it and that reference needs to be dropped by its caller.

    integrator_ap_timer_init_of() doesn't do that. The pri_node and the
    sec_node are used as an identifier to compare against the current
    node, so we can directly drop the refcount after getting the node from
    the path as it is not used as pointer.

    By dropping the refcount right after getting it, a single variable is
    needed instead of two.

    Fix this by use a single variable and drop the refcount right after
    of_find_node_by_path().

    Signed-off-by: Yangtao Li
    Signed-off-by: Daniel Lezcano

    Yangtao Li
     

03 Oct, 2018

1 commit


18 Sep, 2017

1 commit

  • gcc-4.6 and older fail to inline integrator_clocksource_init, so they
    end up showing a harmless warning:

    WARNING: vmlinux.o(.text+0x4aa94c): Section mismatch in reference from the function integrator_clocksource_init() to the function .init.text:clocksource_mmio_init()
    The function integrator_clocksource_init() references
    the function __init clocksource_mmio_init().
    This is often because integrator_clocksource_init lacks a __init
    annotation or the annotation of clocksource_mmio_init is wrong.

    Add the missing __init annotation that makes it build cleanly with all
    compilers.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Thomas Gleixner
    Cc: Thierry Reding
    Cc: Linus Walleij
    Cc: Daniel Lezcano
    Link: http://lkml.kernel.org/r/20170915194310.1170514-1-arnd@arndb.de

    Arnd Bergmann
     

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
     

07 Apr, 2017

1 commit


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
     

10 Aug, 2015

1 commit

  • Migrate integrator 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.

    For oneshot mode the clkevt device was first getting disabled by
    clearing TIMER_CTRL_ENABLE bits in TIMER_CTRL register, followed by
    clearing TIMER_CTRL_PERIODIC bit. Both these are done with a single
    write operation now.

    Cc: Linus Walleij
    Signed-off-by: Viresh Kumar
    Signed-off-by: Daniel Lezcano
    Acked-by: Linus Walleij

    Viresh Kumar
     

27 Jun, 2015

1 commit

  • Pull ARM updates from Russell King:
    "Bigger items included in this update are:

    - A series of updates from Arnd for ARM randconfig build failures
    - Updates from Dmitry for StrongARM SA-1100 to move IRQ handling to
    drivers/irqchip/
    - Move ARMs SP804 timer to drivers/clocksource/
    - Perf updates from Mark Rutland in preparation to move the ARM perf
    code into drivers/ so it can be shared with ARM64.
    - MCPM updates from Nicolas
    - Add support for taking platform serial number from DT
    - Re-implement Keystone2 physical address space switch to conform to
    architecture requirements
    - Clean up ARMv7 LPAE code, which goes in hand with the Keystone2
    changes.
    - L2C cleanups to avoid unlocking caches if we're prevented by the
    secure support to unlock.
    - Avoid cleaning a potentially dirty cache containing stale data on
    CPU initialisation
    - Add ARM-only entry point for secondary startup (for machines that
    can only call into a Thumb kernel in ARM mode). Same thing is also
    done for the resume entry point.
    - Provide arch_irqs_disabled via asm-generic
    - Enlarge ARMv7M vector table
    - Always use BFD linker for VDSO, as gold doesn't accept some of the
    options we need.
    - Fix an incorrect BSYM (for Thumb symbols) usage, and convert all
    BSYM compiler macros to a "badr" (for branch address).
    - Shut up compiler warnings provoked by our cmpxchg() implementation.
    - Ensure bad xchg sizes fail to link"

    * 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm: (75 commits)
    ARM: Fix build if CLKDEV_LOOKUP is not configured
    ARM: fix new BSYM() usage introduced via for-arm-soc branch
    ARM: 8383/1: nommu: avoid deprecated source register on mov
    ARM: 8391/1: l2c: add options to overwrite prefetching behavior
    ARM: 8390/1: irqflags: Get arch_irqs_disabled from asm-generic
    ARM: 8387/1: arm/mm/dma-mapping.c: Add arm_coherent_dma_mmap
    ARM: 8388/1: tcm: Don't crash when TCM banks are protected by TrustZone
    ARM: 8384/1: VDSO: force use of BFD linker
    ARM: 8385/1: VDSO: group link options
    ARM: cmpxchg: avoid warnings from macro-ized cmpxchg() implementations
    ARM: remove __bad_xchg definition
    ARM: 8369/1: ARMv7M: define size of vector table for Vybrid
    ARM: 8382/1: clocksource: make ARM_TIMER_SP804 depend on GENERIC_SCHED_CLOCK
    ARM: 8366/1: move Dual-Timer SP804 driver to drivers/clocksource
    ARM: 8365/1: introduce sp804_timer_disable and remove arm_timer.h inclusion
    ARM: 8364/1: fix BE32 module loading
    ARM: 8360/1: add secondary_startup_arm prototype in header file
    ARM: 8359/1: correct secondary_startup_arm mode
    ARM: proc-v7: sanitise and document registers around errata
    ARM: proc-v7: clean up MIDR access
    ...

    Linus Torvalds
     

02 Jun, 2015

1 commit

  • The ARM Dual-Timer SP804 module is peripheral found not only on ARM32
    platforms but also on ARM64 platforms.

    This patch moves the driver out of arch/arm to driver/clocksource
    so that it can be used on ARM64 platforms also.

    Cc: Daniel Lezcano
    Cc: Rob Herring
    Cc: Arnd Bergmann
    Cc: Catalin Marinas
    Cc: Olof Johansson
    Acked-by: Thomas Gleixner
    Signed-off-by: Sudeep Holla
    Signed-off-by: Russell King

    Sudeep Holla
     

05 May, 2015

1 commit

  • of_io_request_and map returns an error pointer, but the current code assumes
    that on error the returned pointer will be NULL.

    Obviously, that makes the check completely useless. Change the test to actually
    check for the proper error code.

    Signed-off-by: Maxime Ripard
    Cc: Daniel Lezcano
    Link: http://lkml.kernel.org/r/1430579006-32702-5-git-send-email-maxime.ripard@free-electrons.com
    Signed-off-by: Thomas Gleixner

    Maxime Ripard
     

28 Oct, 2014

1 commit

  • This moves the timer/clocksource implementation for the
    Integrator/AP down to drivers/clocksource and augments the
    driver a little to use CLOCKSOURCE_OF_DECLARE(). Remove
    the static mapping of the timer blocks while we're at it.

    Tested on the Integrator/AP.

    Acked-by: Thomas Gleixner
    Acked-by: Daniel Lezcano
    Signed-off-by: Linus Walleij

    Linus Walleij