Commit 0a1d4434 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'timers-core-2022-12-10' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

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

  Core:

   - The timer_shutdown[_sync]() infrastructure:

     Tearing down timers can be tedious when there are circular
     dependencies to other things which need to be torn down. A prime
     example is timer and workqueue where the timer schedules work and
     the work arms the timer.

     What needs to prevented is that pending work which is drained via
     destroy_workqueue() does not rearm the previously shutdown timer.
     Nothing in that shutdown sequence relies on the timer being
     functional.

     The conclusion was that the semantics of timer_shutdown_sync()
     should be:
	- timer is not enqueued
    	- timer callback is not running
    	- timer cannot be rearmed

     Preventing the rearming of shutdown timers is done by discarding
     rearm attempts silently.

     A warning for the case that a rearm attempt of a shutdown timer is
     detected would not be really helpful because it's entirely unclear
     how it should be acted upon. The only way to address such a case is
     to add 'if (in_shutdown)' conditionals all over the place. This is
     error prone and in most cases of teardown not required all.

   - The real fix for the bluetooth HCI teardown based on
     timer_shutdown_sync().

     A larger scale conversion to timer_shutdown_sync() is work in
     progress.

   - Consolidation of VDSO time namespace helper functions

   - Small fixes for timer and timerqueue

  Drivers:

   - Prevent integer overflow on the XGene-1 TVAL register which causes
     an never ending interrupt storm.

   - The usual set of new device tree bindings

   - Small fixes and improvements all over the place"

* tag 'timers-core-2022-12-10' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (34 commits)
  dt-bindings: timer: renesas,cmt: Add r8a779g0 CMT support
  dt-bindings: timer: renesas,tmu: Add r8a779g0 support
  clocksource/drivers/arm_arch_timer: Use kstrtobool() instead of strtobool()
  clocksource/drivers/timer-ti-dm: Fix missing clk_disable_unprepare in dmtimer_systimer_init_clock()
  clocksource/drivers/timer-ti-dm: Clear settings on probe and free
  clocksource/drivers/timer-ti-dm: Make timer_get_irq static
  clocksource/drivers/timer-ti-dm: Fix warning for omap_timer_match
  clocksource/drivers/arm_arch_timer: Fix XGene-1 TVAL register math error
  clocksource/drivers/timer-npcm7xx: Enable timer 1 clock before use
  dt-bindings: timer: nuvoton,npcm7xx-timer: Allow specifying all clocks
  dt-bindings: timer: rockchip: Add rockchip,rk3128-timer
  clockevents: Repair kernel-doc for clockevent_delta2ns()
  clocksource/drivers/ingenic-ost: Define pm functions properly in platform_driver struct
  clocksource/drivers/sh_cmt: Access registers according to spec
  vdso/timens: Refactor copy-pasted find_timens_vvar_page() helper into one copy
  Bluetooth: hci_qca: Fix the teardown problem for real
  timers: Update the documentation to reflect on the new timer_shutdown() API
  timers: Provide timer_shutdown[_sync]()
  timers: Add shutdown mechanism to the internal functions
  timers: Split [try_to_]del_timer[_sync]() to prepare for shutdown mode
  ...
parents 79ad8912 18a20784
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1858,7 +1858,7 @@ unloaded. After a given module has been unloaded, any attempt to call
one of its functions results in a segmentation fault. The module-unload
functions must therefore cancel any delayed calls to loadable-module
functions, for example, any outstanding mod_timer() must be dealt
with via del_timer_sync() or similar.
with via timer_shutdown_sync() or similar.

Unfortunately, there is no way to cancel an RCU callback; once you
invoke call_rcu(), the callback function is eventually going to be
+1 −1
Original line number Diff line number Diff line
@@ -191,7 +191,7 @@ Here is a sample module which implements a basic per cpu counter using

    static void __exit test_exit(void)
    {
            del_timer_sync(&test_timer);
            timer_shutdown_sync(&test_timer);
    }

    module_init(test_init);
+7 −1
Original line number Diff line number Diff line
@@ -25,7 +25,13 @@ properties:
      - description: The timer interrupt of timer 0

  clocks:
    maxItems: 1
    items:
      - description: The reference clock for timer 0
      - description: The reference clock for timer 1
      - description: The reference clock for timer 2
      - description: The reference clock for timer 3
      - description: The reference clock for timer 4
    minItems: 1

required:
  - compatible
+2 −0
Original line number Diff line number Diff line
@@ -102,12 +102,14 @@ properties:
          - enum:
              - renesas,r8a779a0-cmt0     # 32-bit CMT0 on R-Car V3U
              - renesas,r8a779f0-cmt0     # 32-bit CMT0 on R-Car S4-8
              - renesas,r8a779g0-cmt0     # 32-bit CMT0 on R-Car V4H
          - const: renesas,rcar-gen4-cmt0 # 32-bit CMT0 on R-Car Gen4

      - items:
          - enum:
              - renesas,r8a779a0-cmt1     # 48-bit CMT on R-Car V3U
              - renesas,r8a779f0-cmt1     # 48-bit CMT on R-Car S4-8
              - renesas,r8a779g0-cmt1     # 48-bit CMT on R-Car V4H
          - const: renesas,rcar-gen4-cmt1 # 48-bit CMT on R-Car Gen4

  reg:
+1 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ properties:
          - renesas,tmu-r8a77995 # R-Car D3
          - renesas,tmu-r8a779a0 # R-Car V3U
          - renesas,tmu-r8a779f0 # R-Car S4-8
          - renesas,tmu-r8a779g0 # R-Car V4H
      - const: renesas,tmu

  reg:
Loading