Skip to content

Commit 9ea925c

Browse files
committed
Merge tag 'timers-core-2024-09-16' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer updates from Thomas Gleixner: "Core: - Overhaul of posix-timers in preparation of removing the workaround for periodic timers which have signal delivery ignored. - Remove the historical extra jiffie in msleep() msleep() adds an extra jiffie to the timeout value to ensure minimal sleep time. The timer wheel ensures minimal sleep time since the large rewrite to a non-cascading wheel, but the extra jiffie in msleep() remained unnoticed. Remove it. - Make the timer slack handling correct for realtime tasks. The procfs interface is inconsistent and does neither reflect reality nor conforms to the man page. Show the correct 0 slack for real time tasks and enforce it at the core level instead of having inconsistent individual checks in various timer setup functions. - The usual set of updates and enhancements all over the place. Drivers: - Allow the ACPI PM timer to be turned off during suspend - No new drivers - The usual updates and enhancements in various drivers" * tag 'timers-core-2024-09-16' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (43 commits) ntp: Make sure RTC is synchronized when time goes backwards treewide: Fix wrong singular form of jiffies in comments cpu: Use already existing usleep_range() timers: Rename next_expiry_recalc() to be unique platform/x86:intel/pmc: Fix comment for the pmc_core_acpi_pm_timer_suspend_resume function clocksource/drivers/jcore: Use request_percpu_irq() clocksource/drivers/cadence-ttc: Add missing clk_disable_unprepare in ttc_setup_clockevent clocksource/drivers/asm9260: Add missing clk_disable_unprepare in asm9260_timer_init clocksource/drivers/qcom: Add missing iounmap() on errors in msm_dt_timer_init() clocksource/drivers/ingenic: Use devm_clk_get_enabled() helpers platform/x86:intel/pmc: Enable the ACPI PM Timer to be turned off when suspended clocksource: acpi_pm: Add external callback for suspend/resume clocksource/drivers/arm_arch_timer: Using for_each_available_child_of_node_scoped() dt-bindings: timer: rockchip: Add rk3576 compatible timers: Annotate possible non critical data race of next_expiry timers: Remove historical extra jiffie for timeout in msleep() hrtimer: Use and report correct timerslack values for realtime tasks hrtimer: Annotate hrtimer_cpu_base_.*_expiry() for sparse. timers: Add sparse annotation for timer_sync_wait_running(). signal: Replace BUG_ON()s ...
2 parents cb69d86 + 35b603f commit 9ea925c

File tree

58 files changed

+848
-377
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+848
-377
lines changed

Documentation/admin-guide/media/vivid.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ and an HDMI input, one input for each input type. Those are described in more
328328
detail below.
329329

