mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
Merge tag 'timers-core-2024-11-18' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer updates from Thomas Gleixner:
"A rather large update for timekeeping and timers:
- The final step to get rid of auto-rearming posix-timers
posix-timers are currently auto-rearmed by the kernel when the
signal of the timer is ignored so that the timer signal can be
delivered once the corresponding signal is unignored.
This requires to throttle the timer to prevent a DoS by small
intervals and keeps the system pointlessly out of low power states
for no value. This is a long standing non-trivial problem due to
the lock order of posix-timer lock and the sighand lock along with
life time issues as the timer and the sigqueue have different life
time rules.
Cure this by:
- Embedding the sigqueue into the timer struct to have the same
life time rules. Aside of that this also avoids the lookup of
the timer in the signal delivery and rearm path as it's just a
always valid container_of() now.
- Queuing ignored timer signals onto a seperate ignored list.
- Moving queued timer signals onto the ignored list when the
signal is switched to SIG_IGN before it could be delivered.
- Walking the ignored list when SIG_IGN is lifted and requeue the
signals to the actual signal lists. This allows the signal
delivery code to rearm the timer.
This also required to consolidate the signal delivery rules so they
are consistent across all situations. With that all self test
scenarios finally succeed.
- Core infrastructure for VFS multigrain timestamping
This is required to allow the kernel to use coarse grained time
stamps by default and switch to fine grained time stamps when inode
attributes are actively observed via getattr().
These changes have been provided to the VFS tree as well, so that
the VFS specific infrastructure could be built on top.
- Cleanup and consolidation of the sleep() infrastructure
- Move all sleep and timeout functions into one file
- Rework udelay() and ndelay() into proper documented inline
functions and replace the hardcoded magic numbers by proper
defines.
- Rework the fsleep() implementation to take the reality of the
timer wheel granularity on different HZ values into account.
Right now the boundaries are hard coded time ranges which fail
to provide the requested accuracy on different HZ settings.
- Update documentation for all sleep/timeout related functions
and fix up stale documentation links all over the place
- Fixup a few usage sites
- Rework of timekeeping and adjtimex(2) to prepare for multiple PTP
clocks
A system can have multiple PTP clocks which are participating in
seperate and independent PTP clock domains. So far the kernel only
considers the PTP clock which is based on CLOCK TAI relevant as
that's the clock which drives the timekeeping adjustments via the
various user space daemons through adjtimex(2).
The non TAI based clock domains are accessible via the file
descriptor based posix clocks, but their usability is very limited.
They can't be accessed fast as they always go all the way out to
the hardware and they cannot be utilized in the kernel itself.
As Time Sensitive Networking (TSN) gains traction it is required to
provide fast user and kernel space access to these clocks.
The approach taken is to utilize the timekeeping and adjtimex(2)
infrastructure to provide this access in a similar way how the
kernel provides access to clock MONOTONIC, REALTIME etc.
Instead of creating a duplicated infrastructure this rework
converts timekeeping and adjtimex(2) into generic functionality
which operates on pointers to data structures instead of using
static variables.
This allows to provide time accessors and adjtimex(2) functionality
for the independent PTP clocks in a subsequent step.
- Consolidate hrtimer initialization
hrtimers are set up by initializing the data structure and then
seperately setting the callback function for historical reasons.
That's an extra unnecessary step and makes Rust support less
straight forward than it should be.
Provide a new set of hrtimer_setup*() functions and convert the
core code and a few usage sites of the less frequently used
interfaces over.
The bulk of the htimer_init() to hrtimer_setup() conversion is
already prepared and scheduled for the next merge window.
- Drivers:
- Ensure that the global timekeeping clocksource is utilizing the
cluster 0 timer on MIPS multi-cluster systems.
Otherwise CPUs on different clusters use their cluster specific
clocksource which is not guaranteed to be synchronized with
other clusters.
- Mostly boring cleanups, fixes, improvements and code movement"
* tag 'timers-core-2024-11-18' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (140 commits)
posix-timers: Fix spurious warning on double enqueue versus do_exit()
clocksource/drivers/arm_arch_timer: Use of_property_present() for non-boolean properties
clocksource/drivers/gpx: Remove redundant casts
clocksource/drivers/timer-ti-dm: Fix child node refcount handling
dt-bindings: timer: actions,owl-timer: convert to YAML
clocksource/drivers/ralink: Add Ralink System Tick Counter driver
clocksource/drivers/mips-gic-timer: Always use cluster 0 counter as clocksource
clocksource/drivers/timer-ti-dm: Don't fail probe if int not found
clocksource/drivers:sp804: Make user selectable
clocksource/drivers/dw_apb: Remove unused dw_apb_clockevent functions
hrtimers: Delete hrtimer_init_on_stack()
alarmtimer: Switch to use hrtimer_setup() and hrtimer_setup_on_stack()
io_uring: Switch to use hrtimer_setup_on_stack()
sched/idle: Switch to use hrtimer_setup_on_stack()
hrtimers: Delete hrtimer_init_sleeper_on_stack()
wait: Switch to use hrtimer_setup_sleeper_on_stack()
timers: Switch to use hrtimer_setup_sleeper_on_stack()
net: pktgen: Switch to use hrtimer_setup_sleeper_on_stack()
futex: Switch to use hrtimer_setup_sleeper_on_stack()
fs/aio: Switch to use hrtimer_setup_sleeper_on_stack()
...
This commit is contained in:
@@ -470,8 +470,6 @@ API usage
|
||||
usleep_range() should be preferred over udelay(). The proper way of
|
||||
using usleep_range() is mentioned in the kernel docs.
|
||||
|
||||
See: https://www.kernel.org/doc/html/latest/timers/timers-howto.html#delays-information-on-the-various-kernel-delay-sleep-mechanisms
|
||||
|
||||
|
||||
Comments
|
||||
--------
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
Actions Semi Owl Timer
|
||||
|
||||
Required properties:
|
||||
- compatible : "actions,s500-timer" for S500
|
||||
"actions,s700-timer" for S700
|
||||
"actions,s900-timer" for S900
|
||||
- reg : Offset and length of the register set for the device.
|
||||
- interrupts : Should contain the interrupts.
|
||||
- interrupt-names : Valid names are: "2hz0", "2hz1",
|
||||
"timer0", "timer1", "timer2", "timer3"
|
||||
See ../resource-names.txt
|
||||
|
||||
Example:
|
||||
|
||||
timer@b0168000 {
|
||||
compatible = "actions,s500-timer";
|
||||
reg = <0xb0168000 0x100>;
|
||||
interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "timer0", "timer1";
|
||||
};
|
||||
107
Documentation/devicetree/bindings/timer/actions,owl-timer.yaml
Normal file
107
Documentation/devicetree/bindings/timer/actions,owl-timer.yaml
Normal file
@@ -0,0 +1,107 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/timer/actions,owl-timer.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Actions Semi Owl timer
|
||||
|
||||
maintainers:
|
||||
- Andreas Färber <afaerber@suse.de>
|
||||
|
||||
description:
|
||||
Actions Semi Owl SoCs provide 32bit and 2Hz timers.
|
||||
The 32bit timers support dynamic irq, as well as one-shot mode.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- actions,s500-timer
|
||||
- actions,s700-timer
|
||||
- actions,s900-timer
|
||||
|
||||
clocks:
|
||||
maxItems: 1
|
||||
|
||||
interrupts:
|
||||
minItems: 1
|
||||
maxItems: 6
|
||||
|
||||
interrupt-names:
|
||||
minItems: 1
|
||||
maxItems: 6
|
||||
items:
|
||||
enum:
|
||||
- 2hz0
|
||||
- 2hz1
|
||||
- timer0
|
||||
- timer1
|
||||
- timer2
|
||||
- timer3
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- clocks
|
||||
- interrupts
|
||||
- interrupt-names
|
||||
- reg
|
||||
|
||||
allOf:
|
||||
- if:
|
||||
properties:
|
||||
compatible:
|
||||
contains:
|
||||
enum:
|
||||
- actions,s500-timer
|
||||
then:
|
||||
properties:
|
||||
interrupts:
|
||||
minItems: 4
|
||||
maxItems: 4
|
||||
interrupt-names:
|
||||
items:
|
||||
- const: 2hz0
|
||||
- const: 2hz1
|
||||
- const: timer0
|
||||
- const: timer1
|
||||
|
||||
- if:
|
||||
properties:
|
||||
compatible:
|
||||
contains:
|
||||
enum:
|
||||
- actions,s700-timer
|
||||
- actions,s900-timer
|
||||
then:
|
||||
properties:
|
||||
interrupts:
|
||||
minItems: 1
|
||||
maxItems: 1
|
||||
interrupt-names:
|
||||
items:
|
||||
- const: timer1
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/interrupt-controller/arm-gic.h>
|
||||
#include <dt-bindings/interrupt-controller/irq.h>
|
||||
soc {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
timer@b0168000 {
|
||||
compatible = "actions,s500-timer";
|
||||
reg = <0xb0168000 0x100>;
|
||||
clocks = <&hosc>;
|
||||
interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "2hz0", "2hz1", "timer0", "timer1";
|
||||
};
|
||||
};
|
||||
...
|
||||
121
Documentation/timers/delay_sleep_functions.rst
Normal file
121
Documentation/timers/delay_sleep_functions.rst
Normal file
@@ -0,0 +1,121 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
Delay and sleep mechanisms
|
||||
==========================
|
||||
|
||||
This document seeks to answer the common question: "What is the
|
||||
RightWay (TM) to insert a delay?"
|
||||
|
||||
This question is most often faced by driver writers who have to
|
||||
deal with hardware delays and who may not be the most intimately
|
||||
familiar with the inner workings of the Linux Kernel.
|
||||
|
||||
The following table gives a rough overview about the existing function
|
||||
'families' and their limitations. This overview table does not replace the
|
||||
reading of the function description before usage!
|
||||
|
||||
.. list-table::
|
||||
:widths: 20 20 20 20 20
|
||||
:header-rows: 2
|
||||
|
||||
* -
|
||||
- `*delay()`
|
||||
- `usleep_range*()`
|
||||
- `*sleep()`
|
||||
- `fsleep()`
|
||||
* -
|
||||
- busy-wait loop
|
||||
- hrtimers based
|
||||
- timer list timers based
|
||||
- combines the others
|
||||
* - Usage in atomic Context
|
||||
- yes
|
||||
- no
|
||||
- no
|
||||
- no
|
||||
* - precise on "short intervals"
|
||||
- yes
|
||||
- yes
|
||||
- depends
|
||||
- yes
|
||||
* - precise on "long intervals"
|
||||
- Do not use!
|
||||
- yes
|
||||
- max 12.5% slack
|
||||
- yes
|
||||
* - interruptible variant
|
||||
- no
|
||||
- yes
|
||||
- yes
|
||||
- no
|
||||
|
||||
A generic advice for non atomic contexts could be:
|
||||
|
||||
#. Use `fsleep()` whenever unsure (as it combines all the advantages of the
|
||||
others)
|
||||
#. Use `*sleep()` whenever possible
|
||||
#. Use `usleep_range*()` whenever accuracy of `*sleep()` is not sufficient
|
||||
#. Use `*delay()` for very, very short delays
|
||||
|
||||
Find some more detailed information about the function 'families' in the next
|
||||
sections.
|
||||
|
||||
`*delay()` family of functions
|
||||
------------------------------
|
||||
|
||||
These functions use the jiffy estimation of clock speed and will busy wait for
|
||||
enough loop cycles to achieve the desired delay. udelay() is the basic
|
||||
implementation and ndelay() as well as mdelay() are variants.
|
||||
|
||||
These functions are mainly used to add a delay in atomic context. Please make
|
||||
sure to ask yourself before adding a delay in atomic context: Is this really
|
||||
required?
|
||||
|
||||
.. kernel-doc:: include/asm-generic/delay.h
|
||||
:identifiers: udelay ndelay
|
||||
|
||||
.. kernel-doc:: include/linux/delay.h
|
||||
:identifiers: mdelay
|
||||
|
||||
|
||||
`usleep_range*()` and `*sleep()` family of functions
|
||||
----------------------------------------------------
|
||||
|
||||
These functions use hrtimers or timer list timers to provide the requested
|
||||
sleeping duration. In order to decide which function is the right one to use,
|
||||
take some basic information into account:
|
||||
|
||||
#. hrtimers are more expensive as they are using an rb-tree (instead of hashing)
|
||||
#. hrtimers are more expensive when the requested sleeping duration is the first
|
||||
timer which means real hardware has to be programmed
|
||||
#. timer list timers always provide some sort of slack as they are jiffy based
|
||||
|
||||
The generic advice is repeated here:
|
||||
|
||||
#. Use `fsleep()` whenever unsure (as it combines all the advantages of the
|
||||
others)
|
||||
#. Use `*sleep()` whenever possible
|
||||
#. Use `usleep_range*()` whenever accuracy of `*sleep()` is not sufficient
|
||||
|
||||
First check fsleep() function description and to learn more about accuracy,
|
||||
please check msleep() function description.
|
||||
|
||||
|
||||
`usleep_range*()`
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. kernel-doc:: include/linux/delay.h
|
||||
:identifiers: usleep_range usleep_range_idle
|
||||
|
||||
.. kernel-doc:: kernel/time/sleep_timeout.c
|
||||
:identifiers: usleep_range_state
|
||||
|
||||
|
||||
`*sleep()`
|
||||
~~~~~~~~~~
|
||||
|
||||
.. kernel-doc:: kernel/time/sleep_timeout.c
|
||||
:identifiers: msleep msleep_interruptible
|
||||
|
||||
.. kernel-doc:: include/linux/delay.h
|
||||
:identifiers: ssleep fsleep
|
||||
@@ -12,7 +12,7 @@ Timers
|
||||
hrtimers
|
||||
no_hz
|
||||
timekeeping
|
||||
timers-howto
|
||||
delay_sleep_functions
|
||||
|
||||
.. only:: subproject and html
|
||||
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
===================================================================
|
||||
delays - Information on the various kernel delay / sleep mechanisms
|
||||
===================================================================
|
||||
|
||||
This document seeks to answer the common question: "What is the
|
||||
RightWay (TM) to insert a delay?"
|
||||
|
||||
This question is most often faced by driver writers who have to
|
||||
deal with hardware delays and who may not be the most intimately
|
||||
familiar with the inner workings of the Linux Kernel.
|
||||
|
||||
|
||||
Inserting Delays
|
||||
----------------
|
||||
|
||||
The first, and most important, question you need to ask is "Is my
|
||||
code in an atomic context?" This should be followed closely by "Does
|
||||
it really need to delay in atomic context?" If so...
|
||||
|
||||
ATOMIC CONTEXT:
|
||||
You must use the `*delay` family of functions. These
|
||||
functions use the jiffy estimation of clock speed
|
||||
and will busy wait for enough loop cycles to achieve
|
||||
the desired delay:
|
||||
|
||||
ndelay(unsigned long nsecs)
|
||||
udelay(unsigned long usecs)
|
||||
mdelay(unsigned long msecs)
|
||||
|
||||
udelay is the generally preferred API; ndelay-level
|
||||
precision may not actually exist on many non-PC devices.
|
||||
|
||||
mdelay is macro wrapper around udelay, to account for
|
||||
possible overflow when passing large arguments to udelay.
|
||||
In general, use of mdelay is discouraged and code should
|
||||
be refactored to allow for the use of msleep.
|
||||
|
||||
NON-ATOMIC CONTEXT:
|
||||
You should use the `*sleep[_range]` family of functions.
|
||||
There are a few more options here, while any of them may
|
||||
work correctly, using the "right" sleep function will
|
||||
help the scheduler, power management, and just make your
|
||||
driver better :)
|
||||
|
||||
-- Backed by busy-wait loop:
|
||||
|
||||
udelay(unsigned long usecs)
|
||||
|
||||
-- Backed by hrtimers:
|
||||
|
||||
usleep_range(unsigned long min, unsigned long max)
|
||||
|
||||
-- Backed by jiffies / legacy_timers
|
||||
|
||||
msleep(unsigned long msecs)
|
||||
msleep_interruptible(unsigned long msecs)
|
||||
|
||||
Unlike the `*delay` family, the underlying mechanism
|
||||
driving each of these calls varies, thus there are
|
||||
quirks you should be aware of.
|
||||
|
||||
|
||||
SLEEPING FOR "A FEW" USECS ( < ~10us? ):
|
||||
* Use udelay
|
||||
|
||||
- Why not usleep?
|
||||
On slower systems, (embedded, OR perhaps a speed-
|
||||
stepped PC!) the overhead of setting up the hrtimers
|
||||
for usleep *may* not be worth it. Such an evaluation
|
||||
will obviously depend on your specific situation, but
|
||||
it is something to be aware of.
|
||||
|
||||
SLEEPING FOR ~USECS OR SMALL MSECS ( 10us - 20ms):
|
||||
* Use usleep_range
|
||||
|
||||
- Why not msleep for (1ms - 20ms)?
|
||||
Explained originally here:
|
||||
https://lore.kernel.org/r/15327.1186166232@lwn.net
|
||||
|
||||
msleep(1~20) may not do what the caller intends, and
|
||||
will often sleep longer (~20 ms actual sleep for any
|
||||
value given in the 1~20ms range). In many cases this
|
||||
is not the desired behavior.
|
||||
|
||||
- Why is there no "usleep" / What is a good range?
|
||||
Since usleep_range is built on top of hrtimers, the
|
||||
wakeup will be very precise (ish), thus a simple
|
||||
usleep function would likely introduce a large number
|
||||
of undesired interrupts.
|
||||
|
||||
With the introduction of a range, the scheduler is
|
||||
free to coalesce your wakeup with any other wakeup
|
||||
that may have happened for other reasons, or at the
|
||||
worst case, fire an interrupt for your upper bound.
|
||||
|
||||
The larger a range you supply, the greater a chance
|
||||
that you will not trigger an interrupt; this should
|
||||
be balanced with what is an acceptable upper bound on
|
||||
delay / performance for your specific code path. Exact
|
||||
tolerances here are very situation specific, thus it
|
||||
is left to the caller to determine a reasonable range.
|
||||
|
||||
SLEEPING FOR LARGER MSECS ( 10ms+ )
|
||||
* Use msleep or possibly msleep_interruptible
|
||||
|
||||
- What's the difference?
|
||||
msleep sets the current task to TASK_UNINTERRUPTIBLE
|
||||
whereas msleep_interruptible sets the current task to
|
||||
TASK_INTERRUPTIBLE before scheduling the sleep. In
|
||||
short, the difference is whether the sleep can be ended
|
||||
early by a signal. In general, just use msleep unless
|
||||
you know you have a need for the interruptible variant.
|
||||
|
||||
FLEXIBLE SLEEPING (any delay, uninterruptible)
|
||||
* Use fsleep
|
||||
@@ -1998,7 +1998,7 @@ F: Documentation/devicetree/bindings/mmc/owl-mmc.yaml
|
||||
F: Documentation/devicetree/bindings/net/actions,owl-emac.yaml
|
||||
F: Documentation/devicetree/bindings/pinctrl/actions,*
|
||||
F: Documentation/devicetree/bindings/power/actions,owl-sps.txt
|
||||
F: Documentation/devicetree/bindings/timer/actions,owl-timer.txt
|
||||
F: Documentation/devicetree/bindings/timer/actions,owl-timer.yaml
|
||||
F: arch/arm/boot/dts/actions/
|
||||
F: arch/arm/mach-actions/
|
||||
F: arch/arm64/boot/dts/actions/
|
||||
@@ -10138,10 +10138,12 @@ S: Maintained
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core
|
||||
F: Documentation/timers/
|
||||
F: include/linux/clockchips.h
|
||||
F: include/linux/delay.h
|
||||
F: include/linux/hrtimer.h
|
||||
F: include/linux/timer.h
|
||||
F: kernel/time/clockevents.c
|
||||
F: kernel/time/hrtimer.c
|
||||
F: kernel/time/sleep_timeout.c
|
||||
F: kernel/time/timer.c
|
||||
F: kernel/time/timer_list.c
|
||||
F: kernel/time/timer_migration.*
|
||||
|
||||
@@ -93,7 +93,6 @@ static void twd_timer_stop(void)
|
||||
{
|
||||
struct clock_event_device *clk = raw_cpu_ptr(twd_evt);
|
||||
|
||||
twd_shutdown(clk);
|
||||
disable_percpu_irq(clk->irq);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
if RALINK
|
||||
|
||||
config CLKEVT_RT3352
|
||||
bool
|
||||
depends on SOC_RT305X || SOC_MT7620
|
||||
default y
|
||||
select TIMER_OF
|
||||
select CLKSRC_MMIO
|
||||
|
||||
config RALINK_ILL_ACC
|
||||
bool
|
||||
depends on SOC_RT305X
|
||||
|
||||
@@ -10,8 +10,6 @@ ifndef CONFIG_MIPS_GIC
|
||||
obj-y += clk.o timer.o
|
||||
endif
|
||||
|
||||
obj-$(CONFIG_CLKEVT_RT3352) += cevt-rt3352.o
|
||||
|
||||
obj-$(CONFIG_RALINK_ILL_ACC) += ill_acc.o
|
||||
|
||||
obj-$(CONFIG_IRQ_INTC) += irq.o
|
||||
|
||||
@@ -1390,21 +1390,14 @@ bool __ref rtas_busy_delay(int status)
|
||||
*/
|
||||
ms = clamp(ms, 1U, 1000U);
|
||||
/*
|
||||
* The delay hint is an order-of-magnitude suggestion, not
|
||||
* a minimum. It is fine, possibly even advantageous, for
|
||||
* us to pause for less time than hinted. For small values,
|
||||
* use usleep_range() to ensure we don't sleep much longer
|
||||
* than actually needed.
|
||||
*
|
||||
* See Documentation/timers/timers-howto.rst for
|
||||
* explanation of the threshold used here. In effect we use
|
||||
* usleep_range() for 9900 and 9901, msleep() for
|
||||
* 9902-9905.
|
||||
* The delay hint is an order-of-magnitude suggestion, not a
|
||||
* minimum. It is fine, possibly even advantageous, for us to
|
||||
* pause for less time than hinted. To make sure pause time will
|
||||
* not be way longer than requested independent of HZ
|
||||
* configuration, use fsleep(). See fsleep() for details of
|
||||
* used sleeping functions.
|
||||
*/
|
||||
if (ms <= 20)
|
||||
usleep_range(ms * 100, ms * 1000);
|
||||
else
|
||||
msleep(ms);
|
||||
fsleep(ms * 1000);
|
||||
break;
|
||||
case RTAS_BUSY:
|
||||
ret = true;
|
||||
|
||||
@@ -302,7 +302,6 @@ CONFIG_DEBUG_MEMORY_INIT=y
|
||||
CONFIG_DEBUG_PER_CPU_MAPS=y
|
||||
CONFIG_SOFTLOCKUP_DETECTOR=y
|
||||
CONFIG_WQ_WATCHDOG=y
|
||||
CONFIG_DEBUG_TIMEKEEPING=y
|
||||
CONFIG_DEBUG_RT_MUTEXES=y
|
||||
CONFIG_DEBUG_SPINLOCK=y
|
||||
CONFIG_DEBUG_MUTEXES=y
|
||||
|
||||
@@ -146,7 +146,6 @@ config X86
|
||||
select ARCH_HAS_PARANOID_L1D_FLUSH
|
||||
select BUILDTIME_TABLE_SORT
|
||||
select CLKEVT_I8253
|
||||
select CLOCKSOURCE_VALIDATE_LAST_CYCLE
|
||||
select CLOCKSOURCE_WATCHDOG
|
||||
# Word-size accesses may read uninitialized data past the trailing \0
|
||||
# in strings and cause false KMSAN reports.
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/math64.h>
|
||||
|
||||
#define TICK_SIZE (tick_nsec / 1000)
|
||||
|
||||
unsigned long long native_sched_clock(void);
|
||||
extern void recalibrate_cpu_khz(void);
|
||||
|
||||
|
||||
@@ -263,13 +263,6 @@ static void kvm_xen_stop_timer(struct kvm_vcpu *vcpu)
|
||||
atomic_set(&vcpu->arch.xen.timer_pending, 0);
|
||||
}
|
||||
|
||||
static void kvm_xen_init_timer(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
hrtimer_init(&vcpu->arch.xen.timer, CLOCK_MONOTONIC,
|
||||
HRTIMER_MODE_ABS_HARD);
|
||||
vcpu->arch.xen.timer.function = xen_timer_callback;
|
||||
}
|
||||
|
||||
static void kvm_xen_update_runstate_guest(struct kvm_vcpu *v, bool atomic)
|
||||
{
|
||||
struct kvm_vcpu_xen *vx = &v->arch.xen;
|
||||
@@ -1070,9 +1063,6 @@ int kvm_xen_vcpu_set_attr(struct kvm_vcpu *vcpu, struct kvm_xen_vcpu_attr *data)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!vcpu->arch.xen.timer.function)
|
||||
kvm_xen_init_timer(vcpu);
|
||||
|
||||
/* Stop the timer (if it's running) before changing the vector */
|
||||
kvm_xen_stop_timer(vcpu);
|
||||
vcpu->arch.xen.timer_virq = data->u.timer.port;
|
||||
@@ -2235,6 +2225,8 @@ void kvm_xen_init_vcpu(struct kvm_vcpu *vcpu)
|
||||
vcpu->arch.xen.poll_evtchn = 0;
|
||||
|
||||
timer_setup(&vcpu->arch.xen.poll_timer, cancel_evtchn_poll, 0);
|
||||
hrtimer_init(&vcpu->arch.xen.timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_HARD);
|
||||
vcpu->arch.xen.timer.function = xen_timer_callback;
|
||||
|
||||
kvm_gpc_init(&vcpu->arch.xen.runstate_cache, vcpu->kvm);
|
||||
kvm_gpc_init(&vcpu->arch.xen.runstate2_cache, vcpu->kvm);
|
||||
|
||||
@@ -400,7 +400,8 @@ config ARM_GT_INITIAL_PRESCALER_VAL
|
||||
This affects CPU_FREQ max delta from the initial frequency.
|
||||
|
||||
config ARM_TIMER_SP804
|
||||
bool "Support for Dual Timer SP804 module" if COMPILE_TEST
|
||||
bool "Support for Dual Timer SP804 module"
|
||||
depends on ARM || ARM64 || COMPILE_TEST
|
||||
depends on GENERIC_SCHED_CLOCK && HAVE_CLK
|
||||
select CLKSRC_MMIO
|
||||
select TIMER_OF if OF
|
||||
@@ -753,4 +754,13 @@ config EP93XX_TIMER
|
||||
Enables support for the Cirrus Logic timer block
|
||||
EP93XX.
|
||||
|
||||
config RALINK_TIMER
|
||||
bool "Ralink System Tick Counter"
|
||||
depends on SOC_RT305X || SOC_MT7620 || COMPILE_TEST
|
||||
select CLKSRC_MMIO
|
||||
select TIMER_OF
|
||||
help
|
||||
Enables support for system tick counter present on
|
||||
Ralink SoCs RT3352 and MT7620.
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -91,3 +91,4 @@ obj-$(CONFIG_GOLDFISH_TIMER) += timer-goldfish.o
|
||||
obj-$(CONFIG_GXP_TIMER) += timer-gxp.o
|
||||
obj-$(CONFIG_CLKSRC_LOONGSON1_PWM) += timer-loongson1-pwm.o
|
||||
obj-$(CONFIG_EP93XX_TIMER) += timer-ep93xx.o
|
||||
obj-$(CONFIG_RALINK_TIMER) += timer-ralink.o
|
||||
|
||||
@@ -1179,8 +1179,6 @@ static void arch_timer_stop(struct clock_event_device *clk)
|
||||
disable_percpu_irq(arch_timer_ppi[arch_timer_uses_ppi]);
|
||||
if (arch_timer_has_nonsecure_ppi())
|
||||
disable_percpu_irq(arch_timer_ppi[ARCH_TIMER_PHYS_NONSECURE_PPI]);
|
||||
|
||||
clk->set_state_shutdown(clk);
|
||||
}
|
||||
|
||||
static int arch_timer_dying_cpu(unsigned int cpu)
|
||||
@@ -1430,7 +1428,7 @@ static int __init arch_timer_of_init(struct device_node *np)
|
||||
|
||||
arch_timers_present |= ARCH_TIMER_TYPE_CP15;
|
||||
|
||||
has_names = of_property_read_bool(np, "interrupt-names");
|
||||
has_names = of_property_present(np, "interrupt-names");
|
||||
|
||||
for (i = ARCH_TIMER_PHYS_SECURE_PPI; i < ARCH_TIMER_MAX_TIMER_PPI; i++) {
|
||||
if (has_names)
|
||||
|
||||
@@ -195,7 +195,6 @@ static int gt_dying_cpu(unsigned int cpu)
|
||||
{
|
||||
struct clock_event_device *clk = this_cpu_ptr(gt_evt);
|
||||
|
||||
gt_clockevent_shutdown(clk);
|
||||
disable_percpu_irq(clk->irq);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -68,25 +68,6 @@ static inline void apbt_writel_relaxed(struct dw_apb_timer *timer, u32 val,
|
||||
writel_relaxed(val, timer->base + offs);
|
||||
}
|
||||
|
||||
static void apbt_disable_int(struct dw_apb_timer *timer)
|
||||
{
|
||||
u32 ctrl = apbt_readl(timer, APBTMR_N_CONTROL);
|
||||
|
||||
ctrl |= APBTMR_CONTROL_INT;
|
||||
apbt_writel(timer, ctrl, APBTMR_N_CONTROL);
|
||||
}
|
||||
|
||||
/**
|
||||
* dw_apb_clockevent_pause() - stop the clock_event_device from running
|
||||
*
|
||||
* @dw_ced: The APB clock to stop generating events.
|
||||
*/
|
||||
void dw_apb_clockevent_pause(struct dw_apb_clock_event_device *dw_ced)
|
||||
{
|
||||
disable_irq(dw_ced->timer.irq);
|
||||
apbt_disable_int(&dw_ced->timer);
|
||||
}
|
||||
|
||||
static void apbt_eoi(struct dw_apb_timer *timer)
|
||||
{
|
||||
apbt_readl_relaxed(timer, APBTMR_N_EOI);
|
||||
@@ -284,26 +265,6 @@ dw_apb_clockevent_init(int cpu, const char *name, unsigned rating,
|
||||
return dw_ced;
|
||||
}
|
||||
|
||||
/**
|
||||
* dw_apb_clockevent_resume() - resume a clock that has been paused.
|
||||
*
|
||||
* @dw_ced: The APB clock to resume.
|
||||
*/
|
||||
void dw_apb_clockevent_resume(struct dw_apb_clock_event_device *dw_ced)
|
||||
{
|
||||
enable_irq(dw_ced->timer.irq);
|
||||
}
|
||||
|
||||
/**
|
||||
* dw_apb_clockevent_stop() - stop the clock_event_device and release the IRQ.
|
||||
*
|
||||
* @dw_ced: The APB clock to stop generating the events.
|
||||
*/
|
||||
void dw_apb_clockevent_stop(struct dw_apb_clock_event_device *dw_ced)
|
||||
{
|
||||
free_irq(dw_ced->timer.irq, &dw_ced->ced);
|
||||
}
|
||||
|
||||
/**
|
||||
* dw_apb_clockevent_register() - register the clock with the generic layer
|
||||
*
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user