!1744 [sync] PR-1727: add support for timer_shutdown() api
Merge Pull Request from: @openeuler-sync-bot Origin pull request: https://gitee.com/openeuler/kernel/pulls/1727 PR sync from: Yu Liao <liaoyu15@huawei.com> https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/N7DVTGONEIVDI2GITMMBE6T4J2YVA4WH/ 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) (3): 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 Thomas Gleixner (10): 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() timers: Silently ignore timers with a NULL function timers: Add shutdown mechanism to the internal functions timers: Provide timer_shutdown[_sync]() Yu Liao (2): sw64: Do not use timer namespace for timer_shutdown() function timers: Keep del_timer[_sync]() exported -- 2.25.1 https://gitee.com/openeuler/kernel/issues/I7R8WG Link:https://gitee.com/openeuler/kernel/pulls/1744 Reviewed-by: Xiongfeng Wang <wangxiongfeng2@huawei.com> Signed-off-by: Jialin Zhang <zhangjialin11@huawei.com>
Showing
此差异已折叠。
想要评论请 注册 或 登录