timer_shutdown_sync() function is useful for final teardown of an infrastructure where the timer is subject to a circular dependency problem.
A common pattern for this is a timer and a workqueue where the timer can schedule work and work can arm the timer. On shutdown the workqueue must be destroyed and the timer must be prevented from rearming. Unless the code has conditionals like 'if (mything->in_shutdown)' to prevent that there is no way to get this correct with timer_delete_sync().
timer_shutdown_sync() is solving the problem. The correct ordering of calls in this case is:
timer_shutdown_sync(&mything->timer); workqueue_destroy(&mything->workqueue);
After this 'mything' can be safely freed.
Steven Rostedt (Google) (4): ARM: spear: Do not use timer namespace for timer_shutdown() function clocksource/drivers/arm_arch_timer: Do not use timer namespace for timer_shutdown() function clocksource/drivers/sp804: Do not use timer namespace for timer_shutdown() function timers: Update the documentation to reflect on the new timer_shutdown() API
Thomas Gleixner (12): Documentation: Remove bogus claim about del_timer_sync() timers: Get rid of del_singleshot_timer_sync() timers: Replace BUG_ON()s timers: Update kernel-doc for various functions timers: Use del_timer_sync() even on UP timers: Rename del_timer_sync() to timer_delete_sync() timers: Rename del_timer() to timer_delete() Documentation: Replace del_timer/del_timer_sync() timers: Silently ignore timers with a NULL function timers: Split [try_to_]del_timer[_sync]() to prepare for shutdown mode timers: Add shutdown mechanism to the internal functions timers: Provide timer_shutdown[_sync]()
Yu Liao (1): timers: Keep del_timer[_sync]() exported
.../RCU/Design/Requirements/Requirements.rst | 2 +- Documentation/core-api/local_ops.rst | 2 +- Documentation/kernel-hacking/locking.rst | 17 +- Documentation/timers/hrtimers.rst | 2 +- .../it_IT/kernel-hacking/locking.rst | 14 +- .../translations/zh_CN/core-api/local_ops.rst | 196 ++++++++ arch/arm/mach-spear/time.c | 8 +- drivers/char/tpm/tpm-dev-common.c | 4 +- drivers/clocksource/arm_arch_timer.c | 12 +- drivers/clocksource/timer-sp804.c | 6 +- drivers/misc/sgi-xp/xpc_partition.c | 2 +- drivers/staging/wlan-ng/hfa384x_usb.c | 4 +- drivers/staging/wlan-ng/prism2usb.c | 6 +- include/linux/timer.h | 15 +- kernel/time/timer.c | 449 ++++++++++++++---- net/sunrpc/xprt.c | 2 +- 16 files changed, 597 insertions(+), 144 deletions(-) create mode 100644 Documentation/translations/zh_CN/core-api/local_ops.rst