Commit 4fd94356 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'timers-core-2024-07-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull timer updates from Thomas Gleixner:
 "Updates for timers, timekeeping and related functionality:

  Core:

   - Make the takeover of a hrtimer based broadcast timer reliable
     during CPU hot-unplug. The current implementation suffers from a
     race which can lead to broadcast timer starvation in the worst
     case.

   - VDSO related cleanups and simplifications

   - Small cleanups and enhancements all over the place

  PTP:

   - Replace the architecture specific base clock to clocksource, e.g.
     ART to TSC, conversion function with generic functionality to avoid
     exposing such internals to drivers and convert all existing drivers
     over. This also allows to provide functionality which converts the
     other way round in the core code based on the same parameter set.

   - Provide a function to convert CLOCK_REALTIME to the base clock to
     support the upcoming PPS output driver on Intel platforms.

  Drivers:

   - A set of Device Tree bindings for new hardware

   - Cleanups and enhancements all over the place"

* tag 'timers-core-2024-07-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (30 commits)
  clocksource/drivers/realtek: Add timer driver for rtl-otto platforms
  dt-bindings: timer: Add schema for realtek,otto-timer
  dt-bindings: timer: Add SOPHGO SG2002 clint
  dt-bindings: timer: renesas,tmu: Add R-Car Gen2 support
  dt-bindings: timer: renesas,tmu: Add RZ/G1 support
  dt-bindings: timer: renesas,tmu: Add R-Mobile APE6 support
  clocksource/drivers/mips-gic-timer: Correct sched_clock width
  clocksource/drivers/mips-gic-timer: Refine rating computation
  clocksource/drivers/sh_cmt: Address race condition for clock events
  clocksource/driver/arm_global_timer: Remove unnecessary ‘0’ values from err
  clocksource/drivers/arm_arch_timer: Remove unnecessary ‘0’ values from irq
  tick/broadcast: Make takeover of broadcast hrtimer reliable
  tick/sched: Combine WARN_ON_ONCE and print_once
  x86/vdso: Remove unused include
  x86/vgtod: Remove unused typedef gtod_long_t
  x86/vdso: Fix function reference in comment
  vdso: Add comment about reason for vdso struct ordering
  vdso/gettimeofday: Clarify comment about open coded function
  timekeeping: Add missing kernel-doc function comments
  tick: Remove unnused tick_nohz_get_idle_calls()
  ...
parents 0eff0491 b7625d67
Loading
Loading
Loading
Loading
+63 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/timer/realtek,otto-timer.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Realtek Otto SoCs Timer/Counter

description:
  Realtek SoCs support a number of timers/counters. These are used
  as a per CPU clock event generator and an overall CPU clocksource.

maintainers:
  - Chris Packham <chris.packham@alliedtelesis.co.nz>

properties:
  $nodename:
    pattern: "^timer@[0-9a-f]+$"

  compatible:
    items:
      - enum:
          - realtek,rtl9302-timer
      - const: realtek,otto-timer

  reg:
    items:
      - description: timer0 registers
      - description: timer1 registers
      - description: timer2 registers
      - description: timer3 registers
      - description: timer4 registers

  clocks:
    maxItems: 1

  interrupts:
    items:
      - description: timer0 interrupt
      - description: timer1 interrupt
      - description: timer2 interrupt
      - description: timer3 interrupt
      - description: timer4 interrupt

required:
  - compatible
  - reg
  - clocks
  - interrupts

additionalProperties: false

examples:
  - |
    timer@3200 {
      compatible = "realtek,rtl9302-timer", "realtek,otto-timer";
      reg = <0x3200 0x10>, <0x3210 0x10>, <0x3220 0x10>,
            <0x3230 0x10>, <0x3240 0x10>;

      interrupt-parent = <&intc>;
      interrupts = <7>, <8>, <9>, <10>, <11>;
      clocks = <&lx_clk>;
    };
+12 −0
Original line number Diff line number Diff line
@@ -21,13 +21,24 @@ properties:
  compatible:
    items:
      - enum:
          - renesas,tmu-r8a73a4  # R-Mobile APE6
          - renesas,tmu-r8a7740  # R-Mobile A1
          - renesas,tmu-r8a7742  # RZ/G1H
          - renesas,tmu-r8a7743  # RZ/G1M
          - renesas,tmu-r8a7744  # RZ/G1N
          - renesas,tmu-r8a7745  # RZ/G1E
          - renesas,tmu-r8a77470 # RZ/G1C
          - renesas,tmu-r8a774a1 # RZ/G2M
          - renesas,tmu-r8a774b1 # RZ/G2N
          - renesas,tmu-r8a774c0 # RZ/G2E
          - renesas,tmu-r8a774e1 # RZ/G2H
          - renesas,tmu-r8a7778  # R-Car M1A
          - renesas,tmu-r8a7779  # R-Car H1
          - renesas,tmu-r8a7790  # R-Car H2
          - renesas,tmu-r8a7791  # R-Car M2-W
          - renesas,tmu-r8a7792  # R-Car V2H
          - renesas,tmu-r8a7793  # R-Car M2-N
          - renesas,tmu-r8a7794  # R-Car E2
          - renesas,tmu-r8a7795  # R-Car H3
          - renesas,tmu-r8a7796  # R-Car M3-W
          - renesas,tmu-r8a77961 # R-Car M3-W+
@@ -94,6 +105,7 @@ if:
      compatible:
        contains:
          enum:
            - renesas,tmu-r8a73a4
            - renesas,tmu-r8a7740
            - renesas,tmu-r8a7778
            - renesas,tmu-r8a7779
+1 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ properties:
              - allwinner,sun20i-d1-clint
              - sophgo,cv1800b-clint
              - sophgo,cv1812h-clint
              - sophgo,sg2002-clint
              - thead,th1520-clint
          - const: thead,c900-clint
      - items:
+0 −3
Original line number Diff line number Diff line
@@ -28,9 +28,6 @@ static inline cycles_t get_cycles(void)
}
#define get_cycles get_cycles

extern struct system_counterval_t convert_art_to_tsc(u64 art);
extern struct system_counterval_t convert_art_ns_to_tsc(u64 art_ns);

extern void tsc_early_init(void);
extern void tsc_init(void);
extern void mark_tsc_unstable(char *reason);
+2 −3
Original line number Diff line number Diff line
@@ -328,9 +328,8 @@ static __always_inline u64 vdso_calc_ns(const struct vdso_data *vd, u64 cycles,
	 * due to unsigned comparison.
	 *
	 * Due to the MSB/Sign-bit being used as invalid marker (see
	 * arch_vdso_cycles_valid() above), the effective mask is S64_MAX,
	 * but that case is also unlikely and will also take the unlikely path
	 * here.
	 * arch_vdso_cycles_ok() above), the effective mask is S64_MAX, but that
	 * case is also unlikely and will also take the unlikely path here.
	 */
	if (unlikely(delta > vd->max_cycles)) {
		/*
Loading