330330
Special attention has been given to the rate at which new frames become
331-
available. The jitter will be around 1 jiffie (that depends on the HZ
331+
available. The jitter will be around 1 jiffy (that depends on the HZ
332332
configuration of your kernel, so usually 1/100, 1/250 or 1/1000 of a second),
333333
but the long-term behavior is exactly following the framerate. So a
334334
framerate of 59.94 Hz is really different from 60 Hz. If the framerate

Documentation/devicetree/bindings/timer/rockchip,rk-timer.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ properties:
2424
- rockchip,rk3228-timer
2525
- rockchip,rk3229-timer
2626
- rockchip,rk3368-timer
27+
- rockchip,rk3576-timer
2728
- rockchip,rk3588-timer
2829
- rockchip,px30-timer
2930
- const: rockchip,rk3288-timer

Documentation/timers/timers-howto.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ it really need to delay in atomic context?" If so...
1919

2020
ATOMIC CONTEXT:
2121
You must use the `*delay` family of functions. These
22-
functions use the jiffie estimation of clock speed
22+
functions use the jiffy estimation of clock speed
2323
and will busy wait for enough loop cycles to achieve
2424
the desired delay:
2525

Documentation/translations/sp_SP/scheduler/sched-design-CFS.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ para que se ejecute, y la tarea en ejecución es interrumpida.
109109
==================================
110110

111111
CFS usa una granularidad de nanosegundos y no depende de ningún
112-
jiffie o detalles como HZ. De este modo, el gestor de tareas CFS no tiene
112+
jiffy o detalles como HZ. De este modo, el gestor de tareas CFS no tiene
113113
noción de "ventanas de tiempo" de la forma en que tenía el gestor de
114114
tareas previo, y tampoco tiene heurísticos. Únicamente hay un parámetro
115115
central ajustable (se ha de cambiar en CONFIG_SCHED_DEBUG):

arch/arm/mach-versatile/spc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373

7474
/*
7575
* Even though the SPC takes max 3-5 ms to complete any OPP/COMMS
76-
* operation, the operation could start just before jiffie is about
76+
* operation, the operation could start just before jiffy is about
7777
* to be incremented. So setting timeout value of 20ms = 2jiffies@100Hz
7878
*/
7979
#define TIMEOUT_US 20000

arch/m68k/q40/q40ints.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void __init q40_init_IRQ(void)
106106
* this stuff doesn't really belong here..
107107
*/
108108

109-
int ql_ticks; /* 200Hz ticks since last jiffie */
109+
int ql_ticks; /* 200Hz ticks since last jiffy */
110110
static int sound_ticks;
111111

112112
#define SVOL 45

arch/x86/kernel/cpu/mce/dev-mcelog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ static ssize_t mce_chrdev_write(struct file *filp, const char __user *ubuf,
314314

315315
/*
316316
* Need to give user space some time to set everything up,
317-
* so do it a jiffie or two later everywhere.
317+
* so do it a jiffy or two later everywhere.
318318
*/
319319
schedule_timeout(2);
320320

drivers/char/ipmi/ipmi_ssif.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,7 @@ static void msg_written_handler(struct ssif_info *ssif_info, int result,
980980
ipmi_ssif_unlock_cond(ssif_info, flags);
981981
start_get(ssif_info);
982982
} else {
983-
/* Wait a jiffie then request the next message */
983+
/* Wait a jiffy then request the next message */
984984
ssif_info->waiting_alert = true;
985985
ssif_info->retries_left = SSIF_RECV_RETRIES;
986986
if (!ssif_info->stopping)

drivers/clocksource/acpi_pm.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
#include <asm/io.h>
2626
#include <asm/time.h>
2727

28+
static void *suspend_resume_cb_data;
29+
30+
static void (*suspend_resume_callback)(void *data, bool suspend);
31+
2832
/*
2933
* The I/O port the PMTMR resides at.
3034
* The location is detected during setup_arch(),
@@ -58,6 +62,32 @@ u32 acpi_pm_read_verified(void)
5862
return v2;
5963
}
6064

65+
void acpi_pmtmr_register_suspend_resume_callback(void (*cb)(void *data, bool suspend), void *data)
66+
{
67+
suspend_resume_callback = cb;
68+
suspend_resume_cb_data = data;
69+
}
70+
EXPORT_SYMBOL_GPL(acpi_pmtmr_register_suspend_resume_callback);
71+
72+
void acpi_pmtmr_unregister_suspend_resume_callback(void)
73+
{
74+
suspend_resume_callback = NULL;
75+
suspend_resume_cb_data = NULL;
76+
}
77+
EXPORT_SYMBOL_GPL(acpi_pmtmr_unregister_suspend_resume_callback);
78+
79+
static void acpi_pm_suspend(struct clocksource *cs)
80+
{
81+
if (suspend_resume_callback)
82+
suspend_resume_callback(suspend_resume_cb_data, true);
83+
}
84+
85+
static void acpi_pm_resume(struct clocksource *cs)
86+
{
87+
if (suspend_resume_callback)
88+
suspend_resume_callback(suspend_resume_cb_data, false);
89+
}
90+
6191
static u64 acpi_pm_read(struct clocksource *cs)
6292
{
6393
return (u64)read_pmtmr();
@@ -69,6 +99,8 @@ static struct clocksource clocksource_acpi_pm = {
6999
.read = acpi_pm_read,
70100
.mask = (u64)ACPI_PM_MASK,
71101
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
102+
.suspend = acpi_pm_suspend,
103+
.resume = acpi_pm_resume,
72104
};
73105

74106

drivers/clocksource/arm_arch_timer.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,7 +1594,6 @@ static int __init arch_timer_mem_of_init(struct device_node *np)
15941594
{
15951595
struct arch_timer_mem *timer_mem;
15961596
struct arch_timer_mem_frame *frame;
1597-
struct device_node *frame_node;
15981597
struct resource res;
15991598
int ret = -EINVAL;
16001599
u32 rate;
@@ -1608,33 +1607,29 @@ static int __init arch_timer_mem_of_init(struct device_node *np)
16081607
timer_mem->cntctlbase = res.start;
16091608
timer_mem->size = resource_size(&res);
16101609

1611-
for_each_available_child_of_node(np, frame_node) {
1610+
for_each_available_child_of_node_scoped(np, frame_node) {
16121611
u32 n;
16131612
struct arch_timer_mem_frame *frame;
16141613

16151614
if (of_property_read_u32(frame_node, "frame-number", &n)) {
16161615
pr_err(FW_BUG "Missing frame-number.\n");
1617-
of_node_put(frame_node);
16181616
goto out;
16191617
}
16201618
if (n >= ARCH_TIMER_MEM_MAX_FRAMES) {
16211619
pr_err(FW_BUG "Wrong frame-number, only 0-%u are permitted.\n",
16221620
ARCH_TIMER_MEM_MAX_FRAMES - 1);
1623-
of_node_put(frame_node);
16241621
goto out;
16251622
}
16261623
frame = &timer_mem->frame[n];
16271624

16281625
if (frame->valid) {
16291626
pr_err(FW_BUG "Duplicated frame-number.\n");
1630-
of_node_put(frame_node);
16311627
goto out;
16321628
}
16331629

1634-
if (of_address_to_resource(frame_node, 0, &res)) {
1635-
of_node_put(frame_node);
1630+
if (of_address_to_resource(frame_node, 0, &res))
16361631
goto out;
1637-
}
1632+
16381633
frame->cntbase = res.start;
16391634
frame->size = resource_size(&res);
16401635

0 commit comments

Comments
 (0)