Age | Commit message (Collapse) | Author | Files | Lines |
|
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 <[email protected]>
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 <[email protected]>
Signed-off-by: Daniel Lezcano <[email protected]>
Link: https://lore.kernel.org/r/91961c77c1cf93d41523f5e1ac52043f32f97077.1582799709.git.afzal.mohd.ma@gmail.com
|
|
As said in commit f2c2cbcc35d4 ("powerpc: Use pr_warn instead of
pr_warning"), removing pr_warning so all logging messages use a
consistent <prefix>_warn style. Let's do it.
Link: http://lkml.kernel.org/r/[email protected]
To: [email protected]
Signed-off-by: Kefeng Wang <[email protected]>
Acked-by: Daniel Lezcano <[email protected]>
Reviewed-by: Sergey Senozhatsky <[email protected]>
[[email protected]: Fixed indentation]
Signed-off-by: Petr Mladek <[email protected]>
|
|
Based on 2 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 version 2 as
published by the free software foundation
this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation #
extracted by the scancode license scanner the SPDX license identifier
GPL-2.0-only
has been chosen to replace the boilerplate/reference in 4122 file(s).
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Enrico Weigelt <[email protected]>
Reviewed-by: Kate Stewart <[email protected]>
Reviewed-by: Allison Randal <[email protected]>
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
The config option name is now renamed to 'TIMER_OF' for consistency with
the CLOCKSOURCE_OF_DECLARE => TIMER_OF_DECLARE change.
Signed-off-by: Daniel Lezcano <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
|
|
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 <[email protected]>
Acked-by: Heiko Stuebner <[email protected]>
Acked-by: Neil Armstrong <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Acked-by: Matthias Brugger <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
|
|
Printing with pr_* functions requires adding line break manually.
Signed-off-by: Rafał Miłecki <[email protected]>
Acked-by: Thierry Reding <[email protected]>
Signed-off-by: Daniel Lezcano <[email protected]>
|
|
There is no point in having an extra type for extra confusion. u64 is
unambiguous.
Conversion was done with the following coccinelle script:
@rem@
@@
-typedef u64 cycle_t;
@fix@
typedef cycle_t;
@@
-cycle_t
+u64
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: John Stultz <[email protected]>
|
|
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 <[email protected]>
For exynos_mct and samsung_pwm_timer:
Acked-by: Krzysztof Kozlowski <[email protected]>
For arch/arc:
Acked-by: Vineet Gupta <[email protected]>
For mediatek driver:
Acked-by: Matthias Brugger <[email protected]>
For the Rockchip-part
Acked-by: Heiko Stuebner <[email protected]>
For STi :
Acked-by: Patrice Chotard <[email protected]>
For the mps2-timer.c and versatile.c changes:
Acked-by: Liviu Dudau <[email protected]>
For the OXNAS part :
Acked-by: Neil Armstrong <[email protected]>
For LPC32xx driver:
Acked-by: Sylvain Lemieux <[email protected]>
For Broadcom Kona timer change:
Acked-by: Ray Jui <[email protected]>
For Sun4i and Sun5i:
Acked-by: Chen-Yu Tsai <[email protected]>
For Meson6:
Acked-by: Carlo Caione <[email protected]>
For Keystone:
Acked-by: Santosh Shilimkar <[email protected]>
For NPS:
Acked-by: Noam Camus <[email protected]>
For bcm2835:
Acked-by: Eric Anholt <[email protected]>
|
|
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 <[email protected]>
|
|
Fix the Samsung pwm timer access code to deal with kernels built for big
endian operation.
Signed-off-by: Matthew Leach <[email protected]>
Signed-off-by: Daniel Lezcano <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
|
|
Currently samsung_pwm_timer can be used as a scheduler clock. We properly
marked samsung_read_sched_clock() as notrace but we then call another
function samsung_clocksource_read() that _wasn't_ notrace.
Having a traceable function in the sched_clock() path leads to a recursion
within ftrace and a kernel crash.
Fix this by adding notrace attribute to the samsung_clocksource_read()
function.
Signed-off-by: Jisheng Zhang <[email protected]>
Signed-off-by: Daniel Lezcano <[email protected]>
|
|
Migrate samsung_pwm 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.
Cc: Tomasz Figa <[email protected]>
Cc: Kukjin Kim <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
Signed-off-by: Daniel Lezcano <[email protected]>
|
|
This patch removes the use of the IRQF_DISABLED flag
It's a NOOP since 2.6.35 and it will be removed one day.
[dlezcano] : slightly changed the changelog
Signed-off-by: Michael Opdenacker <[email protected]>
Signed-off-by: Daniel Lezcano <[email protected]>
|
|
fordlezcano/3.13/sched-clock64-conversion
Update to tip/timers/core and resolve minor conflict.
Conflicts:
drivers/clocksource/samsung_pwm_timer.c
Signed-off-by: John Stultz <[email protected]>
|
|
Pull clock framework changes from Michael Turquette:
"The common clk framework changes for 3.12 are dominated by clock
driver patches, both new drivers and fixes to existing. A high
percentage of these are for Samsung platforms like Exynos. Core
framework fixes and some new features like automagical clock
re-parenting round out the patches"
* tag 'clk-for-linus-3.12' of git://git.linaro.org/people/mturquette/linux: (102 commits)
clk: only call get_parent if there is one
clk: samsung: exynos5250: Simplify registration of PLL rate tables
clk: samsung: exynos4: Register PLL rate tables for Exynos4x12
clk: samsung: exynos4: Register PLL rate tables for Exynos4210
clk: samsung: exynos4: Reorder registration of mout_vpllsrc
clk: samsung: pll: Add support for rate configuration of PLL46xx
clk: samsung: pll: Use new registration method for PLL46xx
clk: samsung: pll: Add support for rate configuration of PLL45xx
clk: samsung: pll: Use new registration method for PLL45xx
clk: samsung: exynos4: Rename exynos4_plls to exynos4x12_plls
clk: samsung: exynos4: Remove checks for DT node
clk: samsung: exynos4: Remove unused static clkdev aliases
clk: samsung: Modify _get_rate() helper to use __clk_lookup()
clk: samsung: exynos4: Use separate aliases for cpufreq related clocks
clocksource: samsung_pwm_timer: Get clock from device tree
ARM: dts: exynos4: Specify PWM clocks in PWM node
pwm: samsung: Update DT bindings documentation to cover clocks
clk: Move symbol export to proper location
clk: fix new_parent dereference before null check
clk: wm831x: Initialise wm831x pointer on init
...
|
|
When booting with device tree static clkdev aliases should not be used.
This patch modifies the samsung_pwm_timer driver to use DT-based clock
lookup when booting with device tree.
Signed-off-by: Tomasz Figa <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Reviewed-by: Sylwester Nawrocki <[email protected]>
Signed-off-by: Mike Turquette <[email protected]>
|
|
Current suspend/resume handling of the driver was broken, because:
- periodic timer was being enabled in CLOCK_EVT_MODE_RESUME mode, which
does not seem to be correct behavior looking at other platforms,
- PWM divisors need to be restored, but they were not,
- clockevent interrupt mask needs to be restored, but it was not,
- clocksource was being restored in clockevent resume callback.
This patch fixes issues mentioned above, making suspend/resume handling
in the driver correct.
Signed-off-by: Tomasz Figa <[email protected]>
Reviewed-by: Sylwester Nawrocki <[email protected]>
Tested-by: Heiko Stuebner <[email protected]>
Tested-by: Mark Brown <[email protected]>
Tested-by: Sylwester Nawrocki <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Acked-by: Daniel Lezcano <[email protected]>
|
|
In case of Samsung PWM timer, clocksource MMIO can not be used, because
custom suspend/resume callbacks are required.
Signed-off-by: Tomasz Figa <[email protected]>
Reviewed-by: Daniel Lezcano <[email protected]>
Reviewed-by: Sylwester Nawrocki <[email protected]>
Tested-by: Heiko Stuebner <[email protected]>
Tested-by: Mark Brown <[email protected]>
Tested-by: Sylwester Nawrocki <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
|
|
Instead of calculating register every time the timer should be read,
we can just do it one time at initialization and store the address in
driver data.
Signed-off-by: Tomasz Figa <[email protected]>
Reviewed-by: Sylwester Nawrocki <[email protected]>
Tested-by: Heiko Stuebner <[email protected]>
Tested-by: Mark Brown <[email protected]>
Tested-by: Sylwester Nawrocki <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
|
|
PWM channel 4 has its autoreload bit located at different position. This
patch fixes the driver to account for that.
This fixes a problem with the clocksource hanging after it overflows because
it is not reloaded any more.
Signed-off-by: Tomasz Figa <[email protected]>
Reviewed-by: Sylwester Nawrocki <[email protected]>
Tested-by: Heiko Stuebner <[email protected]>
Tested-by: Mark Brown <[email protected]>
Tested-by: Sylwester Nawrocki <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
|
|
PWM registers are shared between clocksource and PWM drivers and so can
not be claimed for exclusive use.
Signed-off-by: Tomasz Figa <[email protected]>
Reviewed-by: Sylwester Nawrocki <[email protected]>
Tested-by: Heiko Stuebner <[email protected]>
Tested-by: Mark Brown <[email protected]>
Tested-by: Sylwester Nawrocki <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
|
|
The 32 bit sched_clock interface now supports 64 bits. Upgrade to
the 64 bit function to allow us to remove the 32 bit registration
interface.
Cc: Tomasz Figa <[email protected]>
Cc: Kyungmin Park <[email protected]>
Cc: Kukjin Kim <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
Signed-off-by: John Stultz <[email protected]>
|
|
Nothing about the sched_clock implementation in the ARM port is
specific to the architecture. Generalize the code so that other
architectures can use it by selecting GENERIC_SCHED_CLOCK.
Signed-off-by: Stephen Boyd <[email protected]>
[jstultz: Merge minor collisions with other patches in my tree]
Signed-off-by: John Stultz <[email protected]>
|
|
Due to rounding errors in clockevents core (in conversions between ticks
and nsecs), it might happen that the set_next_event callback gets called
with cycles = 0, causing the code to incorrectly program the PWM timer.
This patch modifies the callback to program the timer for 1 tick, if
received tick count value is 0.
Signed-off-by: Tomasz Figa <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Reviewed-by: Arnd Bergmann <[email protected]>
Acked-by: Kukjin Kim <[email protected]>
Signed-off-by: Olof Johansson <[email protected]>
|
|
In current code, the tick count value programmed to the hardware is
always decremented by one. This is reasonable for periodic mode, since
there is one extra tick between 0 and COUNT (after reloading), but it
makes oneshot events happen 1 tick earlier than requested, because the
interrupt is triggered on transition from 1 to 0.
This patch removes the decrementation from PWM channel setup code and
moves it instead to periodic timer setup, to make both periodic and
oneshot modes work correctly.
Signed-off-by: Tomasz Figa <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Reviewed-by: Arnd Bergmann <[email protected]>
Acked-by: Kukjin Kim <[email protected]>
Signed-off-by: Olof Johansson <[email protected]>
|
|
This patch replaces hardcoded -1 argument passed to
clockevents_config_and_register() with tcnt_max calculated based on
variant data.
This fixes invalid max delta configuration for 16-bit timers of s3c24xx.
Signed-off-by: Tomasz Figa <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Reviewed-by: Arnd Bergmann <[email protected]>
Acked-by: Kukjin Kim <[email protected]>
Signed-off-by: Olof Johansson <[email protected]>
|
|
This patch extends the driver to support platforms that still use legacy
ATAGS-based boot, without device tree, by providing an exported function
that can be used from platform code to initialize the clocksource.
Signed-off-by: Tomasz Figa <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Reviewed-by: Arnd Bergmann <[email protected]>
Acked-by: Kukjin Kim <[email protected]>
Signed-off-by: Olof Johansson <[email protected]>
|
|
This patch modifies the driver to keep all its private data consistently
in a single struct, instead of keeping part as separate variables.
Signed-off-by: Tomasz Figa <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Reviewed-by: Arnd Bergmann <[email protected]>
Acked-by: Kukjin Kim <[email protected]>
Signed-off-by: Olof Johansson <[email protected]>
|
|
This patch makes the PWM spinlock global and exports it to allow using
it in Samsung PWM driver (will be reworked to use proper synchronization
in further patches).
Signed-off-by: Tomasz Figa <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Reviewed-by: Arnd Bergmann <[email protected]>
Acked-by: Kukjin Kim <[email protected]>
Signed-off-by: Olof Johansson <[email protected]>
|
|
This adds a new clocksource driver for the PWM timer that is
present in most Samsung SoCs, based on the existing driver in
arch/arm/plat-samsung/samsung-time.c and many changes implemented by
Tomasz Figa.
Originally, the conversion of all Samsung machines to the new driver was
planned for 3.10, but that work ended up being too late and too invasive
just before the merge window.
Unfortunately, other changes in the Exynos platform resulted in some
Exynos4 setups, particularly the Universal C210 board to be broken. In
order to fix that with minimum risk, so we now leave the existing pwm
clocksource driver in place for all older platforms and use the new
driver only for device tree enabled boards. This way, we can get the
broken machines running again using DT descriptions.
All clocksource changes were implemented by Tomasz, while the DT
registration was rewritten by Arnd.
Signed-off-by: Arnd Bergmann <[email protected]>
Cc: Tomasz Figa <[email protected]>
Cc: Kyungmin Park <[email protected]>
Cc: Kukjin Kim <[email protected]>
Cc: Ben Dooks <[email protected]>
Cc: John Stultz <[email protected]>
Cc: Thomas Gleixner <[email protected]>
|