From patchwork Fri Nov 4 05:40:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15351 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp190781wru; Thu, 3 Nov 2022 22:51:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Y2AY8o0jkq1TX97jXzhZdJAJBSa/n1xbsHnJhaA45IYfQY7Qn5DJP3stxatwrafZwjtCb X-Received: by 2002:a05:6402:5406:b0:452:1560:f9d4 with SMTP id ev6-20020a056402540600b004521560f9d4mr34293386edb.333.1667541063507; Thu, 03 Nov 2022 22:51:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541063; cv=none; d=google.com; s=arc-20160816; b=eFoyiVS5bsl8PrLOZ7iiyGDpJfDXA0JUx6vpWG7Gm4mdxwiqQ0vIlCoJ/7MlIddBP5 JqM7OEeekhqeftTf+67ikX3Yilte1e5icmG71AebiE8SIrP0wq5a8MVw3P4MHNl5Jh0O q4zIhL7lP+K4IgSut4iXjY094DsJu+97tHH6EB9PoalScV+WQHAlJSLgfuByjDzbchD6 Y7z9XYo8NENHenz+xkbV5RKGIKdGIKVAhgOKq4c7Je6hPa9gqM/mYxiQ4kxFJc7Xsy7X 5wh8u0uX6spHJdpi482cjOKkbceHrmjfzfSf4gli+SrJPOGsx0V532O8y77T+cvxYy38 /YVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=WAqDd1tnAJTJYasjPPgY+hLtSrFpMoqsJLCfHN23Hro=; b=Zd/DMiToH8DAZg0Tq4XXqW+Fbdb/GAoDaX3zZgsukYvSXbQay6qbzAAKUoUJfv2APP JzZPjnVWwZvih0l4WgCo4qtMWaDtzl1Hv9PJH9qLTfR96XK6Ta8glY2ZT2HZ5F+oYWc3 vWmkExzNGndxzqx8/Eg42kE2GNeg2VhzAh85qQVmuMbUfCdWa7dLwnboUAopYmg4qyVJ +ULnBtDRihtIrPokxMHfA1tZGOMsFOnFYdI5HVdmhy619meD3gD8INa0isK62tSRpP50 HICcszrtjTDSgMWNs6L3+qZxp+u9QrQfd2cQ0WTwdo+yHKJhcxU6O0YF4Lsri6Ize+Om xv9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v8-20020a170906b00800b007add5af39f6si2316922ejy.929.2022.11.03.22.50.40; Thu, 03 Nov 2022 22:51:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231688AbiKDFt6 (ORCPT + 99 others); Fri, 4 Nov 2022 01:49:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231328AbiKDFs4 (ORCPT ); Fri, 4 Nov 2022 01:48:56 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F4E3248D8 for ; Thu, 3 Nov 2022 22:48:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id B994ECE29CF for ; Fri, 4 Nov 2022 05:48:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AFE5CC433C1; Fri, 4 Nov 2022 05:48:45 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZo-0070yN-0j; Fri, 04 Nov 2022 01:49:12 -0400 Message-ID: <20221104054912.063301453@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:40:54 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton Subject: [RFC][PATCH v3 01/33] timers: Add timer_shutdown_sync() and timer_shutdown() to be called before freeing timers References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543538219193254?= X-GMAIL-MSGID: =?utf-8?q?1748543538219193254?= From: "Steven Rostedt (Google)" We are hitting a common bug were a timer is being triggered after it is freed. This causes a corruption in the timer link list and crashes the kernel. Unfortunately it is not easy to know what timer it was that was freed. Looking at the code, it appears that there are several cases that del_timer() is used when del_timer_sync() should have been. Add a timer_shutdown_sync() that not only does a del_timer_sync() but will mark the timer as terminated in case it gets rearmed, it will trigger a WARN_ON. The timer_shutdown_sync() is more likely to be used by developers that are about to free a timer, then using del_timer_sync() as the latter is not as obvious to being needed for freeing. Having the word "shutdown" in the name of the function will hopefully help developers know that that function needs to be called before freeing. The added bonus is the marking of the timer as being freed such that it will trigger a warning if it gets rearmed. At least that way if the system crashes on a freed timer, at least we may see which timer it was that was freed. There's some situations that already know that the timer is shutdown and does not need to perform the synchronization (or can not due to its context). For these locations there's timer_shutdown() that only shuts down the timer (prevents it from being rearmed) but does not add checks if the timer is currently running. This code is taken from Thomas Gleixner's "untested" version from my original patch and modified after testing and with some other comments from Linus addressed. As well as some extra comments added. Link: https://lore.kernel.org/all/87pmlrkgi3.ffs@tglx/ Signed-off-by: Steven Rostedt (Google) --- .../RCU/Design/Requirements/Requirements.rst | 2 +- Documentation/core-api/local_ops.rst | 2 +- Documentation/kernel-hacking/locking.rst | 5 ++ include/linux/timer.h | 64 +++++++++++++++++-- kernel/time/timer.c | 64 ++++++++++--------- 5 files changed, 98 insertions(+), 39 deletions(-) diff --git a/Documentation/RCU/Design/Requirements/Requirements.rst b/Documentation/RCU/Design/Requirements/Requirements.rst index a0f8164c8513..ec6de88846b9 100644 --- a/Documentation/RCU/Design/Requirements/Requirements.rst +++ b/Documentation/RCU/Design/Requirements/Requirements.rst @@ -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(). Unfortunately, there is no way to cancel an RCU callback; once you invoke call_rcu(), the callback function is eventually going to be diff --git a/Documentation/core-api/local_ops.rst b/Documentation/core-api/local_ops.rst index 2ac3f9f29845..0b42ceaaf3c4 100644 --- a/Documentation/core-api/local_ops.rst +++ b/Documentation/core-api/local_ops.rst @@ -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); diff --git a/Documentation/kernel-hacking/locking.rst b/Documentation/kernel-hacking/locking.rst index 6805ae6e86e6..eb341b69fd15 100644 --- a/Documentation/kernel-hacking/locking.rst +++ b/Documentation/kernel-hacking/locking.rst @@ -1009,6 +1009,11 @@ use del_timer_sync() (``include/linux/timer.h``) to handle this case. It returns the number of times the timer had to be deleted before we finally stopped it from adding itself back in. +Before freeing a timer, timer_shutdown() or timer_shutdown_sync() should be +called which will keep it from being rearmed, although if it is rearmed, it +will produce a warning. + + Locking Speed ============= diff --git a/include/linux/timer.h b/include/linux/timer.h index 648f00105f58..0758b447afd7 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -168,12 +168,45 @@ static inline int timer_pending(const struct timer_list * timer) return !hlist_unhashed_lockless(&timer->entry); } +extern int __del_timer(struct timer_list * timer, bool free); + extern void add_timer_on(struct timer_list *timer, int cpu); -extern int del_timer(struct timer_list * timer); extern int mod_timer(struct timer_list *timer, unsigned long expires); extern int mod_timer_pending(struct timer_list *timer, unsigned long expires); extern int timer_reduce(struct timer_list *timer, unsigned long expires); +/** + * del_timer - deactivate a timer. + * @timer: the timer to be deactivated + * + * del_timer() deactivates a timer - this works on both active and inactive + * timers. + * + * The function returns whether it has deactivated a pending timer or not. + * (ie. del_timer() of an inactive timer returns 0, del_timer() of an + * active timer returns 1.) + */ +static inline int del_timer(struct timer_list *timer) +{ + return __del_timer(timer, false); +} + +/** + * timer_shutdown - deactivate a timer and shut it down + * @timer: the timer to be deactivated + * + * timer_shutdown() deactivates a timer - this works on both active + * and inactive timers, and will prevent it from being rearmed. + * + * The function returns whether it has deactivated a pending timer or not. + * (ie. timer_shutdown() of an inactive timer returns 0, + * timer_shutdown() of an active timer returns 1.) + */ +static inline int timer_shutdown(struct timer_list *timer) +{ + return __del_timer(timer, true); +} + /* * The jiffies value which is added to now, when there is no timer * in the timer wheel: @@ -183,14 +216,31 @@ extern int timer_reduce(struct timer_list *timer, unsigned long expires); extern void add_timer(struct timer_list *timer); extern int try_to_del_timer_sync(struct timer_list *timer); +extern int __del_timer_sync(struct timer_list *timer, bool free); -#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT) - extern int del_timer_sync(struct timer_list *timer); -#else -# define del_timer_sync(t) del_timer(t) -#endif +static inline int del_timer_sync(struct timer_list *timer) +{ + return __del_timer_sync(timer, false); +} + +/** + * timer_shutdown_sync - called before freeing the timer + * @timer: The timer to be freed + * + * Shutdown the timer before freeing. This will return when all pending timers + * have finished and it is safe to free the timer. + * + * Note, after calling this, if the timer is added back to the queue + * it will fail to be added and a WARNING will be triggered. + * + * Returns if it deactivated a pending timer or not. + */ +static inline int timer_shutdown_sync(struct timer_list *timer) +{ + return __del_timer_sync(timer, true); +} -#define del_singleshot_timer_sync(t) del_timer_sync(t) +#define del_singleshot_timer_sync(t) timer_shutdown_sync(t) extern void init_timers(void); struct hrtimer; diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 717fcb9fb14a..7c224766065e 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1017,7 +1017,8 @@ __mod_timer(struct timer_list *timer, unsigned long expires, unsigned int option unsigned int idx = UINT_MAX; int ret = 0; - BUG_ON(!timer->function); + if (WARN_ON_ONCE(!timer->function)) + return -EINVAL; /* * This is a common optimization triggered by the networking code - if @@ -1193,7 +1194,8 @@ EXPORT_SYMBOL(timer_reduce); */ void add_timer(struct timer_list *timer) { - BUG_ON(timer_pending(timer)); + if (WARN_ON_ONCE(timer_pending(timer))) + return; __mod_timer(timer, timer->expires, MOD_TIMER_NOTPENDING); } EXPORT_SYMBOL(add_timer); @@ -1210,7 +1212,8 @@ void add_timer_on(struct timer_list *timer, int cpu) struct timer_base *new_base, *base; unsigned long flags; - BUG_ON(timer_pending(timer) || !timer->function); + if (WARN_ON_ONCE(timer_pending(timer) || !timer->function)) + return; new_base = get_timer_cpu_base(timer->flags, cpu); @@ -1237,18 +1240,7 @@ void add_timer_on(struct timer_list *timer, int cpu) } EXPORT_SYMBOL_GPL(add_timer_on); -/** - * del_timer - deactivate a timer. - * @timer: the timer to be deactivated - * - * del_timer() deactivates a timer - this works on both active and inactive - * timers. - * - * The function returns whether it has deactivated a pending timer or not. - * (ie. del_timer() of an inactive timer returns 0, del_timer() of an - * active timer returns 1.) - */ -int del_timer(struct timer_list *timer) +int __del_timer(struct timer_list *timer, bool free) { struct timer_base *base; unsigned long flags; @@ -1259,21 +1251,20 @@ int del_timer(struct timer_list *timer) if (timer_pending(timer)) { base = lock_timer_base(timer, &flags); ret = detach_if_pending(timer, base, true); + if (free) + timer->function = NULL; + raw_spin_unlock_irqrestore(&base->lock, flags); + } else if (free) { + base = lock_timer_base(timer, &flags); + timer->function = NULL; raw_spin_unlock_irqrestore(&base->lock, flags); } return ret; } -EXPORT_SYMBOL(del_timer); +EXPORT_SYMBOL(__del_timer); -/** - * try_to_del_timer_sync - Try to deactivate a timer - * @timer: timer to delete - * - * This function tries to deactivate a timer. Upon successful (ret >= 0) - * exit the timer is not queued and the handler is not running on any CPU. - */ -int try_to_del_timer_sync(struct timer_list *timer) +static int __try_to_del_timer_sync(struct timer_list *timer, bool free) { struct timer_base *base; unsigned long flags; @@ -1285,11 +1276,25 @@ int try_to_del_timer_sync(struct timer_list *timer) if (base->running_timer != timer) ret = detach_if_pending(timer, base, true); + if (free) + timer->function = NULL; raw_spin_unlock_irqrestore(&base->lock, flags); return ret; } + +/** + * try_to_del_timer_sync - Try to deactivate a timer + * @timer: timer to delete + * + * This function tries to deactivate a timer. Upon successful (ret >= 0) + * exit the timer is not queued and the handler is not running on any CPU. + */ +int try_to_del_timer_sync(struct timer_list *timer) +{ + return __try_to_del_timer_sync(timer, false); +} EXPORT_SYMBOL(try_to_del_timer_sync); #ifdef CONFIG_PREEMPT_RT @@ -1365,10 +1370,10 @@ static inline void timer_sync_wait_running(struct timer_base *base) { } static inline void del_timer_wait_running(struct timer_list *timer) { } #endif -#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT) /** - * del_timer_sync - deactivate a timer and wait for the handler to finish. + * __del_timer_sync - deactivate a timer and wait for the handler to finish. * @timer: the timer to be deactivated + * @free: Set to true if the timer is about to be freed * * This function only differs from del_timer() on SMP: besides deactivating * the timer it also makes sure the handler has finished executing on other @@ -1402,7 +1407,7 @@ static inline void del_timer_wait_running(struct timer_list *timer) { } * * The function returns whether it has deactivated a pending timer or not. */ -int del_timer_sync(struct timer_list *timer) +int __del_timer_sync(struct timer_list *timer, bool free) { int ret; @@ -1432,7 +1437,7 @@ int del_timer_sync(struct timer_list *timer) lockdep_assert_preemption_enabled(); do { - ret = try_to_del_timer_sync(timer); + ret = __try_to_del_timer_sync(timer, free); if (unlikely(ret < 0)) { del_timer_wait_running(timer); @@ -1442,8 +1447,7 @@ int del_timer_sync(struct timer_list *timer) return ret; } -EXPORT_SYMBOL(del_timer_sync); -#endif +EXPORT_SYMBOL(__del_timer_sync); static void call_timer_fn(struct timer_list *timer, void (*fn)(struct timer_list *), From patchwork Fri Nov 4 05:40:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15340 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp190241wru; Thu, 3 Nov 2022 22:49:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7jsGGGzDamwmyJSAdK/hpxVBqvgU2wYEVQN+9aXuavVi1YFbvAudoxpY44/JTnCHag4bEo X-Received: by 2002:a17:907:75cc:b0:7ad:b9b7:582b with SMTP id jl12-20020a17090775cc00b007adb9b7582bmr29810435ejc.150.1667540961403; Thu, 03 Nov 2022 22:49:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667540961; cv=none; d=google.com; s=arc-20160816; b=JtChp4IjPM1f9tS83atMMHn7ufpzHudYtnYiVVmA9w5TS6RKTeXGUuT8GFco6iX24s My8rjcRBcz2qqA4SJF3mxdkx8FWXqw3bGZcnBVE+C9V+1/skJHfIJBN2FaJ2fZekLSMt ELiYck+Pv+YDCiWimmL2Hrpmmen/ak3tGfOEgo0ykfNCBbFcHHkj3UsnXNjWj8A2dKLx umVoyOb0XSYrLD5F/8YY4PqlDdnO72QpLRW1dDIWv+m8crXlVqUldt3KDBGVduzlI3hx wGvFCr4FUuJi+NrgmhOeTAc5im9I1FakVh4EwKXVYK+DGXAKT8yyHnO8cDHh4+2f5Mea XlKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=9xDb1QSYwFLsPXeaWgCIXwyS/owh5fuZlYingDK/6zk=; b=fWLziKvth/eGRofdzPhwFxHbwPok3rAcOqfoSdQof307yX2xe79LbhwoxbY8lTRVog KjaYs1qk/WpZLZZWDN/cqWZ2SOHMgQmaTBYjrncmN0w8idmv16eM1GhTwP1skU4Oa10b q1yst97jeWvjGPvpiUSkj2rS66ZWHW//PZCtbf9xW2A9AvtTlHl/y1HL15aAWdrNRRMP r4aCuzhkWJ1EyCp3ZnCO/SqA9jVEkZ8AmLiokX5k8dCe16gik1g6iUbkttjGLXsGC/3K EyHOqpusHSz0LER673Zr67/6FzGHAQ6OG4xfg5TLRyMTSlLSj7uUlV2r2vF31iKWPO7I lPZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id go44-20020a1709070dac00b007830f14fffesi4824924ejc.375.2022.11.03.22.48.58; Thu, 03 Nov 2022 22:49:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231297AbiKDFsx (ORCPT + 99 others); Fri, 4 Nov 2022 01:48:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229900AbiKDFst (ORCPT ); Fri, 4 Nov 2022 01:48:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C81F28E03; Thu, 3 Nov 2022 22:48:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 83B4C620B6; Fri, 4 Nov 2022 05:48:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4B57C433D7; Fri, 4 Nov 2022 05:48:45 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZo-0070yv-1J; Fri, 04 Nov 2022 01:49:12 -0400 Message-ID: <20221104054912.243707160@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:40:55 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , linux-s390@vger.kernel.org Subject: [RFC][PATCH v3 02/33] timers: s390/cmm: Use timer_shutdown_sync() before freeing timer References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543431389040567?= X-GMAIL-MSGID: =?utf-8?q?1748543431389040567?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Alexander Gordeev Cc: Christian Borntraeger Cc: Sven Schnelle Cc: linux-s390@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- arch/s390/mm/cmm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c index 9141ed4c52e9..1a0a8aa43ac6 100644 --- a/arch/s390/mm/cmm.c +++ b/arch/s390/mm/cmm.c @@ -419,7 +419,7 @@ static int __init cmm_init(void) #endif unregister_sysctl_table(cmm_sysctl_header); out_sysctl: - del_timer_sync(&cmm_timer); + timer_shutdown_sync(&cmm_timer); return rc; } module_init(cmm_init); @@ -432,7 +432,7 @@ static void __exit cmm_exit(void) #endif unregister_oom_notifier(&cmm_oom_nb); kthread_stop(cmm_thread_ptr); - del_timer_sync(&cmm_timer); + timer_shutdown_sync(&cmm_timer); cmm_free_pages(cmm_pages, &cmm_pages, &cmm_page_list); cmm_free_pages(cmm_timed_pages, &cmm_timed_pages, &cmm_timed_page_list); } From patchwork Fri Nov 4 05:40:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15345 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp190554wru; Thu, 3 Nov 2022 22:50:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4TyVh5DQe1GzkkvGwiR1pPkDr+AVBgQDu8k2bcMa+SLQH3eAiQyuRA1G0JefRCtv4N4tet X-Received: by 2002:a17:907:86a0:b0:78d:df8b:4d17 with SMTP id qa32-20020a17090786a000b0078ddf8b4d17mr31947480ejc.254.1667541022594; Thu, 03 Nov 2022 22:50:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541022; cv=none; d=google.com; s=arc-20160816; b=zBIcoCLk8Swy/6fQTVKyB0Do9PzLDAHyyv9RPsdmMw3LxQO2k70Aoh7+8TqsiAo8pm VS1pQzcisANQh6qiz8HvQj3EVxdVbBAXrQv6Jbn2QQKJo4bqaqqaVGAgl1JYLazhOPlz c6H7sQvRVUIn/MU1MS0/p47PNPH+b+2Ce40pccq7QNH5tJCfuFouDDM96rnPHGnm39gn YWnPAcKcLvQEns+sCHy7uSqyPYoKa8sCJFeDB7Ffk+2YNBGUIoWoS7zgWB1YLAS5fUKO bBH8mzQA0X21fg7TNoOVpscPGWx2Sk1Du0XhKKEkFzHvGfE8s0X12LKFZ8attdpNcdX8 oT9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=7jJrdDnAvXHvXaTRMv9XL/MWovLHnGjFUg7NapSOAcE=; b=hrzdMsIMjCy7D2InaYHHFeww1pEv0/QeFTZO5PIM+XOVgMptGDrFZm/+B8fx2qOkIi DXJY+vCng4Jvi7GaUwaunzrBFgQhrpov8RiUGuuoHlMWF3g6/l968yYYureGb8MQJIVl AVPbGQJYJO85zKu7+JpRmdzH0INjjd5OX165bBCzmzFRptEF24t5pbCGVllfmXi0tFHD N/xygufuexGNtSoGVOvNl5EgpvP+mi+yhzFew3Exha9LM3Lr+9JoDWeckKBQPqFogOp1 LGvvtgeeIYrONVbvRfflGq12UP9WI306PSWT9rwQtHKWISBWZMeR7fS6vr6Ys7d5uJzc kIEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b3-20020a170906728300b007a44a13536bsi3628860ejl.243.2022.11.03.22.49.58; Thu, 03 Nov 2022 22:50:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231485AbiKDFtS (ORCPT + 99 others); Fri, 4 Nov 2022 01:49:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230358AbiKDFsu (ORCPT ); Fri, 4 Nov 2022 01:48:50 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24F343898; Thu, 3 Nov 2022 22:48:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A9B6FB82BFB; Fri, 4 Nov 2022 05:48:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60619C43141; Fri, 4 Nov 2022 05:48:46 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZo-0070zT-1v; Fri, 04 Nov 2022 01:49:12 -0400 Message-ID: <20221104054912.425376037@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:40:56 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org Subject: [RFC][PATCH v3 03/33] timers: sh: Use timer_shutdown_sync() before freeing timer References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543495170493424?= X-GMAIL-MSGID: =?utf-8?q?1748543495170493424?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- arch/sh/drivers/push-switch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sh/drivers/push-switch.c b/arch/sh/drivers/push-switch.c index 2813140fd92b..c95f48ff3f6f 100644 --- a/arch/sh/drivers/push-switch.c +++ b/arch/sh/drivers/push-switch.c @@ -102,7 +102,7 @@ static int switch_drv_remove(struct platform_device *pdev) platform_set_drvdata(pdev, NULL); flush_work(&psw->work); - del_timer_sync(&psw->debounce); + timer_shutdown_sync(&psw->debounce); free_irq(irq, pdev); kfree(psw); From patchwork Fri Nov 4 05:40:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15344 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp190484wru; Thu, 3 Nov 2022 22:50:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7FJoEfeTB+mUlm106boe52etYHGt1X/a3Rtox9f0LdWNgfy7tFNNGR5YGH7LbzrRL9G+Y9 X-Received: by 2002:a17:906:6791:b0:78d:4051:969f with SMTP id q17-20020a170906679100b0078d4051969fmr32454134ejp.171.1667541009328; Thu, 03 Nov 2022 22:50:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541009; cv=none; d=google.com; s=arc-20160816; b=t7ViaOh+IRv0iPAYgkXbe5HlLpvYFa/LWFHS/yiZW3fgCQaG85zXD8srzULxVR/m20 qL4c7MaB6vVh0R351tfpvduzJDJJ7tsACiLNAOMhEgNBioDHywUtSsWYksHzXwa4Rk/U t/nVrnDTEy/3MUlIpqBGAkrJJDb/9q/zUeGpsZYqPbpZeSMcWahPBzsX3tL4GQx4yePm wNDeT4lw+bJchdk8gPHX/8x0JLhy8VL3i5S5HoG71VPaFB/D/nfBirQcuVs4xOZJbkbY JmilbAvdfIFX1wUDITbE7FUYZEMROoCw3UM3npm0zDSrT9HCfCI3p3CpkeuDR5m/KL6p IxyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=h2ZHrt4hTRLVW6Yb4ZW9O+a68dF57JAjmnvDogNfl0k=; b=Snnt3s4SnLHWUBg3v9cakshIV9lHTuIf8SM4Vun40Gc7MtTy9+T2Fco7i+7ItrkjJx 4HRoi3gUfrtZWV242S6XUXoKi/ZjrLtjgawCghncqofd5pOVQ1JWhAG85SG+0R4QWe3a OMzA6YRgjFv9pMXIM9hxuogITg4QHlXNaw1lsxoN44dBKsRarEqviTe4hUDDj225ghC8 PaR6VajMRUhkwdHrNgXlk2DSx1hRG0UfBj5EqCN1fuaMJdWta7mPYDBVIViMFBowqaP+ 7f76ODgZfvsh1qrwg2ZQ++Cw81yiHIVLJ12YMVvNnuyUqsp2CwL/dNDF8jVlGvtrXhhu xPUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id et19-20020a170907295300b0078dad659776si2717156ejc.320.2022.11.03.22.49.45; Thu, 03 Nov 2022 22:50:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231447AbiKDFtJ (ORCPT + 99 others); Fri, 4 Nov 2022 01:49:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231205AbiKDFsu (ORCPT ); Fri, 4 Nov 2022 01:48:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E393728E0C; Thu, 3 Nov 2022 22:48:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 21462620B2; Fri, 4 Nov 2022 05:48:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7AF3DC43144; Fri, 4 Nov 2022 05:48:46 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZo-00710Z-37; Fri, 04 Nov 2022 01:49:12 -0400 Message-ID: <20221104054912.802343429@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:40:58 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , "Rafael J. Wysocki" , Len Brown , James Morse , Tony Luck , Borislav Petkov , Shuai Xue , Dave Hansen , Jarkko Sakkinen , linux-acpi@vger.kernel.org Subject: [RFC][PATCH v3 05/33] timers: ACPI: Use timer_shutdown_sync() before freeing timer References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543481294404208?= X-GMAIL-MSGID: =?utf-8?q?1748543481294404208?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: James Morse Cc: Tony Luck Cc: Borislav Petkov Cc: Shuai Xue Cc: Dave Hansen Cc: Jarkko Sakkinen Cc: linux-acpi@vger.kernel.org Signed-off-by: Steven Rostedt (Google) Acked-by: Jarkko Sakkinen --- drivers/acpi/apei/ghes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 9952f3a792ba..9a0e41c21cf9 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -1405,7 +1405,7 @@ static int ghes_remove(struct platform_device *ghes_dev) ghes->flags |= GHES_EXITING; switch (generic->notify.type) { case ACPI_HEST_NOTIFY_POLLED: - del_timer_sync(&ghes->timer); + timer_shutdown_sync(&ghes->timer); break; case ACPI_HEST_NOTIFY_EXTERNAL: free_irq(ghes->irq, ghes); From patchwork Fri Nov 4 05:40:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15341 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp190272wru; Thu, 3 Nov 2022 22:49:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5E448DYnufR8geE1UeEV1TvtwY1911p6sTMXuxafqJfnpAMaJqDAKq0wLjjTUA+1vKkLUf X-Received: by 2002:a05:6402:2550:b0:462:38d7:a6e1 with SMTP id l16-20020a056402255000b0046238d7a6e1mr34719866edb.337.1667540968715; Thu, 03 Nov 2022 22:49:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667540968; cv=none; d=google.com; s=arc-20160816; b=RuiIJdXusjEByclBiawcBAqnpzn7vVSlahZCWIKB+iJndPsjftajJ0lFeMOum60fNp cBsNqCpiL8j+VhVeMc5Jc0AX8qpiw8ub1k3c7Gsey0Ov/5WtXKtgHbhpRgIk/Kf8uwts J7lxNdIH7bjYb0T52ddC64K8xKC3b36zj+j0PJbof/7FQvuJajI7+4u66aDq5fDLJODd CitrSUnqLkydkPiwupUWuUliCnbPFgddG/CdJlKZS5yF9bRVkDlmu4qPMspa2Ska0CyL zpIkfqVMOzSZFrPrTTAU54M2fDXgUvwnQNwdjNviqUob4U6YIioyRVD7LHOiDtOdxf83 50HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=5X+ELetg5hrG4mqIze0Q9uNIA1ykHHASDtNfcL7Fod8=; b=Va1g7cG7GRkA3+JNKEc/iKjMddn2xRjciY4yozAxbV5O7CiCKTUV9MfCT5Jd7OV8zM j6O4R/CPC9PalEijmwD/zeBv1gQ40wDst+RFhAHX3D0Afe1S2x9pF4WEV5ouGOwY5IGB Z5CMlZ5rnvO+8qRYEAM9T+ZOwx3NsfN0nI4LsaPuC02DgQkn3Zmh99sKwXjRUbIGnDXK j/9IYFoC+/UHU8+9CVNAAg5Hl04Ghv8ue+iuRhoq+OXvIR018XhgXvBRAotUa2xwb8Yi axWoTvxNSn9FHDGc8dD1bvLtvwvTkltXCxJPwKGt7uxWzktuSl76VgRxK5Ef8tS2oocv 8OVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e13-20020a056402104d00b00461865aae72si3329286edu.219.2022.11.03.22.49.05; Thu, 03 Nov 2022 22:49:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231404AbiKDFs5 (ORCPT + 99 others); Fri, 4 Nov 2022 01:48:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231217AbiKDFsu (ORCPT ); Fri, 4 Nov 2022 01:48:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3A3B28E0D; Thu, 3 Nov 2022 22:48:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 43EC2620BA; Fri, 4 Nov 2022 05:48:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0A69C433D7; Fri, 4 Nov 2022 05:48:46 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZp-007117-0U; Fri, 04 Nov 2022 01:49:13 -0400 Message-ID: <20221104054912.988821248@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:40:59 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Chas Williams <3chas3@gmail.com>, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org Subject: [RFC][PATCH v3 06/33] timers: atm: Use timer_shutdown_sync() before freeing timer References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543438642721642?= X-GMAIL-MSGID: =?utf-8?q?1748543438642721642?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: Chas Williams <3chas3@gmail.com> Cc: linux-atm-general@lists.sourceforge.net Cc: netdev@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- drivers/atm/idt77105.c | 4 ++-- drivers/atm/idt77252.c | 4 ++-- drivers/atm/iphase.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/atm/idt77105.c b/drivers/atm/idt77105.c index bfca7b8a6f31..cc4a5449ca42 100644 --- a/drivers/atm/idt77105.c +++ b/drivers/atm/idt77105.c @@ -366,8 +366,8 @@ EXPORT_SYMBOL(idt77105_init); static void __exit idt77105_exit(void) { /* turn off timers */ - del_timer_sync(&stats_timer); - del_timer_sync(&restart_timer); + timer_shutdown_sync(&stats_timer); + timer_shutdown_sync(&restart_timer); } module_exit(idt77105_exit); diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c index 681cb3786794..99cae174d558 100644 --- a/drivers/atm/idt77252.c +++ b/drivers/atm/idt77252.c @@ -2213,7 +2213,7 @@ idt77252_init_ubr(struct idt77252_dev *card, struct vc_map *vc, } spin_unlock_irqrestore(&vc->lock, flags); if (est) { - del_timer_sync(&est->timer); + timer_shutdown_sync(&est->timer); kfree(est); } @@ -3752,7 +3752,7 @@ static void __exit idt77252_exit(void) card = idt77252_chain; dev = card->atmdev; idt77252_chain = card->next; - del_timer_sync(&card->tst_timer); + timer_shutdown_sync(&card->tst_timer); if (dev->phy->stop) dev->phy->stop(dev); diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index 324148686953..9be45d9d66b3 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c @@ -3280,7 +3280,7 @@ static void __exit ia_module_exit(void) { pci_unregister_driver(&ia_driver); - del_timer_sync(&ia_timer); + timer_shutdown_sync(&ia_timer); } module_init(ia_module_init); From patchwork Fri Nov 4 05:41:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15342 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp190361wru; Thu, 3 Nov 2022 22:49:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4jAzqMM1mjA+tmZBya44VOEqpuLz8SZ3ce5BIsFG5SGlEcPvcPga4XRZ8ujMq/KFdfNZSx X-Received: by 2002:a05:6402:540d:b0:450:bda7:f76e with SMTP id ev13-20020a056402540d00b00450bda7f76emr13023191edb.249.1667540981883; Thu, 03 Nov 2022 22:49:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667540981; cv=none; d=google.com; s=arc-20160816; b=Z35u+xvDWOf7NNwKkoYGI3A4/ORpAgE6TkdO1nAfcBdoB2CINM+rOcWh92Dt1XaAXK ZGS0mQ3G4p8sH06QKv3zNztZNJIYfGlrqaivmab2OcwtpWz4NCXgZM6NFrm+xAZlA8Tv qK2CDEo8hW2CT7ktThso15eERDqpDsqoSkcsjvP8bpehTXtnLTREC1C+WXTDvg8QLYf7 6zGHB7FQxN9XmAvyAmFjmdmv6SmtATQBHILlEZdgdluAdYOBTdVWJsavpwSx14Ut3ujj yyyNQgA058FR3xdD2ppzAh6JpOPrAXmIoKs9XM0m1EKkmfFDnlbzTV5dk0rykZLzPDzH xXbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=nLSfRMliSk5Aj86+A9mtcsqnSpvMsntb7Kgowu9QyKs=; b=wolbepAX410ZYyBJgqrlwsG5ofyjBKLiEX5zAEKgrfdlPdRAkWlFjmQm9HCxwSmsCC kwLU79t4ayY6K4ZJ7vSDOYJCrCmiWRee+9P9jvhvHmePbXuyHApDVIQn9eBqYSgSWfEX l3N6uYSExjIujmfDAAqCEPRzlv9t5PWQSx1u8VThipbjWx3cqlpQIEFZtTX9rgfaTGG1 zH0xqnKAM/ppN+2rK9nNkK0VT6GrnyMrfhBV+cza76UqUblSysoH1IW+VkBRKYUXPHy/ 59TQLEh+TE448GAHbeW3O7dUryOlIZEgh2TIdsmG52qwYNXhQX4AmEio8i1lDlS1RGm3 VEDA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cs15-20020a170906dc8f00b0078e1b6060f7si4597276ejc.299.2022.11.03.22.49.18; Thu, 03 Nov 2022 22:49:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231478AbiKDFtA (ORCPT + 99 others); Fri, 4 Nov 2022 01:49:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230240AbiKDFsu (ORCPT ); Fri, 4 Nov 2022 01:48:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3DE72792C; Thu, 3 Nov 2022 22:48:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 516D1620A7; Fri, 4 Nov 2022 05:48:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4A4DC43149; Fri, 4 Nov 2022 05:48:46 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZp-00711f-16; Fri, 04 Nov 2022 01:49:13 -0400 Message-ID: <20221104054913.171973223@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:00 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , linux-pm@vger.kernel.org Subject: [RFC][PATCH v3 07/33] timers: PM: Use timer_shutdown_sync() References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543452962544929?= X-GMAIL-MSGID: =?utf-8?q?1748543452962544929?= From: "Steven Rostedt (Google)" Instead of open coding making the timer look like it was not registered by setting the function pointer to NULL, call timer_shutdown_sync() that does the same thing. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: Pavel Machek Cc: Greg Kroah-Hartman Cc: linux-pm@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- drivers/base/power/wakeup.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c index 7cc0c0cf8eaa..c6d68bdcac68 100644 --- a/drivers/base/power/wakeup.c +++ b/drivers/base/power/wakeup.c @@ -202,12 +202,7 @@ void wakeup_source_remove(struct wakeup_source *ws) raw_spin_unlock_irqrestore(&events_lock, flags); synchronize_srcu(&wakeup_srcu); - del_timer_sync(&ws->timer); - /* - * Clear timer.function to make wakeup_source_not_registered() treat - * this wakeup source as not registered. - */ - ws->timer.function = NULL; + timer_shutdown_sync(&ws->timer); } EXPORT_SYMBOL_GPL(wakeup_source_remove); From patchwork Fri Nov 4 05:41:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15346 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp190607wru; Thu, 3 Nov 2022 22:50:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4d0cOn5hQEj0h6vm7Ms5iDaFByTEVAcgF1pdittY4CruPrymitNnuNMRMfVbJfr+SOAanR X-Received: by 2002:a17:906:9253:b0:7ae:5a6:22f8 with SMTP id c19-20020a170906925300b007ae05a622f8mr12126911ejx.108.1667541032024; Thu, 03 Nov 2022 22:50:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541032; cv=none; d=google.com; s=arc-20160816; b=u96MHP4SQEsLH6UCtvHNYOZN4yFRhdqEntUqLhU5nZ2I+wsVXGP3Zu0Mw0dzLRPDMW bnWBZS1kfZa3Ns6+OZ3o3Ij9KXEjrZhenyEzEmLSpvKM2oHcI8SdkMaAPsFIgzNt4BVs bLgItkK52yjiLKP7CWeqhzgy1a+1xiJPYD9ffmulchPP+YnVOOmQpDVd7DPBtiAc1LnB ZTivb8ZMB6NEljgBhvDEst6MPyoiDHBvDWNGxPx4/RgfQgIEH4wXJ2uxsufXDDilkW2o GYl8kcO9LU6zCvRdLL915TlDOOR7iCftsGQ3IbVvH9e6tR0ZPxnj+rtBQTYShyEr4wP7 qA1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=DdIcQHc8LLpevj1C4ETSUQALUijstLkYnqMsvSLmdhs=; b=Km/IZ1S7bMsgFHV6HxKjCQt2507hVyuOKtGY0tUT7rV0JZDB/YBgM+EaQ0QxxSd/72 y1Izsz+H4dxE2qk8noOUFtVERjf68NDftqj+5QannCiB2A2qgPGCN9lpdXAEQ3JOmsFm g6VosbWyeYS7agPkK408fRxeeSarIPm4M+KgkbzXhNOJENwqf3oZ6dsxT45x981bzrXe /sELNFNCdY69pmD3log1RftaGCwbPr9i6FP1NuIysWUlLUNk1djaJeMDEey7wDpVKBJT ligNGqSjAVv+/lk7zIvmRr4nTLpsay7h8HV7uS4rA5tD8nnNyZkQ3jJ0pqffS7SGMeww gIGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x14-20020a056402414e00b0045d4f99616dsi3748735eda.456.2022.11.03.22.50.07; Thu, 03 Nov 2022 22:50:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231446AbiKDFt2 (ORCPT + 99 others); Fri, 4 Nov 2022 01:49:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230511AbiKDFsw (ORCPT ); Fri, 4 Nov 2022 01:48:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9706248D8; Thu, 3 Nov 2022 22:48:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BD597620C0; Fri, 4 Nov 2022 05:48:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC804C4314D; Fri, 4 Nov 2022 05:48:46 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZp-00712D-1g; Fri, 04 Nov 2022 01:49:13 -0400 Message-ID: <20221104054913.358784408@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:01 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , linux-bluetooth@vger.kernel.org Subject: [RFC][PATCH v3 08/33] timers: Bluetooth: Use timer_shutdown_sync() before freeing timer References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543505210646271?= X-GMAIL-MSGID: =?utf-8?q?1748543505210646271?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: Marcel Holtmann Cc: Johan Hedberg Cc: Luiz Augusto von Dentz Cc: linux-bluetooth@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- drivers/bluetooth/hci_bcsp.c | 2 +- drivers/bluetooth/hci_h5.c | 2 +- drivers/bluetooth/hci_qca.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c index cf4a56095817..834b2efaa9bf 100644 --- a/drivers/bluetooth/hci_bcsp.c +++ b/drivers/bluetooth/hci_bcsp.c @@ -737,7 +737,7 @@ static int bcsp_close(struct hci_uart *hu) { struct bcsp_struct *bcsp = hu->priv; - del_timer_sync(&bcsp->tbcsp); + timer_shutdown_sync(&bcsp->tbcsp); hu->priv = NULL; diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c index c5a0409ef84f..51f93ff5ebe8 100644 --- a/drivers/bluetooth/hci_h5.c +++ b/drivers/bluetooth/hci_h5.c @@ -253,7 +253,7 @@ static int h5_close(struct hci_uart *hu) { struct h5 *h5 = hu->priv; - del_timer_sync(&h5->timer); + timer_shutdown_sync(&h5->timer); skb_queue_purge(&h5->unack); skb_queue_purge(&h5->rel); diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index 8df11016fd51..eb81296b284c 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -697,8 +697,8 @@ static int qca_close(struct hci_uart *hu) skb_queue_purge(&qca->txq); skb_queue_purge(&qca->rx_memdump_q); destroy_workqueue(qca->workqueue); - del_timer_sync(&qca->tx_idle_timer); - del_timer_sync(&qca->wake_retrans_timer); + timer_shutdown_sync(&qca->tx_idle_timer); + timer_shutdown_sync(&qca->wake_retrans_timer); qca->hu = NULL; kfree_skb(qca->rx_skb); From patchwork Fri Nov 4 05:41:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15343 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp190440wru; Thu, 3 Nov 2022 22:49:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5A4fAmA6DERa+2JwjyVTDLNWtZFfutxMKGaCIHKM2dxaSWUt0z1qHjOPkHk5XfTB2KGXjt X-Received: by 2002:a17:906:5a6a:b0:7a6:bad5:8295 with SMTP id my42-20020a1709065a6a00b007a6bad58295mr33092220ejc.647.1667540998518; Thu, 03 Nov 2022 22:49:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667540998; cv=none; d=google.com; s=arc-20160816; b=Bg3619mef/dK8Rz55iFbQ5noSSJ6aV9MXjaxfjRb1V/gJErYuwDz2oZbkNkMRcTG2X 9sUjznRUlKszZRC87cBzNBhrZT2nSWje0Bl7F8SDiQTqgFkTpwo/lfqXW8qj7ASo/bAi dJdq+CpsTNZ5hEZrRsnqV7t1IfUa0ETj46xOLO/v6PXByw0O7DywbUntYZxv+kcY7VR8 AyHkzOm3RHEBTU0YG6WYQqMgtcbY9L+kH8OgkaZrXwZWAIxKA11iuMQhCoVVGTi2M6bd gFD9MyJHvDbcn9y0qvnh5pfmrQqPJjEqpzMsbzZdHOsn6UbWGOjYeghWyphjb1qkSOh5 uKAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=JbGT3K8Rrs2QG8BxZGG/Qm3iNM+xEfzOcbWWMkbPIew=; b=DpSwddgYDHgKJmOYceaqSlwRE9kLfobBt6+mHXL2RXelSnmplujGlVq07l9U8pU8XD Mnu8jdLVO81BuZ2iYORGlKhtUH6qj2bxAstwjUdKFVugPzTx1PZbTA/BaOzUkS1nbaoK st5pC6muH/X264cmrEqE7H0HgVaV03Q3xgkyOkpGNH7t9xPIarYIwBoTZeK84shTtVT9 WdvdMj4gtzn6AtP+D9g5XyXThVJYMkgszS7atGKqTd0rXAHMHx3yCkbHxgl8pMjTcdS7 ETZg/P3IaMn7qc3IAn1XU07cfEo64b786e0RIimbJk6c2DVGB2fc+yO3A2FHWt9mUlQX +Ejg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hw19-20020a170907a0d300b007417e9a2c71si3074139ejc.352.2022.11.03.22.49.35; Thu, 03 Nov 2022 22:49:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231555AbiKDFtE (ORCPT + 99 others); Fri, 4 Nov 2022 01:49:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231206AbiKDFsu (ORCPT ); Fri, 4 Nov 2022 01:48:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3F3527B31 for ; Thu, 3 Nov 2022 22:48:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 71EBD620BE for ; Fri, 4 Nov 2022 05:48:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 237FBC43151; Fri, 4 Nov 2022 05:48:47 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZp-00712o-2F; Fri, 04 Nov 2022 01:49:13 -0400 Message-ID: <20221104054913.537193963@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:02 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Arnd Bergmann , Greg Kroah-Hartman Subject: [RFC][PATCH v3 09/33] timers: hangcheck: Use timer_shutdown_sync() before freeing timer References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543469930054612?= X-GMAIL-MSGID: =?utf-8?q?1748543469930054612?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Also fixed some whitespace issues in the line after. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Signed-off-by: Steven Rostedt (Google) --- drivers/char/hangcheck-timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/char/hangcheck-timer.c b/drivers/char/hangcheck-timer.c index 4181bcc1c796..783a86bfca69 100644 --- a/drivers/char/hangcheck-timer.c +++ b/drivers/char/hangcheck-timer.c @@ -167,8 +167,8 @@ static int __init hangcheck_init(void) static void __exit hangcheck_exit(void) { - del_timer_sync(&hangcheck_ticktock); - printk("Hangcheck: Stopped hangcheck timer.\n"); + timer_shutdown_sync(&hangcheck_ticktock); + printk("Hangcheck: Stopped hangcheck timer.\n"); } module_init(hangcheck_init); From patchwork Fri Nov 4 05:41:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15360 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp191144wru; Thu, 3 Nov 2022 22:52:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM77kgXmn4g/FLYaWfIGuRXmm8K+VtdMJB1ZO31n7TOqpnWxg2sqkc/ne5sGGa5+pGvPT/2k X-Received: by 2002:a17:906:c44:b0:7ae:749:1659 with SMTP id t4-20020a1709060c4400b007ae07491659mr11477905ejf.759.1667541131679; Thu, 03 Nov 2022 22:52:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541131; cv=none; d=google.com; s=arc-20160816; b=s1ZvMlYlsE3r4HQOUVSPADuJkdFs+dLYDWRe90FKOf6Chc1HKIR1u/BEe7uRtskama cgqL+Q23QFyWaVwgH/WctfSD9hHkuXXvN38qIqJUfETckhptKKhuEFBoAzVJ0plzR5gi IAsc7PS+lKHjsRhxfGEm3+sIyE1kCpr3ZBNGnYq/yTKL/pf1u67Av4KvxnVsLh514Pgl TAxCfsMnHXIShW/urAJkq4FtyyjqsCbap1L18OdkLE7M6JeDP/bHvdu+JPCLyleAIvGj 68hJ3XK3K3ACHuW+GBxCwOKEbetKbO06BdwH1l/mGDLh7+I4beBmBM7RFLDPO4+A1CP+ e9/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=DdmgUfPeyMg7CytFaflJ94lL126TQ0ZrdI5ezOrhjq8=; b=J88RyIPpstPYj/FKmNL0T5kMTNpqt3cqwg4HQafWdXiZs4gb3B3HF4mg5qwPXbJCCn hUYG8y6obSvXDWJi6lMiWB34CUvkj20Yik2l8UqFBMrIJ8YiWLJ7/QkSkb1DWjOt5fyh 5NvGA4WC5eynJKgeQCoTm6Gwmk+LF+DDepxephjIW7W09MRL5HHE/hSefwFKFv8CkBZz 9UI0MowO3DFARpSFEqmlw5LyoWe63FeqcOct5DK0s6G6iu6DvOViAHGrZzB4K0D/oMjw KPPp9dmss+5dyBCi2IRyV60isRJZvxJUMMHO9KvkfOStI/Ixa8Ex1vw7sD+7V9eVk2E0 l4Sw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cq6-20020a056402220600b004573c1ae3fasi3185044edb.285.2022.11.03.22.51.48; Thu, 03 Nov 2022 22:52:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231636AbiKDFtd (ORCPT + 99 others); Fri, 4 Nov 2022 01:49:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231244AbiKDFsw (ORCPT ); Fri, 4 Nov 2022 01:48:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAE912792B for ; Thu, 3 Nov 2022 22:48:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AA8CF620B7 for ; Fri, 4 Nov 2022 05:48:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86E7CC433B5; Fri, 4 Nov 2022 05:48:47 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZp-00713M-2q; Fri, 04 Nov 2022 01:49:13 -0400 Message-ID: <20221104054913.715976693@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:03 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , openipmi-developer@lists.sourceforge.net, Corey Minyard Subject: [RFC][PATCH v3 10/33] timers: ipmi: Use timer_shutdown_sync() before freeing timer References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543609475916505?= X-GMAIL-MSGID: =?utf-8?q?1748543609475916505?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: openipmi-developer@lists.sourceforge.net Acked-by: Corey Minyard Signed-off-by: Steven Rostedt (Google) --- drivers/char/ipmi/ipmi_msghandler.c | 2 +- drivers/char/ipmi/ipmi_ssif.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index 49a1707693c9..5cfb85e22d65 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c @@ -5540,7 +5540,7 @@ static void __exit cleanup_ipmi(void) * here. */ atomic_set(&stop_operation, 1); - del_timer_sync(&ipmi_timer); + timer_shutdown_sync(&ipmi_timer); initialized = false; diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c index e1072809fe31..5194be6d0639 100644 --- a/drivers/char/ipmi/ipmi_ssif.c +++ b/drivers/char/ipmi/ipmi_ssif.c @@ -1273,8 +1273,8 @@ static void shutdown_ssif(void *send_info) schedule_timeout(1); ssif_info->stopping = true; - del_timer_sync(&ssif_info->watch_timer); - del_timer_sync(&ssif_info->retry_timer); + timer_shutdown_sync(&ssif_info->watch_timer); + timer_shutdown_sync(&ssif_info->retry_timer); if (ssif_info->thread) { complete(&ssif_info->wake_thread); kthread_stop(ssif_info->thread); From patchwork Fri Nov 4 05:41:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15367 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp197122wru; Thu, 3 Nov 2022 23:08:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5yxwDfiVVuVeQsIE+J0ka8EkdHKoxIh7+d01GeOo7oQS0xUb1k8R6LUgTEGYGdKK01oTUn X-Received: by 2002:a17:907:983:b0:77b:6e40:8435 with SMTP id bf3-20020a170907098300b0077b6e408435mr30953606ejc.570.1667542106400; Thu, 03 Nov 2022 23:08:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667542106; cv=none; d=google.com; s=arc-20160816; b=bF/iZ/ZimbfEtuYRAc+JwJJurMM5Skx3r1RkQ9Qhp3wuya3MzGIY0eXtfwf1SNGNRG bJ/Sd4FnFUEv2lqYqFFi76qM+XPlGkO2hsOUs3HpL4mGGafEYxjiTgGtmwXnizG81caR NA5hLBNO0Hx13L5/76Z8FItYDMr0OQjDkpGZAFUSCfi7faQHNVAamc5EXmvoFN0xd7+C qCEAXM6QAqdnZB4AlkljlydtLjk5rUkd0OP2f3bxIV2Z6EnfkFY0F3y6IveIPYM82Pqt L1GHG2bA4x8Gt5ki4GPfUUNmqDh7mNUgQe+qYpcMEc2Lx/7wG05qU5X7QF2wBKGAYxIt zB5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=HmeeiItu2rHGDdMEePJIFms0P6sJvSuYpbtIRN0gSMQ=; b=xIng3oSDPmv8FuvCcb55yPnMTOJOn2o6vQCTr/59Man3qwsDWXqHPRRBwut7TsSuJg ANcD1MEx64U/TefjwzfglrJRkXftSdVeJdWdnw7Jb2fULTB1Ul+ofc0+LA2CUYfs7st8 +OEA0rPbzJQhWOQ+F0Aekae5QlYARvDRy4DoMDnjNBYgx3KGETqDgPRCBJ6kCE8Xzg5F xa8yR7/d5IHaK5jscbXcjB3WAYgbMZGzryehQs98yPWRMD2hXSKfrhYHPf+lvDA0Nqt8 CaPwfocyh5bAwv2DIxz7Dy5vZSz/4CWX9NR/NevV5cCkKY72BGh2Gor4iMrjP363jf21 x2kQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d21-20020a056402517500b00461ea502defsi3105549ede.350.2022.11.03.23.07.56; Thu, 03 Nov 2022 23:08:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231803AbiKDFvG (ORCPT + 99 others); Fri, 4 Nov 2022 01:51:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231272AbiKDFsx (ORCPT ); Fri, 4 Nov 2022 01:48:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBEE827CFA for ; Thu, 3 Nov 2022 22:48:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AAE7A620B9 for ; Fri, 4 Nov 2022 05:48:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87AC7C43148; Fri, 4 Nov 2022 05:48:47 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZq-00713u-0D; Fri, 04 Nov 2022 01:49:14 -0400 Message-ID: <20221104054913.901228801@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:04 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , "Theodore Tso" , "Jason A. Donenfeld" Subject: [RFC][PATCH v3 11/33] random: use timer_shutdown_sync() before freeing timer References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748544631926682223?= X-GMAIL-MSGID: =?utf-8?q?1748544631926682223?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: "Theodore Ts'o" Acked-by: Jason A. Donenfeld Signed-off-by: Steven Rostedt (Google) --- drivers/char/random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/random.c b/drivers/char/random.c index 69754155300e..943b4b2712a5 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -1233,7 +1233,7 @@ static void __cold try_to_generate_entropy(void) stack.entropy = random_get_entropy(); } - del_timer_sync(&stack.timer); + timer_shutdown_sync(&stack.timer); destroy_timer_on_stack(&stack.timer); mix_pool_bytes(&stack.entropy, sizeof(stack.entropy)); } From patchwork Fri Nov 4 05:41:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15347 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp190683wru; Thu, 3 Nov 2022 22:50:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM64XmOfhEJOECdF+Ha/oplWHFINi8ewfAtBHrP2rrYeuaOak6b0q+2DuQbeb2cPO57WpfwL X-Received: by 2002:aa7:c792:0:b0:453:98b7:213c with SMTP id n18-20020aa7c792000000b0045398b7213cmr33768187eds.159.1667541047107; Thu, 03 Nov 2022 22:50:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541047; cv=none; d=google.com; s=arc-20160816; b=qO9t2ECSfEqISkP4C57BScNNfF4KeehL38uN5rG/Tjfv8qKzWwgE9NqXsinhG02cwJ UEmL7BvVvw1MLK29w6hOgGKGp4iMwV3UZJKLb2bSs+uoi62El/f4LgzrXo6vipdxspTZ veRvagsZ/vjomDEU2nOUXt8MAaIIWh7vdUp8Ks/LbXxaOpZN6yjWfl/tRQxNZsiXuO6X k6BmMyI/V9uPx1j0FG0K/IixSnRWIA5LoNkffp4vQWL896az8pPlhwZ/hA/hSP2MJzJw JkDzzQ4PalMlFOErgpSbtLUYDrnLXnRIQMW4O7QK4LKBeTJs5Tj2Ng//k1LGntlehRAe sTqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=/rrB5AZo+xe29GB6bFMagGr7OU99p1/f4RfK2bxWtNA=; b=kq6n1ymXwiOlo+uIsS0oH3cYQowho3/bxvnXC+XbQ+YGGGDPue/W5EcVLfdvFtJZbD chVYLqrEmzPkcwCKHhtj9D2SuLEagA8eJEJFI8hAj8U4THho3SQobVsF1ffPhNxW5fPy BT+5lblnrGmYsr5qAD4Oi4MuY1TIVO42VJpRkrw26VsJIT0kSC5cEw3kjSUmD117HP2T S281qKcn9HIzzLEk5+GfoK/UHxRMA/BCb90XwKNZ52S2+zX93ySrvpUcF3JadggF2M6Y Jd+tLCpfjGkpJATa4jgFx/JRpiiYoB8dJjnzyCsd+7x53qDrY0rQFyX5ZntFbDNe2Chf Mipw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb24-20020a1709077e9800b007826e727aeasi3904640ejc.44.2022.11.03.22.50.23; Thu, 03 Nov 2022 22:50:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231650AbiKDFtl (ORCPT + 99 others); Fri, 4 Nov 2022 01:49:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231304AbiKDFsx (ORCPT ); Fri, 4 Nov 2022 01:48:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF66D28724; Thu, 3 Nov 2022 22:48:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 326AE620C6; Fri, 4 Nov 2022 05:48:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0BC21C43145; Fri, 4 Nov 2022 05:48:48 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZq-00715d-21; Fri, 04 Nov 2022 01:49:14 -0400 Message-ID: <20221104054914.458495869@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:07 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , David Rheinsberg , Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org Subject: [RFC][PATCH v3 14/33] timers: HID: Use timer_shutdown_sync() before freeing timer References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543520727327462?= X-GMAIL-MSGID: =?utf-8?q?1748543520727327462?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: David Rheinsberg Cc: Jiri Kosina Cc: Benjamin Tissoires Cc: linux-input@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- drivers/hid/hid-wiimote-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-wiimote-core.c b/drivers/hid/hid-wiimote-core.c index 4399d6c6afef..2c94308dda3c 100644 --- a/drivers/hid/hid-wiimote-core.c +++ b/drivers/hid/hid-wiimote-core.c @@ -1764,7 +1764,7 @@ static void wiimote_destroy(struct wiimote_data *wdata) spin_unlock_irqrestore(&wdata->state.lock, flags); cancel_work_sync(&wdata->init_worker); - del_timer_sync(&wdata->timer); + timer_shutdown_sync(&wdata->timer); device_remove_file(&wdata->hdev->dev, &dev_attr_devtype); device_remove_file(&wdata->hdev->dev, &dev_attr_extension); From patchwork Fri Nov 4 05:41:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15365 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp192324wru; Thu, 3 Nov 2022 22:56:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5jjYBBJyHqhoUyQI3lP/3iO3ZzgfzRaK9jP3cfMUagu6dm89A6y8GnfCHpljJ2IIDf4B// X-Received: by 2002:a17:907:7f02:b0:73d:dffa:57b3 with SMTP id qf2-20020a1709077f0200b0073ddffa57b3mr33936380ejc.19.1667541386170; Thu, 03 Nov 2022 22:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541386; cv=none; d=google.com; s=arc-20160816; b=Zh7jpLU4XGllXgN4HStKIyY/XSvk1qm1GyPKitqpj5MWpwCXq+l9DYOszQT6WFgQm6 eaF11NS35+1dRxvMFgXSrLYUR+xuFra4Voy0AUj7lgkQ9avhF9OqAx6Ld160mq/LwvMu Vl87zIjsayJ2nfRRfPRUbkTWoMu8EnRApJjr5T/QMOe7QTwYOtyCNjto4eWpozCzma/u WkOWcP0jSPeOJV3lNojqB08V7HfoLox8MqRJadkRU/dMnUkFzdBwLCPcuYCDa+vrHRK1 rSXAp6ZunIsQncBdXUZtzACPd9nRjmTy3esKj4ii0wHJ2JjjJQLQQvS9o86ULJe4kK1h Dkyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=4gzwZmQwxvaCPh0i1+e6XBsi/rXTapTh5YkJhDgSATg=; b=XUzASSOXTFwjj6DG+sbPF3iODnht0OWhVBOQxbaXPLJ47QRnknWCO07ogsAcTfsyr+ DWkNaZd9KSfUICLuzih330KoM12BaMBimoCWuOwxacWWl14T5hP9K7vQHthd7uL7o8+X JZdYXXwAanu/QFAn/zFMtI7e99ORLxUd5UGUwEsHAFHu4nT17omxehmaOLdyy8hVxis3 +jJAzeZ3tMhOe1TAeSjzZxIfJXVDTrCE11y1E1TvIBxdnyRTdBKBYrQYwo5rPF5/t+3W 4cRjhdfCK539apZVUkBxKZawq90VJwWPHlOmJ00heOh666x69dgH5Ju0VL3qVZq54QT9 VJhQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hg5-20020a1709072cc500b0078dcdbe650fsi4347381ejc.443.2022.11.03.22.56.03; Thu, 03 Nov 2022 22:56:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231797AbiKDFvB (ORCPT + 99 others); Fri, 4 Nov 2022 01:51:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231280AbiKDFsx (ORCPT ); Fri, 4 Nov 2022 01:48:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF33D27B31; Thu, 3 Nov 2022 22:48:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F204D620D1; Fri, 4 Nov 2022 05:48:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67B04C4347C; Fri, 4 Nov 2022 05:48:48 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZq-00716l-3C; Fri, 04 Nov 2022 01:49:14 -0400 Message-ID: <20221104054914.824782154@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:09 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Karsten Keil , netdev@vger.kernel.org Subject: [RFC][PATCH v3 16/33] timers: mISDN: Use timer_shutdown_sync() before freeing timer References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543876545298405?= X-GMAIL-MSGID: =?utf-8?q?1748543876545298405?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called, or at least timer_shutdown() (where sync is not possible in the context). Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: Karsten Keil Cc: netdev@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- drivers/isdn/hardware/mISDN/hfcmulti.c | 6 ++---- drivers/isdn/mISDN/l1oip_core.c | 4 ++-- drivers/isdn/mISDN/timerdev.c | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c index 4f7eaa17fb27..9c15c2c30e88 100644 --- a/drivers/isdn/hardware/mISDN/hfcmulti.c +++ b/drivers/isdn/hardware/mISDN/hfcmulti.c @@ -4543,10 +4543,8 @@ release_port(struct hfc_multi *hc, struct dchannel *dch) spin_lock_irqsave(&hc->lock, flags); - if (dch->timer.function) { - del_timer(&dch->timer); - dch->timer.function = NULL; - } + if (dch->timer.function) + timer_shutdown(&dch->timer); if (hc->ctype == HFC_TYPE_E1) { /* E1 */ /* remove sync */ diff --git a/drivers/isdn/mISDN/l1oip_core.c b/drivers/isdn/mISDN/l1oip_core.c index a77195e378b7..182e3f489c60 100644 --- a/drivers/isdn/mISDN/l1oip_core.c +++ b/drivers/isdn/mISDN/l1oip_core.c @@ -1236,8 +1236,8 @@ release_card(struct l1oip *hc) hc->shutdown = true; - del_timer_sync(&hc->keep_tl); - del_timer_sync(&hc->timeout_tl); + timer_shutdown_sync(&hc->keep_tl); + timer_shutdown_sync(&hc->timeout_tl); cancel_work_sync(&hc->workq); diff --git a/drivers/isdn/mISDN/timerdev.c b/drivers/isdn/mISDN/timerdev.c index abdf36ac3bee..83d6b484d3c6 100644 --- a/drivers/isdn/mISDN/timerdev.c +++ b/drivers/isdn/mISDN/timerdev.c @@ -74,7 +74,7 @@ mISDN_close(struct inode *ino, struct file *filep) while (!list_empty(list)) { timer = list_first_entry(list, struct mISDNtimer, list); spin_unlock_irq(&dev->lock); - del_timer_sync(&timer->tl); + timer_shutdown_sync(&timer->tl); spin_lock_irq(&dev->lock); /* it might have been moved to ->expired */ list_del(&timer->list); @@ -204,7 +204,7 @@ misdn_del_timer(struct mISDNtimerdev *dev, int id) list_del_init(&timer->list); timer->id = -1; spin_unlock_irq(&dev->lock); - del_timer_sync(&timer->tl); + timer_shutdown_sync(&timer->tl); kfree(timer); return id; } From patchwork Fri Nov 4 05:41:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15363 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp192165wru; Thu, 3 Nov 2022 22:55:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6baCZH6Xf7UQYCqDoPcsqntNomqb7fAfcjaxioSgOo4USXi1s4ohwIvP7aIE8rp3tOJXW1 X-Received: by 2002:a05:6402:3709:b0:459:279e:fdc6 with SMTP id ek9-20020a056402370900b00459279efdc6mr34501820edb.338.1667541347259; Thu, 03 Nov 2022 22:55:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541347; cv=none; d=google.com; s=arc-20160816; b=OjcUk7TxKRGhNYWbXL0OiAqsvitpeB2PC7uOaOCVJ3f7keDzEdTbAoIZ0J2A3x/tq1 hjoTNy+n+/czodkCo1mHa0/Rlma0yiFzNviYNOEOhM8u5c5akCPCJQmfJMYaa0pEIBWr JOKK21XJD5Zfpo1ue4F+Xzh4utB7NAMfrIekxveJoV5kYCpKSX61891+2+pJbhE3K0bE Q9jNeCV1qLuYms99OdIV+oYUfI00VQNoEStYXRS+rE79HAmevVXJpEI3xQ2c4ZO32uC+ 3hanXTTeMB8DFrF9MgJ7Zn84bnNgD7ZzhBzIFyQicZr/aCgNA2ZsG5b2DwQnJ1BIddYh isVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=WLEbVkOK6HuRRIs31lOdzMR9qw5dl+COq+13Yqz168M=; b=GY0L4eaYXylSfxnNEjy1nh7Xx6j2hWWqfBc6oUoML+/TEycYULI1vR7Y3NTuch8qEX td+L1T5uWcuJj/h33mKBgiRaihlhRgJdXkPAunmXpUrAqH8FGIMEklwa9/YsRaB9ch35 VF2HBUU1imJ8YN7lUa43bNq8P2R1GL6X2db6CQSA3bnEs3ScefFZExcQxOENHVYbC5yB 2QgNczUq0UCYy+NUwh90kPvRmgSt1yvhfWm5zWLCFeFDWnknCqDBgCsZg4C244BiJli9 3rJf+G61kzdx4Cq7A+48FCtmb7Fk78FuzBNbHywXLAR7f12imwFfnm02AWNviCzpVfEi GfHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qa31-20020a170907869f00b0078e093ae419si4683967ejc.8.2022.11.03.22.55.23; Thu, 03 Nov 2022 22:55:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231655AbiKDFuv (ORCPT + 99 others); Fri, 4 Nov 2022 01:50:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231313AbiKDFsx (ORCPT ); Fri, 4 Nov 2022 01:48:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 567DA28731; Thu, 3 Nov 2022 22:48:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 06717B82C03; Fri, 4 Nov 2022 05:48:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD633C433D7; Fri, 4 Nov 2022 05:48:48 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZr-00717J-0Y; Fri, 04 Nov 2022 01:49:15 -0400 Message-ID: <20221104054915.007849347@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:10 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Pavel Machek , linux-leds@vger.kernel.org Subject: [RFC][PATCH v3 17/33] timers: leds: Use timer_shutdown_sync() before freeing timer References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543835279613437?= X-GMAIL-MSGID: =?utf-8?q?1748543835279613437?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: Pavel Machek Cc: linux-leds@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- drivers/leds/trigger/ledtrig-activity.c | 2 +- drivers/leds/trigger/ledtrig-heartbeat.c | 2 +- drivers/leds/trigger/ledtrig-pattern.c | 2 +- drivers/leds/trigger/ledtrig-transient.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/leds/trigger/ledtrig-activity.c b/drivers/leds/trigger/ledtrig-activity.c index 30bc9df03636..33cbf8413658 100644 --- a/drivers/leds/trigger/ledtrig-activity.c +++ b/drivers/leds/trigger/ledtrig-activity.c @@ -208,7 +208,7 @@ static void activity_deactivate(struct led_classdev *led_cdev) { struct activity_data *activity_data = led_get_trigger_data(led_cdev); - del_timer_sync(&activity_data->timer); + timer_shutdown_sync(&activity_data->timer); kfree(activity_data); clear_bit(LED_BLINK_SW, &led_cdev->work_flags); } diff --git a/drivers/leds/trigger/ledtrig-heartbeat.c b/drivers/leds/trigger/ledtrig-heartbeat.c index 7fe0a05574d2..393b3ae832f4 100644 --- a/drivers/leds/trigger/ledtrig-heartbeat.c +++ b/drivers/leds/trigger/ledtrig-heartbeat.c @@ -151,7 +151,7 @@ static void heartbeat_trig_deactivate(struct led_classdev *led_cdev) struct heartbeat_trig_data *heartbeat_data = led_get_trigger_data(led_cdev); - del_timer_sync(&heartbeat_data->timer); + timer_shutdown_sync(&heartbeat_data->timer); kfree(heartbeat_data); clear_bit(LED_BLINK_SW, &led_cdev->work_flags); } diff --git a/drivers/leds/trigger/ledtrig-pattern.c b/drivers/leds/trigger/ledtrig-pattern.c index 43a265dc4696..e996d61e3bd6 100644 --- a/drivers/leds/trigger/ledtrig-pattern.c +++ b/drivers/leds/trigger/ledtrig-pattern.c @@ -430,7 +430,7 @@ static void pattern_trig_deactivate(struct led_classdev *led_cdev) if (led_cdev->pattern_clear) led_cdev->pattern_clear(led_cdev); - del_timer_sync(&data->timer); + timer_shutdown_sync(&data->timer); led_set_brightness(led_cdev, LED_OFF); kfree(data); diff --git a/drivers/leds/trigger/ledtrig-transient.c b/drivers/leds/trigger/ledtrig-transient.c index 80635183fac8..f111fa7635e5 100644 --- a/drivers/leds/trigger/ledtrig-transient.c +++ b/drivers/leds/trigger/ledtrig-transient.c @@ -180,7 +180,7 @@ static void transient_trig_deactivate(struct led_classdev *led_cdev) { struct transient_trig_data *transient_data = led_get_trigger_data(led_cdev); - del_timer_sync(&transient_data->timer); + timer_shutdown_sync(&transient_data->timer); led_set_brightness_nosleep(led_cdev, transient_data->restore_state); kfree(transient_data); } From patchwork Fri Nov 4 05:41:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15349 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp190732wru; Thu, 3 Nov 2022 22:50:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ezUYlcvrQ7fpIy533W3j6dWQBcjJeajMatKfmBuzo3QtYLdvcp3PzLMGrvjV60Zut5NOh X-Received: by 2002:a17:907:6d8a:b0:7ad:d3a1:cbf6 with SMTP id sb10-20020a1709076d8a00b007add3a1cbf6mr22835408ejc.533.1667541056063; Thu, 03 Nov 2022 22:50:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541056; cv=none; d=google.com; s=arc-20160816; b=xgCntdE2EHT+Eah04bXd2dLxsYz8LBYI2WqEqR8T1HphFF9ZOWaAyC0YZWJu6oX0RK T2DFh0TzufTp+ipdYDGLXXR5cu5OJ2PaRpBqJm87DSNbt4BAaawM1zOhrVkERe2su06L 9R2r2bl3y4oJ3RrwNGx0lVpcNcD32N7SXxi76NpkXIaZkv+s4WrSRQ8x18EwpVA1Msin 7YVGS8flC62B2kehWDsptaReATIWr1vTclEENxHKZ0UwaeN4mpEC2frUN4ysAOQuKS5o 9wsebnARXpErUdtqiDcB5HFpM41/u+sVDPfgNqZN2kbHRqfeoMIMbHWVVb8wAdvQOhp6 xagg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=EY6RM9Sc7QRzYFxTrSf9xIjpfItkUz8nRNIlpxnrKzg=; b=Ep8GTHYilKlC1S30nDrdF5iFWkTXQI4M80IhvyUQ8/KpXsRZ1jJ+cvEc1AbRSNtt/h mvzypbyTVuHUZPmXV2SHsxxWieozB/8J8mNnUFhWc993RGyxeifXNXBUvW45NW41J+Rt IUGKkcBUrqWBBOakdfvGh7LBtUIqkfo5iToJ1c6YgypEHAdgXN7QFPz+SyX917wnVS+p wXKeWhj/ruQe2AWosz8sjQ/C/gIQ6nkL4mTylUe92mmO4D9dClxkn4XZY7j3/IfG7ewA Z737XPsF8gx3eVBoR9heeGkR7epOX0yt9cKjKdqOog3XcV9fXImzWdQPnBc794lrkmMp y96Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q17-20020a056402519100b00458b9b7bb2fsi4681428edd.396.2022.11.03.22.50.32; Thu, 03 Nov 2022 22:50:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231667AbiKDFtt (ORCPT + 99 others); Fri, 4 Nov 2022 01:49:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231336AbiKDFsx (ORCPT ); Fri, 4 Nov 2022 01:48:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 253BA25EBC; Thu, 3 Nov 2022 22:48:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 55408620D0; Fri, 4 Nov 2022 05:48:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F41D5C433C1; Fri, 4 Nov 2022 05:48:48 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZr-00718S-1k; Fri, 04 Nov 2022 01:49:15 -0400 Message-ID: <20221104054915.376624143@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:12 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Mirko Lindner , Stephen Hemminger , Martin KaFai Lau , Alexei Starovoitov , Kuniyuki Iwashima , Pavel Begunkov , Menglong Dong , linux-usb@vger.kernel.org, linux-wireless@vger.kernel.org, bridge@lists.linux-foundation.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, lvs-devel@vger.kernel.org, linux-afs@lists.infradead.org, linux-nfs@vger.kernel.org, tipc-discussion@lists.sourceforge.net Subject: [RFC][PATCH v3 19/33] timers: net: Use timer_shutdown_sync() before freeing timer References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543530591336121?= X-GMAIL-MSGID: =?utf-8?q?1748543530591336121?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. And if synchronization is already done, then at least timer_shutdown() needs to be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: Jesse Brandeburg Cc: Tony Nguyen Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Mirko Lindner Cc: Stephen Hemminger Cc: Martin KaFai Lau Cc: Alexei Starovoitov Cc: Kuniyuki Iwashima Cc: Pavel Begunkov Cc: Menglong Dong Cc: linux-usb@vger.kernel.org Cc: linux-wireless@vger.kernel.org Cc: bridge@lists.linux-foundation.org Cc: netfilter-devel@vger.kernel.org Cc: coreteam@netfilter.org Cc: lvs-devel@vger.kernel.org Cc: linux-afs@lists.infradead.org Cc: linux-nfs@vger.kernel.org Cc: tipc-discussion@lists.sourceforge.net Signed-off-by: Steven Rostedt (Google) --- drivers/net/ethernet/intel/i40e/i40e_main.c | 6 +++--- drivers/net/ethernet/marvell/sky2.c | 2 +- drivers/net/ethernet/sun/sunvnet.c | 2 +- drivers/net/usb/sierra_net.c | 2 +- drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | 2 +- drivers/net/wireless/intersil/hostap/hostap_ap.c | 2 +- drivers/net/wireless/marvell/mwifiex/main.c | 2 +- drivers/net/wireless/microchip/wilc1000/hif.c | 8 ++++---- net/802/garp.c | 2 +- net/802/mrp.c | 2 +- net/bridge/br_multicast.c | 6 +++--- net/bridge/br_multicast_eht.c | 4 ++-- net/core/gen_estimator.c | 2 +- net/core/neighbour.c | 2 ++ net/ipv4/inet_connection_sock.c | 2 +- net/ipv4/inet_timewait_sock.c | 3 ++- net/ipv4/ipmr.c | 2 +- net/ipv6/ip6mr.c | 2 +- net/mac80211/mesh_pathtbl.c | 2 +- net/netfilter/ipset/ip_set_list_set.c | 2 +- net/netfilter/ipvs/ip_vs_lblc.c | 2 +- net/netfilter/ipvs/ip_vs_lblcr.c | 2 +- net/netfilter/xt_LED.c | 2 +- net/rxrpc/conn_object.c | 2 +- net/sched/cls_flow.c | 2 +- net/sunrpc/svc.c | 2 +- net/sunrpc/xprt.c | 2 +- net/tipc/discover.c | 2 +- net/tipc/monitor.c | 2 +- 29 files changed, 39 insertions(+), 36 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index b5dcd15ced36..54d5eed32743 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -15530,7 +15530,7 @@ static int i40e_init_recovery_mode(struct i40e_pf *pf, struct i40e_hw *hw) err_switch_setup: i40e_reset_interrupt_capability(pf); - del_timer_sync(&pf->service_timer); + timer_shutdown_sync(&pf->service_timer); i40e_shutdown_adminq(hw); iounmap(hw->hw_addr); pci_disable_pcie_error_reporting(pf->pdev); @@ -16149,7 +16149,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) kfree(pf->vsi); err_switch_setup: i40e_reset_interrupt_capability(pf); - del_timer_sync(&pf->service_timer); + timer_shutdown_sync(&pf->service_timer); err_mac_addr: err_configure_lan_hmc: (void)i40e_shutdown_lan_hmc(hw); @@ -16211,7 +16211,7 @@ static void i40e_remove(struct pci_dev *pdev) set_bit(__I40E_SUSPENDED, pf->state); set_bit(__I40E_DOWN, pf->state); if (pf->service_timer.function) - del_timer_sync(&pf->service_timer); + timer_shutdown_sync(&pf->service_timer); if (pf->service_task.func) cancel_work_sync(&pf->service_task); diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c index ab33ba1c3023..dc571e076180 100644 --- a/drivers/net/ethernet/marvell/sky2.c +++ b/drivers/net/ethernet/marvell/sky2.c @@ -5013,7 +5013,7 @@ static void sky2_remove(struct pci_dev *pdev) if (!hw) return; - del_timer_sync(&hw->watchdog_timer); + timer_shutdown_sync(&hw->watchdog_timer); cancel_work_sync(&hw->restart_work); for (i = hw->ports-1; i >= 0; --i) diff --git a/drivers/net/ethernet/sun/sunvnet.c b/drivers/net/ethernet/sun/sunvnet.c index acda6cbd0238..fe86fbd58586 100644 --- a/drivers/net/ethernet/sun/sunvnet.c +++ b/drivers/net/ethernet/sun/sunvnet.c @@ -524,7 +524,7 @@ static void vnet_port_remove(struct vio_dev *vdev) hlist_del_rcu(&port->hash); synchronize_rcu(); - del_timer_sync(&port->clean_timer); + timer_shutdown_sync(&port->clean_timer); sunvnet_port_rm_txq_common(port); netif_napi_del(&port->napi); sunvnet_port_free_tx_bufs_common(port); diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c index b3ae949e6f1c..673d3aa83792 100644 --- a/drivers/net/usb/sierra_net.c +++ b/drivers/net/usb/sierra_net.c @@ -759,7 +759,7 @@ static void sierra_net_unbind(struct usbnet *dev, struct usb_interface *intf) dev_dbg(&dev->udev->dev, "%s", __func__); /* kill the timer and work */ - del_timer_sync(&priv->sync_timer); + timer_shutdown_sync(&priv->sync_timer); cancel_work_sync(&priv->sierra_net_kevent); /* tell modem we are going away */ diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c index 3237d4b528b5..119d83acafd1 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c @@ -371,7 +371,7 @@ void iwl_dbg_tlv_del_timers(struct iwl_trans *trans) struct iwl_dbg_tlv_timer_node *node, *tmp; list_for_each_entry_safe(node, tmp, timer_list, list) { - del_timer_sync(&node->timer); + timer_shutdown_sync(&node->timer); list_del(&node->list); kfree(node); } diff --git a/drivers/net/wireless/intersil/hostap/hostap_ap.c b/drivers/net/wireless/intersil/hostap/hostap_ap.c index 462ccc7d7d1a..9b546a71e7a2 100644 --- a/drivers/net/wireless/intersil/hostap/hostap_ap.c +++ b/drivers/net/wireless/intersil/hostap/hostap_ap.c @@ -135,7 +135,7 @@ static void ap_free_sta(struct ap_data *ap, struct sta_info *sta) if (!sta->ap) kfree(sta->u.sta.challenge); - del_timer_sync(&sta->timer); + timer_shutdown_sync(&sta->timer); #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ kfree(sta); diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c index da2e6557e684..ea22a08e6c08 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.c +++ b/drivers/net/wireless/marvell/mwifiex/main.c @@ -123,7 +123,7 @@ static int mwifiex_unregister(struct mwifiex_adapter *adapter) if (adapter->if_ops.cleanup_if) adapter->if_ops.cleanup_if(adapter); - del_timer_sync(&adapter->cmd_timer); + timer_shutdown_sync(&adapter->cmd_timer); /* Free private structures */ for (i = 0; i < adapter->priv_num; i++) { diff --git a/drivers/net/wireless/microchip/wilc1000/hif.c b/drivers/net/wireless/microchip/wilc1000/hif.c index eb1d1ba3a443..b76b5ce95961 100644 --- a/drivers/net/wireless/microchip/wilc1000/hif.c +++ b/drivers/net/wireless/microchip/wilc1000/hif.c @@ -1520,10 +1520,10 @@ int wilc_deinit(struct wilc_vif *vif) mutex_lock(&vif->wilc->deinit_lock); - del_timer_sync(&hif_drv->scan_timer); - del_timer_sync(&hif_drv->connect_timer); - del_timer_sync(&vif->periodic_rssi); - del_timer_sync(&hif_drv->remain_on_ch_timer); + timer_shutdown_sync(&hif_drv->scan_timer); + timer_shutdown_sync(&hif_drv->connect_timer); + timer_shutdown_sync(&vif->periodic_rssi); + timer_shutdown_sync(&hif_drv->remain_on_ch_timer); if (hif_drv->usr_scan_req.scan_result) { hif_drv->usr_scan_req.scan_result(SCAN_EVENT_ABORTED, NULL, diff --git a/net/802/garp.c b/net/802/garp.c index fc9eb02a912f..87b2ddfe86ac 100644 --- a/net/802/garp.c +++ b/net/802/garp.c @@ -618,7 +618,7 @@ void garp_uninit_applicant(struct net_device *dev, struct garp_application *appl /* Delete timer and generate a final TRANSMIT_PDU event to flush out * all pending messages before the applicant is gone. */ - del_timer_sync(&app->join_timer); + timer_shutdown_sync(&app->join_timer); spin_lock_bh(&app->lock); garp_gid_event(app, GARP_EVENT_TRANSMIT_PDU); diff --git a/net/802/mrp.c b/net/802/mrp.c index 155f74d8b14f..a744a28477dd 100644 --- a/net/802/mrp.c +++ b/net/802/mrp.c @@ -904,7 +904,7 @@ void mrp_uninit_applicant(struct net_device *dev, struct mrp_application *appl) * all pending messages before the applicant is gone. */ del_timer_sync(&app->join_timer); - del_timer_sync(&app->periodic_timer); + timer_shutdown_sync(&app->periodic_timer); spin_lock_bh(&app->lock); mrp_mad_event(app, MRP_EVENT_TX); diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index db4f2641d1cd..16d2a7064e44 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c @@ -605,7 +605,7 @@ static void br_multicast_destroy_mdb_entry(struct net_bridge_mcast_gc *gc) WARN_ON(!hlist_unhashed(&mp->mdb_node)); WARN_ON(mp->ports); - del_timer_sync(&mp->timer); + timer_shutdown_sync(&mp->timer); kfree_rcu(mp, rcu); } @@ -646,7 +646,7 @@ static void br_multicast_destroy_group_src(struct net_bridge_mcast_gc *gc) src = container_of(gc, struct net_bridge_group_src, mcast_gc); WARN_ON(!hlist_unhashed(&src->node)); - del_timer_sync(&src->timer); + timer_shutdown_sync(&src->timer); kfree_rcu(src, rcu); } @@ -671,7 +671,7 @@ static void br_multicast_destroy_port_group(struct net_bridge_mcast_gc *gc) WARN_ON(!hlist_empty(&pg->src_list)); del_timer_sync(&pg->rexmit_timer); - del_timer_sync(&pg->timer); + timer_shutdown_sync(&pg->timer); kfree_rcu(pg, rcu); } diff --git a/net/bridge/br_multicast_eht.c b/net/bridge/br_multicast_eht.c index f91c071d1608..c126aa4e7551 100644 --- a/net/bridge/br_multicast_eht.c +++ b/net/bridge/br_multicast_eht.c @@ -142,7 +142,7 @@ static void br_multicast_destroy_eht_set_entry(struct net_bridge_mcast_gc *gc) set_h = container_of(gc, struct net_bridge_group_eht_set_entry, mcast_gc); WARN_ON(!RB_EMPTY_NODE(&set_h->rb_node)); - del_timer_sync(&set_h->timer); + timer_shutdown_sync(&set_h->timer); kfree(set_h); } @@ -154,7 +154,7 @@ static void br_multicast_destroy_eht_set(struct net_bridge_mcast_gc *gc) WARN_ON(!RB_EMPTY_NODE(&eht_set->rb_node)); WARN_ON(!RB_EMPTY_ROOT(&eht_set->entry_tree)); - del_timer_sync(&eht_set->timer); + timer_shutdown_sync(&eht_set->timer); kfree(eht_set); } diff --git a/net/core/gen_estimator.c b/net/core/gen_estimator.c index 4fcbdd71c59f..fae9c4694186 100644 --- a/net/core/gen_estimator.c +++ b/net/core/gen_estimator.c @@ -208,7 +208,7 @@ void gen_kill_estimator(struct net_rate_estimator __rcu **rate_est) est = xchg((__force struct net_rate_estimator **)rate_est, NULL); if (est) { - del_timer_sync(&est->timer); + timer_shutdown_sync(&est->timer); kfree_rcu(est, rcu); } } diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 3c4786b99907..68edfd46781c 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -895,6 +895,8 @@ void neigh_destroy(struct neighbour *neigh) if (neigh_del_timer(neigh)) pr_warn("Impossible event\n"); + timer_shutdown(&neigh->timer); + write_lock_bh(&neigh->lock); __skb_queue_purge(&neigh->arp_queue); write_unlock_bh(&neigh->lock); diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c index 4e84ed21d16f..5e70228c5ae9 100644 --- a/net/ipv4/inet_connection_sock.c +++ b/net/ipv4/inet_connection_sock.c @@ -917,7 +917,7 @@ static bool reqsk_queue_unlink(struct request_sock *req) found = __sk_nulls_del_node_init_rcu(sk); spin_unlock(lock); } - if (timer_pending(&req->rsk_timer) && del_timer_sync(&req->rsk_timer)) + if (timer_pending(&req->rsk_timer) && timer_shutdown_sync(&req->rsk_timer)) reqsk_put(req); return found; } diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c index 66fc940f9521..8a70bb726bcb 100644 --- a/net/ipv4/inet_timewait_sock.c +++ b/net/ipv4/inet_timewait_sock.c @@ -66,6 +66,7 @@ static void inet_twsk_kill(struct inet_timewait_sock *tw) void inet_twsk_free(struct inet_timewait_sock *tw) { struct module *owner = tw->tw_prot->owner; + timer_shutdown(&tw->tw_timer); twsk_destructor((struct sock *)tw); #ifdef SOCK_REFCNT_DEBUG pr_debug("%s timewait_sock %p released\n", tw->tw_prot->name, tw); @@ -208,7 +209,7 @@ EXPORT_SYMBOL_GPL(inet_twsk_alloc); */ void inet_twsk_deschedule_put(struct inet_timewait_sock *tw) { - if (del_timer_sync(&tw->tw_timer)) + if (timer_shutdown_sync(&tw->tw_timer)) inet_twsk_kill(tw); inet_twsk_put(tw); } diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index e04544ac4b45..dbaf4c33b155 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c @@ -412,7 +412,7 @@ static struct mr_table *ipmr_new_table(struct net *net, u32 id) static void ipmr_free_table(struct mr_table *mrt) { - del_timer_sync(&mrt->ipmr_expire_timer); + timer_shutdown_sync(&mrt->ipmr_expire_timer); mroute_clean_tables(mrt, MRT_FLUSH_VIFS | MRT_FLUSH_VIFS_STATIC | MRT_FLUSH_MFC | MRT_FLUSH_MFC_STATIC); rhltable_destroy(&mrt->mfc_hash); diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index facdc78a43e5..474b862039e0 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c @@ -392,7 +392,7 @@ static struct mr_table *ip6mr_new_table(struct net *net, u32 id) static void ip6mr_free_table(struct mr_table *mrt) { - del_timer_sync(&mrt->ipmr_expire_timer); + timer_shutdown_sync(&mrt->ipmr_expire_timer); mroute_clean_tables(mrt, MRT6_FLUSH_MIFS | MRT6_FLUSH_MIFS_STATIC | MRT6_FLUSH_MFC | MRT6_FLUSH_MFC_STATIC); rhltable_destroy(&mrt->mfc_hash); diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index acc1c299f1ae..ec72756075f5 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c @@ -512,7 +512,7 @@ static void mesh_path_free_rcu(struct mesh_table *tbl, mpath->flags |= MESH_PATH_RESOLVING | MESH_PATH_DELETED; mesh_gate_del(tbl, mpath); spin_unlock_bh(&mpath->state_lock); - del_timer_sync(&mpath->timer); + timer_shutdown_sync(&mpath->timer); atomic_dec(&sdata->u.mesh.mpaths); atomic_dec(&tbl->entries); mesh_path_flush_pending(mpath); diff --git a/net/netfilter/ipset/ip_set_list_set.c b/net/netfilter/ipset/ip_set_list_set.c index 5a67f7966574..e162636525cf 100644 --- a/net/netfilter/ipset/ip_set_list_set.c +++ b/net/netfilter/ipset/ip_set_list_set.c @@ -427,7 +427,7 @@ list_set_destroy(struct ip_set *set) struct set_elem *e, *n; if (SET_WITH_TIMEOUT(set)) - del_timer_sync(&map->gc); + timer_shutdown_sync(&map->gc); list_for_each_entry_safe(e, n, &map->members, list) { list_del(&e->list); diff --git a/net/netfilter/ipvs/ip_vs_lblc.c b/net/netfilter/ipvs/ip_vs_lblc.c index 7ac7473e3804..1b87214d385e 100644 --- a/net/netfilter/ipvs/ip_vs_lblc.c +++ b/net/netfilter/ipvs/ip_vs_lblc.c @@ -384,7 +384,7 @@ static void ip_vs_lblc_done_svc(struct ip_vs_service *svc) struct ip_vs_lblc_table *tbl = svc->sched_data; /* remove periodic timer */ - del_timer_sync(&tbl->periodic_timer); + timer_shutdown_sync(&tbl->periodic_timer); /* got to clean up table entries here */ ip_vs_lblc_flush(svc); diff --git a/net/netfilter/ipvs/ip_vs_lblcr.c b/net/netfilter/ipvs/ip_vs_lblcr.c index 77c323c36a88..ad8f5fea6d3a 100644 --- a/net/netfilter/ipvs/ip_vs_lblcr.c +++ b/net/netfilter/ipvs/ip_vs_lblcr.c @@ -547,7 +547,7 @@ static void ip_vs_lblcr_done_svc(struct ip_vs_service *svc) struct ip_vs_lblcr_table *tbl = svc->sched_data; /* remove periodic timer */ - del_timer_sync(&tbl->periodic_timer); + timer_shutdown_sync(&tbl->periodic_timer); /* got to clean up table entries here */ ip_vs_lblcr_flush(svc); diff --git a/net/netfilter/xt_LED.c b/net/netfilter/xt_LED.c index 0371c387b0d1..66b0f941d8fb 100644 --- a/net/netfilter/xt_LED.c +++ b/net/netfilter/xt_LED.c @@ -166,7 +166,7 @@ static void led_tg_destroy(const struct xt_tgdtor_param *par) list_del(&ledinternal->list); - del_timer_sync(&ledinternal->timer); + timer_shutdown_sync(&ledinternal->timer); led_trigger_unregister(&ledinternal->netfilter_led_trigger); diff --git a/net/rxrpc/conn_object.c b/net/rxrpc/conn_object.c index 22089e37e97f..307d6d480e78 100644 --- a/net/rxrpc/conn_object.c +++ b/net/rxrpc/conn_object.c @@ -358,7 +358,7 @@ static void rxrpc_destroy_connection(struct rcu_head *rcu) _net("DESTROY CONN %d", conn->debug_id); - del_timer_sync(&conn->timer); + timer_shutdown_sync(&conn->timer); rxrpc_purge_queue(&conn->rx_queue); conn->security->clear(conn); diff --git a/net/sched/cls_flow.c b/net/sched/cls_flow.c index 014cd3de7b5d..cd90a3083b9f 100644 --- a/net/sched/cls_flow.c +++ b/net/sched/cls_flow.c @@ -367,7 +367,7 @@ static const struct nla_policy flow_policy[TCA_FLOW_MAX + 1] = { static void __flow_destroy_filter(struct flow_filter *f) { - del_timer_sync(&f->perturb_timer); + timer_shutdown_sync(&f->perturb_timer); tcf_exts_destroy(&f->exts); tcf_em_tree_destroy(&f->ematches); tcf_exts_put_net(&f->exts); diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index 149171774bc6..42663e240ec5 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c @@ -567,7 +567,7 @@ svc_destroy(struct kref *ref) struct svc_serv *serv = container_of(ref, struct svc_serv, sv_refcnt); dprintk("svc: svc_destroy(%s)\n", serv->sv_program->pg_name); - del_timer_sync(&serv->sv_temptimer); + timer_shutdown_sync(&serv->sv_temptimer); /* * The last user is gone and thus all sockets have to be destroyed to diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index ab453ede54f0..311718ce26d0 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -2118,7 +2118,7 @@ static void xprt_destroy(struct rpc_xprt *xprt) * can only run *before* del_time_sync(), never after. */ spin_lock(&xprt->transport_lock); - del_timer_sync(&xprt->timer); + timer_shutdown_sync(&xprt->timer); spin_unlock(&xprt->transport_lock); /* diff --git a/net/tipc/discover.c b/net/tipc/discover.c index e8630707901e..d9efbee90fb4 100644 --- a/net/tipc/discover.c +++ b/net/tipc/discover.c @@ -385,7 +385,7 @@ int tipc_disc_create(struct net *net, struct tipc_bearer *b, */ void tipc_disc_delete(struct tipc_discoverer *d) { - del_timer_sync(&d->timer); + timer_shutdown_sync(&d->timer); kfree_skb(d->skb); kfree(d); } diff --git a/net/tipc/monitor.c b/net/tipc/monitor.c index 9618e4429f0f..77a3d016cade 100644 --- a/net/tipc/monitor.c +++ b/net/tipc/monitor.c @@ -700,7 +700,7 @@ void tipc_mon_delete(struct net *net, int bearer_id) } mon->self = NULL; write_unlock_bh(&mon->lock); - del_timer_sync(&mon->timer); + timer_shutdown_sync(&mon->timer); kfree(self->domain); kfree(self); kfree(mon); From patchwork Fri Nov 4 05:41:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15366 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp192326wru; Thu, 3 Nov 2022 22:56:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6LXGACCptG7b48a5ei29AQ0CK2rg3fHZyhTJGPelCFkjilT8sniAUw162b2pPsONh1HMYS X-Received: by 2002:a17:906:dac9:b0:780:ab6f:591f with SMTP id xi9-20020a170906dac900b00780ab6f591fmr32861220ejb.77.1667541386455; Thu, 03 Nov 2022 22:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541386; cv=none; d=google.com; s=arc-20160816; b=c7ZzPA3FmYWwMaEbwRm9V2KTZ8XKvDblyYDQYJMqIRcb500yGfWH5tYSQ3ykhQ5S1N UT5WXmsSSyuqqJ9cZ6+C+b7RHlMcEK58rNwP3+WrKu++rRwk5NrY5SfV2AcgwDmsbb8k cMrVe6Fu/5Hj5exwq0SDv+nY0DkBhJSW0ZaS8CppyGB8umXD5EkybLxcsU/SeoNe5DHv mn1BJMsG0GitmdXFuGZEwxnrnnp1clrmQVHAYJ/X+YZA16eMQlqQAG0B9Fv8bqi3z9wl cC5UoyIEaaeroYmu7duQpvB0gydx0PaQ+uWEdbDd2mHOL6PkGIK8quzYHOiDvpDIAKXq k/jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=JJ9fxO0omKsekAH7yYD+vDpVhFhaomcxOn7O42ti/3o=; b=Pv0BYb9jnMDXpqCeKKv3tBjPOLxGLCCYa3cWL+Ds04LpKU2vQumsOBJkqzWmQIpxvB D7P2CLuDAJzmzq7S6D3VoSIFdVklBp3QgJNhq+sNW4W2qiuGQg/mHAgux1YDQ4cTw7IV Xr8zQN/gH6HleTgRxygY2YEY9UyMaO9H3jH4UUdpEm+/VVRFtkgcUdOkCVRTyFAQRzvR D8FCZLLr+7BVvdVkm7XVI6tAHB4+JkJpGit+UUqaXZUypjxirhKZRURBJ/3RpwGCPL1j Na0Sx5i6aq0Fg0QkqV5kJnlmflY2P2DDzaxJO0Oxwq31y0migtFi/yq+uFYNtwJAE1fs G6qQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e2-20020a50d4c2000000b00461d02225a3si3491030edj.448.2022.11.03.22.56.03; Thu, 03 Nov 2022 22:56:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231792AbiKDFu6 (ORCPT + 99 others); Fri, 4 Nov 2022 01:50:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231296AbiKDFsx (ORCPT ); Fri, 4 Nov 2022 01:48:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF49428714; Thu, 3 Nov 2022 22:48:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4D877620CE; Fri, 4 Nov 2022 05:48:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27F4BC43470; Fri, 4 Nov 2022 05:48:49 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZr-007191-2K; Fri, 04 Nov 2022 01:49:15 -0400 Message-ID: <20221104054915.557680781@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:13 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Greg Kroah-Hartman , Felipe Balbi , Johan Hovold , Alan Stern , Mathias Nyman , Kai-Heng Feng , Matthias Kaehlcke , Michael Grzeschik , Bhuvanesh Surachari , Dan Carpenter , linux-usb@vger.kernel.org Subject: [RFC][PATCH v3 20/33] timers: usb: Use timer_shutdown_sync() before freeing timer References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543876881157829?= X-GMAIL-MSGID: =?utf-8?q?1748543876881157829?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: Greg Kroah-Hartman Cc: Felipe Balbi Cc: Johan Hovold Cc: Alan Stern Cc: Mathias Nyman Cc: Kai-Heng Feng Cc: Matthias Kaehlcke Cc: Michael Grzeschik Cc: Bhuvanesh Surachari Cc: Dan Carpenter Cc: linux-usb@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- drivers/usb/gadget/udc/m66592-udc.c | 2 +- drivers/usb/serial/garmin_gps.c | 2 +- drivers/usb/serial/mos7840.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/udc/m66592-udc.c b/drivers/usb/gadget/udc/m66592-udc.c index 931e6362a13d..c7e421b449f3 100644 --- a/drivers/usb/gadget/udc/m66592-udc.c +++ b/drivers/usb/gadget/udc/m66592-udc.c @@ -1519,7 +1519,7 @@ static int m66592_remove(struct platform_device *pdev) usb_del_gadget_udc(&m66592->gadget); - del_timer_sync(&m66592->timer); + timer_shutdown_sync(&m66592->timer); iounmap(m66592->reg); free_irq(platform_get_irq(pdev, 0), m66592); m66592_free_request(&m66592->ep[0].ep, m66592->ep0_req); diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c index f1a8d8343623..670e942fdaaa 100644 --- a/drivers/usb/serial/garmin_gps.c +++ b/drivers/usb/serial/garmin_gps.c @@ -1405,7 +1405,7 @@ static void garmin_port_remove(struct usb_serial_port *port) usb_kill_anchored_urbs(&garmin_data_p->write_urbs); usb_kill_urb(port->interrupt_in_urb); - del_timer_sync(&garmin_data_p->timer); + timer_shutdown_sync(&garmin_data_p->timer); kfree(garmin_data_p); } diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 6b12bb4648b8..8a2d902a1c12 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c @@ -1726,7 +1726,7 @@ static void mos7840_port_remove(struct usb_serial_port *port) mos7840_set_led_sync(port, MODEM_CONTROL_REGISTER, 0x0300); del_timer_sync(&mos7840_port->led_timer1); - del_timer_sync(&mos7840_port->led_timer2); + timer_shutdown_sync(&mos7840_port->led_timer2); usb_kill_urb(mos7840_port->led_urb); usb_free_urb(mos7840_port->led_urb); From patchwork Fri Nov 4 05:41:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15350 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp190751wru; Thu, 3 Nov 2022 22:50:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM46HFSZUG4nYniUiZzuD3d2dEaNQRjKLuUWDAS+jxPnBZ5sHMA/GUb8klTCaynXPQa60XLP X-Received: by 2002:a17:907:3f25:b0:7ae:319c:90b2 with SMTP id hq37-20020a1709073f2500b007ae319c90b2mr2039970ejc.515.1667541059314; Thu, 03 Nov 2022 22:50:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541059; cv=none; d=google.com; s=arc-20160816; b=Hpp1cZYFW+AWBf5BwxnHcDHPCDKYOQbqFsE9SmTdd9jG7LMOzAq8wtLLWSeUnop23D 4njYgVrfFFZCrQuDrS6vnssGu+skjYByd9d05kURljN4Y3M42ZsanKM7gnVlVwbXPB9k gVPEBlUlRiI5vvuEK40ITczw/taE4h/H+3hjSmABV63OkTWCSPOpjJHyIjWVi86a0d9N lDe6HNVCS3OjUqoFgNcx6qWbtLthz/yNAqUjuXREtckbVClohX0d0+/MPvusVn53QNCR WdwrmKu7KaRWhbfB881pUHP+2ze/ZRsntSUHBFGF1J7qRo/PQ9anAgBk/cWv34oA9XpV lzsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=uuptwRIy9iXYPcblJUzE8V5+iyWdDoxiUboOeMuw4YI=; b=iXaghdbCHCZbxazx4qV3HZrn6DfdP4u8oWhyqn1DGEMYzn8ipBcFqemp7uqyYr9X82 RPpCj+QEa4+lgFX28iTCMvGg/tBEsp8hsFhFiSmzidgo5u3ii1wVyYFoANx3r6B9ijZQ zBLkJlFwly2xhyd6NbbZU0q7V+AcCdhKtTI9qV15dXitQ3Fwbpp5JliC9LKcJrzrD2sE GD8kyh+oNo21faJvPTrJl1oLBcT/F63ibJXgPFXgf+ax3COtnhu0s7ns+sDJmlXEHCSX 8eLcSzpHAQuKMF0KbDopY82K+B7HMrWTLXlWuxZpTh3r/mw574iOwMbVxNEvDsXDxGQj ykIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n26-20020a170906089a00b007adf388f2dasi3342198eje.497.2022.11.03.22.50.36; Thu, 03 Nov 2022 22:50:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231673AbiKDFtx (ORCPT + 99 others); Fri, 4 Nov 2022 01:49:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231331AbiKDFsx (ORCPT ); Fri, 4 Nov 2022 01:48:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79AEB27B15; Thu, 3 Nov 2022 22:48:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 78C06620C3; Fri, 4 Nov 2022 05:48:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5389EC43149; Fri, 4 Nov 2022 05:48:49 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZr-00719a-2v; Fri, 04 Nov 2022 01:49:15 -0400 Message-ID: <20221104054915.739076753@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:14 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Tejun Heo , Zefan Li , Johannes Weiner , cgroups@vger.kernel.org Subject: [RFC][PATCH v3 21/33] timers: cgroup: Use timer_shutdown_sync() before freeing timer References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543533570497117?= X-GMAIL-MSGID: =?utf-8?q?1748543533570497117?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: Tejun Heo Cc: Zefan Li Cc: Johannes Weiner Cc: cgroups@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- kernel/cgroup/cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index 2319946715e0..e0c59a3b52e5 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -1687,7 +1687,7 @@ static void cgroup_rm_file(struct cgroup *cgrp, const struct cftype *cft) cfile->kn = NULL; spin_unlock_irq(&cgroup_file_kn_lock); - del_timer_sync(&cfile->notify_timer); + timer_shutdown_sync(&cfile->notify_timer); } kernfs_remove_by_name(cgrp->kn, cgroup_file_name(cgrp, cft, name)); From patchwork Fri Nov 4 05:41:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15348 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp190709wru; Thu, 3 Nov 2022 22:50:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4N23/RsALCE44lQLwbGIubbquBGrMGtjBytmRCK/t4uh7VB8ed4nZYDhDThhF5wAh/yszy X-Received: by 2002:a17:907:da5:b0:7ad:7e95:6513 with SMTP id go37-20020a1709070da500b007ad7e956513mr33736688ejc.442.1667541052814; Thu, 03 Nov 2022 22:50:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541052; cv=none; d=google.com; s=arc-20160816; b=EiUYsqx7uRhcd33AeuN/xjSfHDIQ5MxYSb0iVZyXkKYJrD+LWKtsY4Dwr+hr9T3RUr DiWYbDvBxoWeWC8rrxDd9GAGgWmkZ1VFj+8f3bnTeDQOMX0AiklH2zWz1BWB1t08uecT 6r7xQgaNVilYm3SijXAxO2wfAl2imfWokp/gKTek0y2+k/QptQVVrv2dvXO+fQ7lbzA3 CkRTbRa5Si4md5kTzOKdCG0Kyds71iqx9EgCpw8YRP7mgwzYEQ4q7LqPek54Ye6OllDZ BUSccs6NKqF2XS2Rra0zL30RXS2+IeehqvU56zf4PxDvIeLub6C8728Z4LBi3BnPV6JK vkDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=59qOdfmDsBXIl7+eDWBhmGviLWoRBArZUBCIYlDSf5w=; b=oQsBvRMJiMyaRPHCDkLkppkQoLvmBT1r5ak88itg5Fq/okn6yaGOmHtKX2iHlVQzKZ OZRWP691RrxRLT2S1HRkaIymTbSrFekmeGftAb08iC7GwRMRGA3ytc48olbqZs2vacZE Ki4QhtPAPmtBxUJXwA9F2Gdw7Y6Kllhfl+p4nA0D/8/FmHKYKeyl6e6izuHFaJzE9KQ5 MWXSxO76xWw0a5gHutvW+3l22+TMbwoiMRtKaqBuurhDWxFnvwZ1i5P8eCnB4IFlx4Rt rqLD/2hwn1OvABDbP9EVCKZGTAKKaYN2Ak8SZxF4uVXlRcftDszQSNR9SZvrDalbCzXw ZHXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rp20-20020a170906d97400b0078db6f5f4b2si3034119ejb.546.2022.11.03.22.50.29; Thu, 03 Nov 2022 22:50:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231580AbiKDFtp (ORCPT + 99 others); Fri, 4 Nov 2022 01:49:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231334AbiKDFsx (ORCPT ); Fri, 4 Nov 2022 01:48:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79B4027B1E for ; Thu, 3 Nov 2022 22:48:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A3A68620C5 for ; Fri, 4 Nov 2022 05:48:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FC75C43148; Fri, 4 Nov 2022 05:48:49 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZs-0071A9-0G; Fri, 04 Nov 2022 01:49:16 -0400 Message-ID: <20221104054915.920808490@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:15 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Tejun Heo , Lai Jiangshan Subject: [RFC][PATCH v3 22/33] timers: workqueue: Use timer_shutdown_sync() before freeing timer References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543526841704981?= X-GMAIL-MSGID: =?utf-8?q?1748543526841704981?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: Tejun Heo Cc: Lai Jiangshan Signed-off-by: Steven Rostedt (Google) --- kernel/workqueue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 7cd5f5e7e0a1..2bbea15be4c8 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -3608,8 +3608,8 @@ static void put_unbound_pool(struct worker_pool *pool) wait_for_completion(pool->detach_completion); /* shut down the timers */ - del_timer_sync(&pool->idle_timer); - del_timer_sync(&pool->mayday_timer); + timer_shutdown_sync(&pool->idle_timer); + timer_shutdown_sync(&pool->mayday_timer); /* RCU protected to allow dereferences from get_work_pool() */ call_rcu(&pool->rcu, rcu_free_pool); From patchwork Fri Nov 4 05:41:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15355 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp190901wru; Thu, 3 Nov 2022 22:51:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5mgKhVSi0G6lhk8Gcir6bDwKVQmgGiO7yiSV+4chfoW7RY8CY4+I0i6Nn9NIiVu8KPGwz9 X-Received: by 2002:a17:906:7843:b0:7ad:e82b:b635 with SMTP id p3-20020a170906784300b007ade82bb635mr20306978ejm.23.1667541084198; Thu, 03 Nov 2022 22:51:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541084; cv=none; d=google.com; s=arc-20160816; b=FCMFEVZm/PP9C9Cm3X0iPbrzGUf/at6UlgDkH2aDs2dcKWeMGjFcMJs2iEaFxtHBFH LmmRUCn6jpTy3HQreztvdpAvc+iTqZCCXED2XK4CZ7jz0MmUQ6g5FrGnIy2ikVrU2whK h0Bn1eJQpH0CHSlDReNfi4TZ2Qm/rSiubpFgB5faMFn4fYO+BsuGzq26o5gt/wOCTApO OeHyo2/CsOlCj7ox+HfoHzvqbRY+IIVln218+v2IX9ZLxVgbJ8d8j+uuftShK2r5mYes Mespqv65cDUr9AmRIU3viix4bq9D+1Ov7wLMa6Rx6DHgL7WSJh1S4zyT/r46VLXjMK50 PRCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=m8HNETkpn845osFw8xl708Ndgl2nta7D6wQfim51cak=; b=my5VG+qy2Nb832D75BqyYvt3gY/LcZuWlhT2pdmsEETg4nCs+9q8FIuCK3CMGV9g9q fxTahBcyXgLPia+2MkWxDlFgs8VclRAIQnlzZ5JitonH6j4TRosdgAgJhNBazSL8fB/q Zu6jMJRHkT7mOx99ZAFwAS/9yGeU+31t/M/SeTflDy5oMFJFdO3JX5+BxX0ZdYK1TR3V qyaU2H9ipK0cUdvEQ2+wZe+hp6c6ux4TE1wt0L6eaJuqKrZYgqz7nUyGh0uJ19SOonCa 0w/kAUns1AZhdg/CdbqAFHhVEFwR1GmP8ZDhmXnR9Ff+wddNtOj9Z5XK4KXgcqBvDQNv 8svg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s21-20020a508d15000000b0045cd7614e59si3653614eds.451.2022.11.03.22.50.59; Thu, 03 Nov 2022 22:51:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231475AbiKDFuO (ORCPT + 99 others); Fri, 4 Nov 2022 01:50:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231343AbiKDFsy (ORCPT ); Fri, 4 Nov 2022 01:48:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E50E27B2A; Thu, 3 Nov 2022 22:48:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CD41F620D3; Fri, 4 Nov 2022 05:48:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9491C4314D; Fri, 4 Nov 2022 05:48:49 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZs-0071Ai-0q; Fri, 04 Nov 2022 01:49:16 -0400 Message-ID: <20221104054916.096085393@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:16 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Krzysztof Kozlowski , "David S. Miller" , Dan Carpenter , Chengfeng Ye , Lin Ma , Duoming Zhou , netdev@vger.kernel.org Subject: [RFC][PATCH v3 23/33] timers: nfc: pn533: Use timer_shutdown_sync() before freeing timer References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543559939155524?= X-GMAIL-MSGID: =?utf-8?q?1748543559939155524?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: Krzysztof Kozlowski Cc: "David S. Miller" Cc: Dan Carpenter Cc: Chengfeng Ye Cc: Lin Ma Cc: Duoming Zhou Cc: netdev@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- drivers/nfc/pn533/pn533.c | 2 +- drivers/nfc/pn533/uart.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nfc/pn533/pn533.c b/drivers/nfc/pn533/pn533.c index d9f6367b9993..0a1d0b4e3bb8 100644 --- a/drivers/nfc/pn533/pn533.c +++ b/drivers/nfc/pn533/pn533.c @@ -2788,7 +2788,7 @@ void pn53x_common_clean(struct pn533 *priv) struct pn533_cmd *cmd, *n; /* delete the timer before cleanup the worker */ - del_timer_sync(&priv->listen_timer); + timer_shutdown_sync(&priv->listen_timer); flush_delayed_work(&priv->poll_work); destroy_workqueue(priv->wq); diff --git a/drivers/nfc/pn533/uart.c b/drivers/nfc/pn533/uart.c index 07596bf5f7d6..a556acdb947b 100644 --- a/drivers/nfc/pn533/uart.c +++ b/drivers/nfc/pn533/uart.c @@ -310,7 +310,7 @@ static void pn532_uart_remove(struct serdev_device *serdev) pn53x_unregister_nfc(pn532->priv); serdev_device_close(serdev); pn53x_common_clean(pn532->priv); - del_timer_sync(&pn532->cmd_timeout); + timer_shutdown_sync(&pn532->cmd_timeout); kfree_skb(pn532->recv_skb); kfree(pn532); } From patchwork Fri Nov 4 05:41:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15357 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp190942wru; Thu, 3 Nov 2022 22:51:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7NTSjKRHuTxyzgCE7iAufmvdW1g6L0vnlJJdpp2iHJWCBVK2ZBqk45WLXWZBiAtqy5bdSt X-Received: by 2002:a17:906:3287:b0:78d:8877:d50f with SMTP id 7-20020a170906328700b0078d8877d50fmr33196283ejw.486.1667541092952; Thu, 03 Nov 2022 22:51:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541092; cv=none; d=google.com; s=arc-20160816; b=1AQcs32rKvZvyKvHYvMIr6tb8o3x0edLGTg2/DT+P9AtwWE6zFeA8Xc5np+oloRu6e tdMMyatjSrq+0+GO4YhesB5H/r6SFyG6YVwp030rO7G1IdU/gccaXRe9+/3Nz3FAh7SR 27Hx3X7k2cW12mxJ7x6Gk/J86Ud3BbIHrCGPb9OY6RkLr6Q/KtqQ0FEexBp2lkKzJlII ShHlr2ofsW48oAxS3xiJrueLQl5drZ4zD4BA5JqeDElcSqty8tdngENZt+/+JETrpc+N e9IZQCXUw6GkoZzN7XJoroh8695C+CSoN0voS/NhvSVnzfo7f9fTTYSexClz9TAxXxhb NXBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=YmQyhj+owAAshOXGnJaRE/T83XR6a7WIToFwZzMQbbw=; b=Hrlt8yPIgcD4CVdz51AyNGLhwRbk8jjQTkiS0iJN/0u1xsskS7CUMvPxBiQYyOyUjn z8YEMX28Rkw+tcjYUjtbb3f0qBd2YhkXv2TVAWstZmXXryIM37inmW6fHCC2TUdpSbNA LbPwIC3dfqyCZ7U9cYwUEEcZNZi0Jdpylrs//6x3MaMen6FyjeiztJ2o4yEuP16vJd8N Kh1wT3BvackR1MiuIzDpRgqCr3Ig+6TIzQxgenTvUt7lc6/zwQsxG23b1jGU9PFlxRFt y0NvOI3V14pIQDPCA5fIc70iQi71V9NTWNEMs8brmBI1fr0sSdJtaLi/7t9RStPfXVm6 40OA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o3-20020aa7c503000000b004549b880c67si3043407edq.42.2022.11.03.22.51.09; Thu, 03 Nov 2022 22:51:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231766AbiKDFua (ORCPT + 99 others); Fri, 4 Nov 2022 01:50:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231349AbiKDFsy (ORCPT ); Fri, 4 Nov 2022 01:48:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EF6D28E06 for ; Thu, 3 Nov 2022 22:48:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0CE71620D5 for ; Fri, 4 Nov 2022 05:48:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D89B8C4314F; Fri, 4 Nov 2022 05:48:49 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZs-0071BH-1R; Fri, 04 Nov 2022 01:49:16 -0400 Message-ID: <20221104054916.279744019@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:17 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Minghao Chi , Tony Lindgren , Arnd Bergmann , Cai Huoqing , "Paul E. McKenney" , Dominik Brodowski Subject: [RFC][PATCH v3 24/33] timers: pcmcia: Use timer_shutdown_sync() before freeing timer References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543569154961955?= X-GMAIL-MSGID: =?utf-8?q?1748543569154961955?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: Minghao Chi Cc: Tony Lindgren Cc: Arnd Bergmann Cc: "Souptick Joarder Cc: Cai Huoqing Cc: "Paul E. McKenney" Acked-by: Dominik Brodowski Signed-off-by: Steven Rostedt (Google) --- drivers/pcmcia/bcm63xx_pcmcia.c | 2 +- drivers/pcmcia/electra_cf.c | 2 +- drivers/pcmcia/omap_cf.c | 2 +- drivers/pcmcia/pd6729.c | 4 ++-- drivers/pcmcia/yenta_socket.c | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/pcmcia/bcm63xx_pcmcia.c b/drivers/pcmcia/bcm63xx_pcmcia.c index bb06311d0b5f..dd3c26099048 100644 --- a/drivers/pcmcia/bcm63xx_pcmcia.c +++ b/drivers/pcmcia/bcm63xx_pcmcia.c @@ -443,7 +443,7 @@ static int bcm63xx_drv_pcmcia_remove(struct platform_device *pdev) struct resource *res; skt = platform_get_drvdata(pdev); - del_timer_sync(&skt->timer); + timer_shutdown_sync(&skt->timer); iounmap(skt->base); iounmap(skt->io_base); res = skt->reg_res; diff --git a/drivers/pcmcia/electra_cf.c b/drivers/pcmcia/electra_cf.c index 40a5cffe24a4..efc27bc15152 100644 --- a/drivers/pcmcia/electra_cf.c +++ b/drivers/pcmcia/electra_cf.c @@ -317,7 +317,7 @@ static int electra_cf_remove(struct platform_device *ofdev) cf->active = 0; pcmcia_unregister_socket(&cf->socket); free_irq(cf->irq, cf); - del_timer_sync(&cf->timer); + timer_shutdown_sync(&cf->timer); iounmap(cf->io_virt); iounmap(cf->mem_base); diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c index d3f827d4224a..e613818dc0bc 100644 --- a/drivers/pcmcia/omap_cf.c +++ b/drivers/pcmcia/omap_cf.c @@ -296,7 +296,7 @@ static int __exit omap_cf_remove(struct platform_device *pdev) cf->active = 0; pcmcia_unregister_socket(&cf->socket); - del_timer_sync(&cf->timer); + timer_shutdown_sync(&cf->timer); release_mem_region(cf->phys_cf, SZ_8K); free_irq(cf->irq, cf); kfree(cf); diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c index f0af9985ca09..a0a2e7f18356 100644 --- a/drivers/pcmcia/pd6729.c +++ b/drivers/pcmcia/pd6729.c @@ -727,7 +727,7 @@ static int pd6729_pci_probe(struct pci_dev *dev, if (irq_mode == 1) free_irq(dev->irq, socket); else - del_timer_sync(&socket->poll_timer); + timer_shutdown_sync(&socket->poll_timer); err_out_free_res: pci_release_regions(dev); err_out_disable: @@ -754,7 +754,7 @@ static void pd6729_pci_remove(struct pci_dev *dev) if (irq_mode == 1) free_irq(dev->irq, socket); else - del_timer_sync(&socket->poll_timer); + timer_shutdown_sync(&socket->poll_timer); pci_release_regions(dev); pci_disable_device(dev); diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index 3966a6ceb1ac..1365eaa20ff4 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c @@ -814,7 +814,7 @@ static void yenta_close(struct pci_dev *dev) if (sock->cb_irq) free_irq(sock->cb_irq, sock); else - del_timer_sync(&sock->poll_timer); + timer_shutdown_sync(&sock->poll_timer); iounmap(sock->base); yenta_free_resources(sock); @@ -1285,7 +1285,7 @@ static int yenta_probe(struct pci_dev *dev, const struct pci_device_id *id) if (socket->cb_irq) free_irq(socket->cb_irq, socket); else - del_timer_sync(&socket->poll_timer); + timer_shutdown_sync(&socket->poll_timer); unmap: iounmap(socket->base); yenta_free_resources(socket); From patchwork Fri Nov 4 05:41:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15358 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp191003wru; Thu, 3 Nov 2022 22:51:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6NzxzXGg2kBJf0/RKPcNiOx2Bh1qe7Sk9j7hzj3V04r0TuqFnN7O/5lXx6cyhHxk24OGMH X-Received: by 2002:a05:6402:538a:b0:457:b602:d5a6 with SMTP id ew10-20020a056402538a00b00457b602d5a6mr34104591edb.371.1667541102915; Thu, 03 Nov 2022 22:51:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541102; cv=none; d=google.com; s=arc-20160816; b=xu9784dyHqfHosOf+4xBx0zh8D51iRSmOW9XvPP4FyDImM4GPM1ULFNJiAynkM/56b xucZEHTAdzUIRLj7I4zr6RJ0Qj0FKhRS7h8SMHi+EamokCimMf97QuMocSC9au9cnc+y Hqg6Fb0QeGn5qkFFurXHIcNKeAfSSb0943Jj7y/5NHwzibireqVu8iTHstl8JImcE8un OLvOcnah18PdKdiY2pOI+M1+PXfGlcvrJxMF9yoGUCs4YFXaOuTqA5w/uo8FtIlOZ7ZZ qm7wH+ZZliRfOqkMtLmbk2fFzn4bxi/LyT0pP/suzK0n7s0WNPSrqoSYnYmlBtAjQJXx EWGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=y5hrpxydxaq7frZ5MPLWOI4xtqSeRCXbT7tKcuIKCjM=; b=ySJTlp5UnbszC28lwBjy7CfSwt4+F0sltROgcnFGRCaiTEsLZv8qmHKKRfHCedgfX6 lKF/b6Y0uwv8vQCGMmj1JKRtvfmyWwuyf51p7gB1pP3C1oX4kyM3NdKRFVIiOLLPr7Ap eAltkMnjbzLTMz1tvhzdgnGMzeeEOdEK1RDUZlvb/Q1yzSogSS+IlFX8zpHv2nmChFSD frznZ0na5jV+VxsUlEeJGFg4HZgIRQZO3MUCoj99Hq58x/YWmx2s4w1foUaERWxsqEll UtuGTgz7zZbhVDpM8S6pX5T53t9WUiw0yM2GRn2xpdiXIhGzaM8aD2kpi3Pfkc4QjhDt PTRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i9-20020a1709064fc900b0078badb3816dsi4209212ejw.952.2022.11.03.22.51.19; Thu, 03 Nov 2022 22:51:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231772AbiKDFue (ORCPT + 99 others); Fri, 4 Nov 2022 01:50:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231339AbiKDFsy (ORCPT ); Fri, 4 Nov 2022 01:48:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E86B28E00; Thu, 3 Nov 2022 22:48:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3EBBF620D9; Fri, 4 Nov 2022 05:48:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B239C433C1; Fri, 4 Nov 2022 05:48:50 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZs-0071Bq-22; Fri, 04 Nov 2022 01:49:16 -0400 Message-ID: <20221104054916.464295277@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:18 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Nilesh Javali , GR-QLogic-Storage-Upstream@marvell.com, "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org Subject: [RFC][PATCH v3 25/33] timers: scsi: Use timer_shutdown_sync() and timer_shutdown() before freeing timer References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543579331716516?= X-GMAIL-MSGID: =?utf-8?q?1748543579331716516?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called, or timer_shutdown() if it's already known that the timer is disabled. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: Nilesh Javali Cc: GR-QLogic-Storage-Upstream@marvell.com Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- drivers/scsi/qla2xxx/qla_edif.c | 4 ++-- drivers/scsi/scsi_lib.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_edif.c b/drivers/scsi/qla2xxx/qla_edif.c index 00ccc41cef14..7f3a3c8673b5 100644 --- a/drivers/scsi/qla2xxx/qla_edif.c +++ b/drivers/scsi/qla2xxx/qla_edif.c @@ -416,7 +416,7 @@ static void __qla2x00_release_all_sadb(struct scsi_qla_host *vha, */ if (edif_entry->delete_sa_index != INVALID_EDIF_SA_INDEX) { - del_timer(&edif_entry->timer); + timer_shutdown_sync(&edif_entry->timer); /* build and send the aen */ fcport->edif.rx_sa_set = 1; @@ -2799,7 +2799,7 @@ qla28xx_sa_update_iocb_entry(scsi_qla_host_t *v, struct req_que *req, "%s: removing edif_entry %p, new sa_index: 0x%x\n", __func__, edif_entry, pkt->sa_index); qla_edif_list_delete_sa_index(sp->fcport, edif_entry); - del_timer(&edif_entry->timer); + timer_shutdown_sync(&edif_entry->timer); ql_dbg(ql_dbg_edif, vha, 0x5033, "%s: releasing edif_entry %p, new sa_index: 0x%x\n", diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 8b89fab7c420..e6cd1efb9eca 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -558,6 +558,7 @@ static bool scsi_end_request(struct request *req, blk_status_t error, */ destroy_rcu_head(&cmd->rcu); + timer_shutdown(&cmd->abort_work.timer); /* * In the MQ case the command gets freed by __blk_mq_end_request, * so we have to do all cleanup that depends on it earlier. From patchwork Fri Nov 4 05:41:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15361 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp191252wru; Thu, 3 Nov 2022 22:52:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7pSsTh9tRjhp0V0Xj0r9JMXPN0UuK9+KTpzaxArwsrtJ8xVtjn75SIeyHQyqgWKzX+m0V6 X-Received: by 2002:a05:6402:1cb0:b0:463:5904:d0fd with SMTP id cz16-20020a0564021cb000b004635904d0fdmr26188839edb.302.1667541157065; Thu, 03 Nov 2022 22:52:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541157; cv=none; d=google.com; s=arc-20160816; b=VSfyks+ptowizDAW/iYwAvdTKG9KSbMCMoOQbYen0Q3EgkzZCBxWdkVQZEr3R1OfMn U14fyMdR8EnxmnFuzMi0yTri4hpZq/hJwRnBnsGQpfLGzPR2oX06t+nUx30lJNwpbDvH IqH/SP+/fD2HAJE9htAWxEaUTH0XG5No5Z+jFh9bIsYzNavg7WcZv27Bc5IcVRdjsWPk /U2+XHTmAE9fpHXo2HNcTJs3qcRL6mmyb7fmxEycO69MT1yyHBdIkdvzQFs486/GjoyQ RUQ+No9BII1myr7x0MIUmnniwiFePIte2HHFo+XzSSlremQzNLspCvlv2MYR+5cuQPVS 6RGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=LpANLnNtMR45ZcQCmmjdgA2Lr6XdEWm9SbTLGCGfjWE=; b=ZWey0FVCqs16+Hed/kgIBaxhxeXrpi8dXhXbQupgA3qY+LpsXVkvnZFb9T8FuhwdYa u+EhqFwx4tXvmjPjgY5FsoF5iIXheaNuUYHvYJTvCtVP8+h74oB5EXHeUpjgbDvwWJji 1gWgeUIrnzqb8RwOU04JGH7ylEAyl0sepG9QWoUJU1cKyl4YvQ06T2Mqfu0atPkfmHDo X+uErViqeIG8l3/g5K1HqbRuD/8l2bWG7EEAzuVYC05hA60Xe1kyQBKFWl42fRjjPmEE aZt/AWXmvswkWKQa2+3tQft3aKCpl2BNJca4bpJBlXzv/dcjgsGGqxp/3UvQKBc75LDc Mw4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sb42-20020a1709076daa00b0073d71124609si3322188ejc.182.2022.11.03.22.52.13; Thu, 03 Nov 2022 22:52:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231347AbiKDFul (ORCPT + 99 others); Fri, 4 Nov 2022 01:50:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231346AbiKDFsy (ORCPT ); Fri, 4 Nov 2022 01:48:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EA0728E03 for ; Thu, 3 Nov 2022 22:48:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 699FD620BE for ; Fri, 4 Nov 2022 05:48:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45474C433D7; Fri, 4 Nov 2022 05:48:50 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZs-0071CO-2b; Fri, 04 Nov 2022 01:49:16 -0400 Message-ID: <20221104054916.648628562@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:19 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Greg Kroah-Hartman , Jiri Slaby Subject: [RFC][PATCH v3 26/33] timers: tty: Use timer_shutdown_sync() before freeing timer References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543636349987039?= X-GMAIL-MSGID: =?utf-8?q?1748543636349987039?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: Greg Kroah-Hartman Cc: Jiri Slaby Signed-off-by: Steven Rostedt (Google) --- drivers/tty/n_gsm.c | 2 +- drivers/tty/sysrq.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 5e516f5cac5a..6f48adecd1d4 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -2098,7 +2098,7 @@ static void gsm_dlci_free(struct tty_port *port) { struct gsm_dlci *dlci = container_of(port, struct gsm_dlci, port); - del_timer_sync(&dlci->t1); + timer_shutdown_sync(&dlci->t1); dlci->gsm->dlci[dlci->addr] = NULL; kfifo_free(&dlci->fifo); while ((dlci->skb = skb_dequeue(&dlci->skb_list))) diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c index d2b2720db6ca..b6e70c5cfa17 100644 --- a/drivers/tty/sysrq.c +++ b/drivers/tty/sysrq.c @@ -1003,7 +1003,7 @@ static void sysrq_disconnect(struct input_handle *handle) input_close_device(handle); cancel_work_sync(&sysrq->reinject_work); - del_timer_sync(&sysrq->keyreset_timer); + timer_shutdown_sync(&sysrq->keyreset_timer); input_unregister_handle(handle); kfree(sysrq); } From patchwork Fri Nov 4 05:41:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15359 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp191135wru; Thu, 3 Nov 2022 22:52:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Ve65u1CEsNLSh82ZkZKAg8FztYyC+CF/luFsuj2WRRZKNoWW0ETzbi59mqBLhB65wKLQ7 X-Received: by 2002:a17:906:1252:b0:7ad:8f76:17c7 with SMTP id u18-20020a170906125200b007ad8f7617c7mr241002eja.315.1667541129535; Thu, 03 Nov 2022 22:52:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541129; cv=none; d=google.com; s=arc-20160816; b=tbEc7zBI1jWY1rZMqdk9n9gRjlx+8I0NSUQDAW8LZ/sQGozJ87VL5mp6GupK7PWtHx j/J3PmUmIpLd23DrNN2UFP2aI6zxfPQviPXQpyu+mSBO7bm5YgI3eivIC5n5W+zr2JSr 1XVEp7WJbwV8tRe+kEx7dAxnmc0bklb5OWe6ieDaanutojhvOHDJdBjFu6Nb85Rdjo20 8wzmvZivNKddi/kH+B2zoNwj9s3eqnWUeLFg+EDiEwCVGoGEBy9nKbHnj6vZuHUzUZm6 0q08lUQRncZsPvnCbYlFLvd3LtZClKsvMZK0CEZJXfExoG95PQpQqUkq9T7QPx1JndUg Heag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=iaYjjqPOtJYI6z/6ICezKT8a8v5wbCspgI51zUD4D5g=; b=0fSWyGmxBe020YOsUsT3hfwA3LhwSiOTUUO9xR/0aXKOh5x8+x11Ban0+op7VrqFO7 TO9noffwvK2fjjScqTyqsl2+wwd96P81aUFFJ3/mAwPGKK0dXes58Uw2WclKyzCVkWtV 5z2PYXbg1iWVLbUovEOnMvzy4qbe8UAJxCIPPA0CcwlWKt7PcSRX2NCpx9m4rmgrpF+O DbVImqmO0pca3NaM69tqytvq8ZqGzpKEad2E8jKdWC1hWQ2mLZXPxG2k6nEuRuLke/Hc cms9WtzPGUuMBFTv9zDQB2O/bKCCeO57Ws7pR29rq/Ggn1ePDQKTGu+SIiauFEJ7tavA bwZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q18-20020a056402519200b00462bd784df2si4009452edd.542.2022.11.03.22.51.45; Thu, 03 Nov 2022 22:52:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231649AbiKDFui (ORCPT + 99 others); Fri, 4 Nov 2022 01:50:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231347AbiKDFsy (ORCPT ); Fri, 4 Nov 2022 01:48:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F66A27B30; Thu, 3 Nov 2022 22:48:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 93F99620DF; Fri, 4 Nov 2022 05:48:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F669C43141; Fri, 4 Nov 2022 05:48:50 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZs-0071Cy-3C; Fri, 04 Nov 2022 01:49:16 -0400 Message-ID: <20221104054916.827422353@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:20 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , linux-ext4@vger.kernel.org Subject: [RFC][PATCH v3 27/33] timers: ext4: Use timer_shutdown_sync() before freeing timer References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543607349521656?= X-GMAIL-MSGID: =?utf-8?q?1748543607349521656?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc :"Theodore Ts'o" Cc :Andreas Dilger Cc: linux-ext4@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- fs/ext4/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 7950904fbf04..f54ed936d800 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -1225,7 +1225,7 @@ static void ext4_put_super(struct super_block *sb) } ext4_es_unregister_shrinker(sbi); - del_timer_sync(&sbi->s_err_report); + timer_shutdown_sync(&sbi->s_err_report); ext4_release_system_zone(sb); ext4_mb_release(sb); ext4_ext_release(sb); From patchwork Fri Nov 4 05:41:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15362 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp191653wru; Thu, 3 Nov 2022 22:54:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4OkZ7t/HBxjhQ8gc7+RqnPm68hZEdUiQi7BpNTos1iW1Gtd79h9Qye5SbFvHzQdYIzm/W3 X-Received: by 2002:a17:907:7633:b0:7ad:df69:8abc with SMTP id jy19-20020a170907763300b007addf698abcmr22951131ejc.189.1667541243799; Thu, 03 Nov 2022 22:54:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541243; cv=none; d=google.com; s=arc-20160816; b=bUGdZL2osmAK68cRUZh3OWI/aXUWpf1nJEesFLPNf1Ocb8e/6F+zZwVt2XZkYoVjrl lHtxOH7nVAGwPcYy33TD3YPkzigLyvog0Wi0rG1qxN7NLnIhVq4a/26mmU1EiTGuqxg0 cwoiAZ7ciLPcxM+gT9ctOkfsfvdNmjsEq11X2W1MRtJ8nx6iONduCrrNcgUkJu9vjIuD vUQ3C8prnX/+HDC5sg/QiHOjsn0rfBvsbrFf51dBkFHwBELk+QnKWAuf7vbkNi4gz3vQ Eaan+5XIrkuwwNVnsUdST6efUapkdiagr3/7MoK78/RVPqVIPR0yeBq6XajM5mYkt2/Z fADA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=v9WGMDWBQsiNM215VQeVdRMrnbLfSyiJ0+LKji4u86M=; b=BD7X+ARR86STWBxojYd4LYhrKa8KW4/4GgnBkXTys4Mjtrs587pAt/jibkMHcUa0SI NZdW2DelDUc29kJUtoaumI2IvZLlxrCIf+dpSCguFqWPrVC7hAuf5/7Lqqhw2M7/WjWh SK8N+6s/UKYosS8rCjwJ8j7wyMTw2q3zS38xnQfSSg6W0EIgxW7jmYHXc50XUDbSo0Rg EclFErCk6fxBnOVbxk5FARC0ritPdiytHNRkhHLs1vbh11wceczlt1EfnM7ozytIWVT2 AOWEz+iAyJFC2DkdHpFgjTvK1J9/pYAqIYid3j+Q+apWbFkV5xcAp8gZqWn3Shcza9R6 BSVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ba9-20020a0564021ac900b0045ddb2076casi3509496edb.177.2022.11.03.22.53.39; Thu, 03 Nov 2022 22:54:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231394AbiKDFuq (ORCPT + 99 others); Fri, 4 Nov 2022 01:50:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231354AbiKDFsy (ORCPT ); Fri, 4 Nov 2022 01:48:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F72A28E09; Thu, 3 Nov 2022 22:48:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B93FA620E5; Fri, 4 Nov 2022 05:48:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 960B6C433D6; Fri, 4 Nov 2022 05:48:50 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZt-0071Da-0X; Fri, 04 Nov 2022 01:49:17 -0400 Message-ID: <20221104054917.009383303@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:21 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Ryusuke Konishi , linux-nilfs@vger.kernel.org Subject: [RFC][PATCH v3 28/33] timers: fs/nilfs2: Use timer_shutdown_sync() before freeing timer References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543727288933581?= X-GMAIL-MSGID: =?utf-8?q?1748543727288933581?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: Ryusuke Konishi Cc: linux-nilfs@vger.kernel.org Signed-off-by: Steven Rostedt (Google) Acked-by: Ryusuke Konishi --- fs/nilfs2/segment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index b4cebad21b48..c50dc377da26 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c @@ -2752,7 +2752,7 @@ static void nilfs_segctor_destroy(struct nilfs_sc_info *sci) down_write(&nilfs->ns_segctor_sem); - del_timer_sync(&sci->sc_timer); + timer_shutdown_sync(&sci->sc_timer); kfree(sci); } From patchwork Fri Nov 4 05:41:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15356 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp190910wru; Thu, 3 Nov 2022 22:51:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6rP+b16Q9CySLN/hfcK/jCtVUxo/CZcbIF3+WpxTuKtMM6A2+A7IV13sHf7efrlFm24/0q X-Received: by 2002:a05:6402:5296:b0:461:b6e5:ea63 with SMTP id en22-20020a056402529600b00461b6e5ea63mr33802455edb.248.1667541085855; Thu, 03 Nov 2022 22:51:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541085; cv=none; d=google.com; s=arc-20160816; b=zCUB/ofqoxcD/tkNdmZltz33pXU9mN43fEU9DplPIhTKQcWb7oBjuNW2caicHCgQ9+ iCgWs7UOL8qrjqNWQcrzo6Tc3oJA7C+4QuVh/fDB7X9583kAcAaLqboND5wjsMB2azRq 3m1b91bXnAnHv3U81/VmLw8yJ1fBjeFTH0/SWzZbp+1EQgE1GtttRn1NLxmtV4RAlap8 eVg8UApjNNGak0syjd0otzW6tXF4UHSyhGXnRqrjbU5DQT9/aAfIciVbAY3DQELXvLZ6 iLQ/aXRMJSoFP1E8pDUL50Iz7kGl+LDdpqL2Cq2t05AqJ1KkI6EIrdggVPI9MpEQi+Cf YN2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=EkndezTUktA6Z6gGptsmErohFQ2EVqk5/96mO2A+9HE=; b=T37u4Za581a930SM8qgwwAaUihqLN1kPYF9+a6ySHHI4EPgG2n94A5lpc3njC/f0w9 bSrzIKEo92Em08ZsI798io6a81eluzj1v4FmaVj9eONkN59iecBW0l2Xf57hOg80XrbC LrnEWQCyOzatXwXXdtqKAeLkXB0Ua25TrD9sTnknEe+lUG7xp4mgnXVSE2Rv8soWRMwv CanqKt38nUS7SvMu8RyOw994PfIb6A9T7C4ZIJSXcSH+7fVIOV6c9s+9hyLBNrmEINJY my+PHBemoETkXO9Kj57EQiC+Y45fn9vUIQIOgk1xUbHB4S5/6SwaPHq0SDHfYDmTz5hq yVSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m18-20020a056402511200b004574154f09asi3247664edd.529.2022.11.03.22.51.02; Thu, 03 Nov 2022 22:51:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231759AbiKDFuX (ORCPT + 99 others); Fri, 4 Nov 2022 01:50:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231364AbiKDFsy (ORCPT ); Fri, 4 Nov 2022 01:48:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4561328E0C for ; Thu, 3 Nov 2022 22:48:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E4906620DD for ; Fri, 4 Nov 2022 05:48:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C02EBC433C1; Fri, 4 Nov 2022 05:48:50 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZt-0071E9-17; Fri, 04 Nov 2022 01:49:17 -0400 Message-ID: <20221104054917.188768105@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:22 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Jaroslav Kysela , Takashi Iwai , Austin Kim , alsa-devel@alsa-project.org Subject: [RFC][PATCH v3 29/33] timers: ALSA: Use timer_shutdown_sync() before freeing timer References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543561554307993?= X-GMAIL-MSGID: =?utf-8?q?1748543561554307993?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: Austin Kim Cc: alsa-devel@alsa-project.org Signed-off-by: Steven Rostedt (Google) Reviewed-by: Takashi Iwai --- sound/i2c/other/ak4117.c | 2 +- sound/synth/emux/emux.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/i2c/other/ak4117.c b/sound/i2c/other/ak4117.c index 1bc43e927d82..640501bb3ca6 100644 --- a/sound/i2c/other/ak4117.c +++ b/sound/i2c/other/ak4117.c @@ -47,7 +47,7 @@ static void reg_dump(struct ak4117 *ak4117) static void snd_ak4117_free(struct ak4117 *chip) { - del_timer_sync(&chip->timer); + timer_shutdown_sync(&chip->timer); kfree(chip); } diff --git a/sound/synth/emux/emux.c b/sound/synth/emux/emux.c index a870759d179e..0006c3ddb51d 100644 --- a/sound/synth/emux/emux.c +++ b/sound/synth/emux/emux.c @@ -129,7 +129,7 @@ int snd_emux_free(struct snd_emux *emu) if (! emu) return -EINVAL; - del_timer_sync(&emu->tlist); + timer_shutdown_sync(&emu->tlist); snd_emux_proc_free(emu); snd_emux_delete_virmidi(emu); From patchwork Fri Nov 4 05:41:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15353 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp190839wru; Thu, 3 Nov 2022 22:51:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5fSNAOv+zzcVH6/ZToAcN8CfgP/vKOG3ZrZCbBhtZjUaa63KHTRsR48upV7HltouhUdCPE X-Received: by 2002:a17:906:6791:b0:78d:4051:969f with SMTP id q17-20020a170906679100b0078d4051969fmr32457465ejp.171.1667541074673; Thu, 03 Nov 2022 22:51:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541074; cv=none; d=google.com; s=arc-20160816; b=cba7LeFnkBUK+VKXvyKylmhN1VEOUqzBWKD+QBKdvQX5xfj4szfPqvrsxSOvvxHBeE L4ZjY85OKKm16/A9Ddx0RADtrrOsRypGTuhYem4iY1HTij59Qeygkf4PvnW4v9QEcgKx ldLs3+/Im7UhMceqzqilLR1Y+0AmL6z8hA2bucX7zJu7OSPYjMS9Bnp9YZTj9wyvkdLK QFwVeiwbA+T2sVy2jIFAmivpRtujDRqy+bQky70v4GOZyDigDAF/6PTTbnfOIrRlll7J cTFAX6GkdfqUmsgLpEHuUFUX+umFZRcY6DfZjNbwXVioMyDhjHMPKRTRaEhG40+atWuh HELA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=6PTkFrLPn25Y/ND4P30iiREKaRJ9nsHGBiQ3fp/T+lk=; b=E5FKnJL/4X6WZ1VJrbXMCYQYM+qXLEpZiu0ncnYGf7fFxKxAACeXDt0u5G0Mb9vdRp AO50nIbmkIl4TcMFjCd7FKrwBLH1/7HhmUeVqrqzgjdnLnphitqapEG3UT0draOxfEwk 1+073VxvZx6Ihc8Bixqtf0uWeY2YHg/kGtD/M1SwYUSjqzSAnPUSA2/UBmUSlW0tLpRI pKlinNSTDSrJJWZcQ8a0PQu4BANo+egHEZSuRWxdIPkPNMWkfyexPOts0WfcVgmidhzl TlCDmzTtzr4cQ1ORptHY2k1CJYxQA6PLdm92BVBHPBFylu61dkruVxmMzSIR5HilZkI/ nSUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q18-20020a056402041200b0045c9313faf7si3159069edv.353.2022.11.03.22.50.51; Thu, 03 Nov 2022 22:51:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231700AbiKDFuG (ORCPT + 99 others); Fri, 4 Nov 2022 01:50:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231382AbiKDFsy (ORCPT ); Fri, 4 Nov 2022 01:48:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EE8B28E1E; Thu, 3 Nov 2022 22:48:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7F982620B2; Fri, 4 Nov 2022 05:48:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0D85C4347C; Fri, 4 Nov 2022 05:48:50 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZt-0071Ei-1h; Fri, 04 Nov 2022 01:49:17 -0400 Message-ID: <20221104054917.365008421@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:23 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , "Theodore Tso" , Jan Kara , linux-ext4@vger.kernel.org Subject: [RFC][PATCH v3 30/33] timers: jbd2: Use timer_shutdown() before freeing timer References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543550049164716?= X-GMAIL-MSGID: =?utf-8?q?1748543550049164716?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown() must be called. Note that it is assumed that the timer is not running while being freed, so only timer_shutdown() is used, and not timer_shutdown_sync(). Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: "Theodore Ts'o" Cc: Jan Kara Cc: linux-ext4@vger.kernel.org Signed-off-by: Steven Rostedt (Google) Reviewed-by: Jan Kara --- fs/jbd2/journal.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 2696f43e7239..57d2445d8c8b 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -2157,6 +2157,8 @@ int jbd2_journal_destroy(journal_t *journal) J_ASSERT(journal->j_checkpoint_transactions == NULL); spin_unlock(&journal->j_list_lock); + timer_shutdown(&journal->j_commit_timer); + /* * OK, all checkpoint transactions have been checked, now check the * write out io error flag and abort the journal if some buffer failed From patchwork Fri Nov 4 05:41:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15364 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp192322wru; Thu, 3 Nov 2022 22:56:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Y44Yr24xTBVWIYipUZ5DBLHWiKOwH4Iguy+y569RlCpgxkKa8giP3f0WWn+1WEBIQjsdw X-Received: by 2002:a17:906:5d10:b0:7ad:e132:bb85 with SMTP id g16-20020a1709065d1000b007ade132bb85mr21948707ejt.367.1667541385872; Thu, 03 Nov 2022 22:56:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541385; cv=none; d=google.com; s=arc-20160816; b=NztgbbhwgCCVyhJ0TxL307iFjgC0GXlQHlIhLEPKhYYJnxhrV8FPmOlLXNY4CkFDz0 UmhWEwZg0IoHk63mO8iPQBop/nUtz5Nf2nR2KzTnzIOAWEHqjyaeLva9/upDNiQD7USW YzD47stFlbmB0GxJAEd4q5JHB69bsU6o9URlqu+bfeeDbvsEX6lGzeOkFJMaq1AUeSKF aRy1lJ5fV/Qpff0RLIXg2YGGlgq9t4VaXwCCW6UOS1jNJB6UGlrAFA0mhsVDuR01bCF5 hNkuGSH0CZRt0lMlWDE9G5faZYmrOUuUVloAZ7NJimMAJkoBVuFt0LcBzTm5l3tuhxIe ji+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=YtXoqWp2uAo4rvcnU0eqN+iDqmmb3a63vxGCZUc38Zg=; b=Z+Uejz5vVWFF2NvMCD8ikTw1G2IjnVUvMID0CmeX1buUs5P92lpCRttvabFem080Zx ehQzFR4NxajZXLBAyA8wHhAAXGFRbajEWchg7BuQ6FX2kcmpkWW9gY8HsUYMfcFV4T62 VZpv5ua/P629IJ/TeB5w/ReMkmybbMAL6wXlpIP5vYJSz8FLdJBzGylwPNxFo863vnkX Mzm0NfCuylpt2ypA0ZLBV862wmi5aXB21p2RPjR2u4tHnh444zdvgQ6RMHrbei/4rd3A MH9U/D2BkNkMMAp8DLVul8XmrjZHLoyHlMxbOF+ukDFyF+SZi5q1DBA0HMo8Ywvw7iUq l8BA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq10-20020a1709073f0a00b007adca6532d5si4057756ejc.708.2022.11.03.22.56.02; Thu, 03 Nov 2022 22:56:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231309AbiKDFuy (ORCPT + 99 others); Fri, 4 Nov 2022 01:50:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231338AbiKDFsy (ORCPT ); Fri, 4 Nov 2022 01:48:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7846D2873B for ; Thu, 3 Nov 2022 22:48:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C15E0620DB for ; Fri, 4 Nov 2022 05:48:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C1DEC433D6; Fri, 4 Nov 2022 05:48:51 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZt-0071FH-2I; Fri, 04 Nov 2022 01:49:17 -0400 Message-ID: <20221104054917.543373979@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:24 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Johannes Weiner , Suren Baghdasaryan , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider Subject: [RFC][PATCH v3 31/33] timers: sched/psi: Use timer_shutdown_sync() before freeing timer References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543876578344976?= X-GMAIL-MSGID: =?utf-8?q?1748543876578344976?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: Johannes Weiner Cc: Suren Baghdasaryan Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Juri Lelli Cc: Vincent Guittot Cc: Dietmar Eggemann Cc: Ben Segall Cc: Mel Gorman Cc: Daniel Bristot de Oliveira Cc: Valentin Schneider Signed-off-by: Steven Rostedt (Google) Acked-by: Johannes Weiner Reviewed-by: Suren Baghdasaryan --- kernel/sched/psi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c index ee2ecc081422..f5f2613c4292 100644 --- a/kernel/sched/psi.c +++ b/kernel/sched/psi.c @@ -1033,6 +1033,7 @@ void psi_cgroup_free(struct cgroup *cgroup) cancel_delayed_work_sync(&cgroup->psi->avgs_work); free_percpu(cgroup->psi->pcpu); + timer_shutdown_sync(&cgroup->psi->poll_timer); /* All triggers must be removed by now */ WARN_ONCE(cgroup->psi->poll_states, "psi: trigger leak\n"); kfree(cgroup->psi); From patchwork Fri Nov 4 05:41:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15354 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp190866wru; Thu, 3 Nov 2022 22:51:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM66rm7KSifx3nRCzINamCo/6EOnp4N54JsgXKe2qwUGHyJFtbbQc0te/V6F/n+MJJ8QMV7+ X-Received: by 2002:aa7:cd58:0:b0:462:d797:483d with SMTP id v24-20020aa7cd58000000b00462d797483dmr34944487edw.343.1667541078695; Thu, 03 Nov 2022 22:51:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541078; cv=none; d=google.com; s=arc-20160816; b=0Xg9tJBKc0lOafN4AonikHhD9Z6Gp/T60FQvo87BjuFw9aOQ1QYDt8cMcgY80xcxDR /x8nDE156oDjZRpiksAVeDRss+Rj3SpAqVn5huzNKRfTnNqs788F5nOkv2hcXbMKAExZ OVQ87EizLwBU1e1rfUkssb2ovttmLv+pKWNDOJumIQdpcIg/N1bW+5qJFZv40OgjJ4Uh ZSjvYvEirTpgiV3LD/9wXPbHeYRkdwnquKONtmtKzsW4eOFIwVMx6mS3RxsVQDgv29hF RHD05/9XLF8ZLfSB8dfYhvy/kR8fRY0ry0182v1K6S6o9Bf48tygVLJINteCI6BCh/ZU APZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=7FF/7gqum1sylk7zjtlFwspsf+k0SUgkVGxKZEamAKo=; b=fJFwCkuVLarjtt5spZMJNG/tEbL0KnXh6Uax/Znr1JluHpTOUFM6aeBAS9AZD1JiN7 p6xXPMesExnW8VQNIiXfhfwIouXJ9DvX6bZ+3YS4Xt6jrWR7bDmrdxgNKg1aZQ8qU+lB KbtpxVp5J/KqUAunu7K8R40LluA+ewJyYIBIbgBCP8vCuzLWBYeEGwrn2nTaudZCI3gx SHLFmZaZwrijx4vyHSXCwy/ygVtpFTPtlwdU2WdLccYtaedGmohl6dDLwcaNrqu0FdM0 r5/SbYte2h8SEy69MRxb16Yh9xej5K1WGdkrmn/9LRRMb/zp+F8Iem0iOsgG3rc6Z+cX Zvaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb33-20020a1709077ea100b0078dc3cb8b48si4255087ejc.625.2022.11.03.22.50.55; Thu, 03 Nov 2022 22:51:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231731AbiKDFuK (ORCPT + 99 others); Fri, 4 Nov 2022 01:50:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231379AbiKDFsy (ORCPT ); Fri, 4 Nov 2022 01:48:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7850228E0D; Thu, 3 Nov 2022 22:48:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E568C620E6; Fri, 4 Nov 2022 05:48:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60E1BC433C1; Fri, 4 Nov 2022 05:48:51 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZt-0071Fq-2u; Fri, 04 Nov 2022 01:49:17 -0400 Message-ID: <20221104054917.730504253@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:25 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Tony Luck , Borislav Petkov , Ingo Molnar , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-edac@vger.kernel.org Subject: [RFC][PATCH v3 32/33] timers: x86/mce: Use __init_timer() for resetting timers References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543554158030819?= X-GMAIL-MSGID: =?utf-8?q?1748543554158030819?= From: "Steven Rostedt (Google)" DEBUG_OBJECTS_TIMERS is now checking if a timer is ever enqueued, and if so, it must call timer_shutdown_sync() before freeing, otherwise debug objects will trigger. This requires that once a timer is initialized (and initialized for debug objects) it must not be re-initialized using timer_setup(), as that will call the debug objects initialization code again and trigger a bug if it was ever used. As the mce reinitializes its timers on CPU hotplug, it must use __init_timer() instead of timer_setup(), which will only initialize the debug objects once. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: Tony Luck Cc: Borislav Petkov Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Dave Hansen Cc: x86@kernel.org Cc: "H. Peter Anvin" Cc: linux-edac@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- arch/x86/kernel/cpu/mce/core.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c index 2c8ec5c71712..d2653c7d40b3 100644 --- a/arch/x86/kernel/cpu/mce/core.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -2051,14 +2051,24 @@ static void __mcheck_cpu_setup_timer(void) { struct timer_list *t = this_cpu_ptr(&mce_timer); - timer_setup(t, mce_timer_fn, TIMER_PINNED); + /* + * timer_setup() may only be used on a timer for the + * first time it is initialized. This resets the + * timer on CPU hotplug, so use __init_timer() instead. + */ + __init_timer(t, mce_timer_fn, TIMER_PINNED); } static void __mcheck_cpu_init_timer(void) { struct timer_list *t = this_cpu_ptr(&mce_timer); - timer_setup(t, mce_timer_fn, TIMER_PINNED); + /* + * timer_setup() may only be used on a timer for the + * first time it is initialized. This resets the + * timer on CPU hotplug, so use __init_timer() instead. + */ + __init_timer(t, mce_timer_fn, TIMER_PINNED); mce_start_timer(t); } From patchwork Fri Nov 4 05:41:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15352 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp190800wru; Thu, 3 Nov 2022 22:51:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM73AkbfnApbi+EtuO8NbuF38hwfZMDxJ+CiwNf2jATa2A/kye88FqVm04y0KsdOa7DtOMvX X-Received: by 2002:a17:907:3205:b0:770:8554:c4ee with SMTP id xg5-20020a170907320500b007708554c4eemr33360068ejb.39.1667541068020; Thu, 03 Nov 2022 22:51:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541068; cv=none; d=google.com; s=arc-20160816; b=WpXn67zQyt36evEEJQY1n6Hml/J9mnAv6K9cq+iRt+iVJ9N8BQWEFfhZDkvnAMs4K1 e8hL/DSr6gxmr1ejnwBZ9rGNa2RAgG+O1fGVCE8ZmBVYTW2jK4vY6Lc7yFqjsEJUIZSI 29Wjs/PAfDcHT7V4ttR86ZOKZGpOutxd7QComWwUEzZe1G3MtaDyC7lBUL2TVjRX7j1L pqYzrG1IaX1GgY2bRgqww+71Cjm8/FOKI/lt1Z5zoK3TUmnO7OWauGSo1vC9T/2dfS88 Ah/HEe2ZelKFWVbXH9K/WLZ1Uc2AyyUDiUrwflOh6PVnAaNLU65b+zuyHkzg0AgrVCo6 EpIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=807O0YV9D6zu3jPu8y66AAkjW18mVSxvAXhpzi5Ie2Y=; b=emKgN6zAgm3AiPKQHi82nP72jcoHDSly/+AjJskf6az4ZhUv9+VcSfiK2c+A/tWCpN t8f0bh4LitdbRHMepQXPrZpxn5K+e4wFVkhgYoP4z9Z6iAbgJdY7oosiTFXJggln8TfO JODqWEVDn5NZLMEoXyc7CAkf3CswopbD0TkgWCETID9YXQj8qgbLz2w5MSKXmfljwV2G zFaOwhsrgiEwAFMLcw30yr+xYcaQrjfIrCqiGUVFk8zCKtTKH+zWIN/pRE0YVVBa2BJV CoLnM68zAeOYbkvOs1hpljAqkBtCRAGtiUHY0Pjp35KcrieQSIXAYD3Yf8FKGj8Wzk1k YX1g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cr15-20020a170906d54f00b0078d0f88a6e9si4173540ejc.284.2022.11.03.22.50.44; Thu, 03 Nov 2022 22:51:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231695AbiKDFuC (ORCPT + 99 others); Fri, 4 Nov 2022 01:50:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231307AbiKDFsz (ORCPT ); Fri, 4 Nov 2022 01:48:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 786DF28E11 for ; Thu, 3 Nov 2022 22:48:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BF63F620D4 for ; Fri, 4 Nov 2022 05:48:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8837EC43144; Fri, 4 Nov 2022 05:48:51 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZu-0071GP-0E; Fri, 04 Nov 2022 01:49:18 -0400 Message-ID: <20221104054917.915205356@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:26 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , John Stultz Subject: [RFC][PATCH v3 33/33] timers: Expand DEBUG_OBJECTS_TIMER to check if it ever was used References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543542693635989?= X-GMAIL-MSGID: =?utf-8?q?1748543542693635989?= From: "Steven Rostedt (Google)" There's been too many bugs happening where a timer is removed, either by del_timer() or even del_timer_sync() but get's re-armed again by a workqueue or some other task. Then the timer is freed while it's still queued to go off. When the timer eventually goes off, as its content no longer exists, it causes a crash in the timer code. This is very hard to debug because all evidence of who added the timer is gone. Currently, DEBUG_OBJECTS_TIMER will trigger if this happens, but as this only happens rarely (but in the field, thousands of times) and may depend on performing various tasks (USB unplug, CPU hotplug, suspend and resume), not to mention that enabling DEBUG_OBJECTS_TIMER has too much overhead to run in the field, it seldom catches these types of bugs. Now that timer_shutdown_sync() is to be called before freeing, move the checks of DEBUG_OBJECTS_TIMER to if it ever gets armed to where timer_shutdown_sync() is called. If there's a case where a timer is armed, and then freed without calling timer_shutdown_sync() DEBUG_OBJECTS_TIMER will now trigger on it. This catches cases that are potential issues instead of just catching when the race condition occurs. Note, due to delayed workqueues that use timers but they themselves do not supply a shutdown method, there's no way to be able to call timer_shutdown() on delayed work timers correctly. Because of this, the delayed work timers will add a state to inform the DEBUG_OBJECTS_TIMER code that its a timer for a delayed work. The delayed work timers will be treated the old way of only trigging an issue if its timer is active when freed, but does not need to be shutdown first. Work may be needed to make workqueue code also have a shutdown state. Cc: Thomas Gleixner Cc: John Stultz Cc: Stephen Boyd Signed-off-by: Steven Rostedt (Google) --- include/linux/timer.h | 36 +++++++++++++++++++++++++++++- include/linux/workqueue.h | 4 ++-- kernel/time/timer.c | 46 +++++++++++++++++++++++++++++++++------ 3 files changed, 76 insertions(+), 10 deletions(-) diff --git a/include/linux/timer.h b/include/linux/timer.h index 0758b447afd7..ab6148db289e 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -8,6 +8,12 @@ #include #include +enum timer_debug_state { + TIMER_DEBUG_DISABLED, + TIMER_DEBUG_ENABLED, + TIMER_DEBUG_WORK, +}; + struct timer_list { /* * All fields that change during normal runtime grouped to the @@ -18,6 +24,9 @@ struct timer_list { void (*function)(struct timer_list *); u32 flags; +#ifdef CONFIG_DEBUG_OBJECTS_TIMERS + enum timer_debug_state enabled; +#endif #ifdef CONFIG_LOCKDEP struct lockdep_map lockdep_map; #endif @@ -128,6 +137,31 @@ static inline void init_timer_on_stack_key(struct timer_list *timer, init_timer_on_stack_key((_timer), (_fn), (_flags), NULL, NULL) #endif +#ifdef CONFIG_DEBUG_OBJECTS_TIMERS +#define __init_timer_debug(_timer, _fn, _flags) \ + do { \ + (_timer)->enabled = TIMER_DEBUG_DISABLED; \ + __init_timer((_timer), (_fn), (_flags)); \ + } while (0) +#define __init_timer_work(_timer, _fn, _flags) \ + do { \ + (_timer)->enabled = TIMER_DEBUG_WORK; \ + __init_timer((_timer), (_fn), (_flags)); \ + } while (0) +#define __init_timer_work_on_stack(_timer, _fn, _flags) \ + do { \ + (_timer)->enabled = TIMER_DEBUG_WORK; \ + __init_timer_on_stack((_timer), (_fn), (_flags)); \ + } while (0) +#else +#define __init_timer_debug(_timer, _fn, _flags) \ + __init_timer((_timer), (_fn), (_flags)) +#define __init_timer_work(_timer, _fn, _flags) \ + __init_timer((_timer), (_fn), (_flags)) +#define __init_timer_work_on_stack(_timer, _fn, _flags) \ + __init_timer_on_stack((_timer), (_fn), (_flags)) +#endif + /** * timer_setup - prepare a timer for first use * @timer: the timer in question @@ -139,7 +173,7 @@ static inline void init_timer_on_stack_key(struct timer_list *timer, * be used and must be balanced with a call to destroy_timer_on_stack(). */ #define timer_setup(timer, callback, flags) \ - __init_timer((timer), (callback), (flags)) + __init_timer_debug((timer), (callback), (flags)) #define timer_setup_on_stack(timer, callback, flags) \ __init_timer_on_stack((timer), (callback), (flags)) diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index a0143dd24430..290c96429ce1 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h @@ -250,7 +250,7 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; } #define __INIT_DELAYED_WORK(_work, _func, _tflags) \ do { \ INIT_WORK(&(_work)->work, (_func)); \ - __init_timer(&(_work)->timer, \ + __init_timer_work(&(_work)->timer, \ delayed_work_timer_fn, \ (_tflags) | TIMER_IRQSAFE); \ } while (0) @@ -258,7 +258,7 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; } #define __INIT_DELAYED_WORK_ONSTACK(_work, _func, _tflags) \ do { \ INIT_WORK_ONSTACK(&(_work)->work, (_func)); \ - __init_timer_on_stack(&(_work)->timer, \ + __init_timer_work_on_stack(&(_work)->timer, \ delayed_work_timer_fn, \ (_tflags) | TIMER_IRQSAFE); \ } while (0) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 7c224766065e..7596396ce1f6 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -691,7 +691,10 @@ static bool timer_fixup_init(void *addr, enum debug_obj_state state) switch (state) { case ODEBUG_STATE_ACTIVE: - del_timer_sync(timer); + /* Force the debug deactivate code */ + if (timer->enabled != TIMER_DEBUG_WORK) + timer->enabled = TIMER_DEBUG_ENABLED; + timer_shutdown_sync(timer); debug_object_init(timer, &timer_debug_descr); return true; default: @@ -737,7 +740,7 @@ static bool timer_fixup_free(void *addr, enum debug_obj_state state) switch (state) { case ODEBUG_STATE_ACTIVE: - del_timer_sync(timer); + timer_shutdown_sync(timer); debug_object_free(timer, &timer_debug_descr); return true; default: @@ -774,16 +777,40 @@ static const struct debug_obj_descr timer_debug_descr = { static inline void debug_timer_init(struct timer_list *timer) { + /* Only need to call debug_object_init once if not a work timer */ + if (timer->enabled == TIMER_DEBUG_ENABLED) + return; + debug_object_init(timer, &timer_debug_descr); } static inline void debug_timer_activate(struct timer_list *timer) { + /* Only call debug_timer_activate once if not a work timer */ + if (timer->enabled == TIMER_DEBUG_ENABLED) + return; + + if (timer->enabled == TIMER_DEBUG_DISABLED) + timer->enabled = TIMER_DEBUG_ENABLED; + debug_object_activate(timer, &timer_debug_descr); } -static inline void debug_timer_deactivate(struct timer_list *timer) +static inline void debug_timer_deactivate(struct timer_list *timer, bool free) { + switch (timer->enabled) { + case TIMER_DEBUG_DISABLED: + /* Already disabled, nothing to do */ + return; + case TIMER_DEBUG_ENABLED: + /* free is true when shutting down the timer */ + if (!free) + return; + timer->enabled = TIMER_DEBUG_DISABLED; + break; + case TIMER_DEBUG_WORK: + break; + } debug_object_deactivate(timer, &timer_debug_descr); } @@ -816,7 +843,7 @@ EXPORT_SYMBOL_GPL(destroy_timer_on_stack); #else static inline void debug_timer_init(struct timer_list *timer) { } static inline void debug_timer_activate(struct timer_list *timer) { } -static inline void debug_timer_deactivate(struct timer_list *timer) { } +static inline void debug_timer_deactivate(struct timer_list *timer, bool free) { } static inline void debug_timer_assert_init(struct timer_list *timer) { } #endif @@ -828,7 +855,7 @@ static inline void debug_init(struct timer_list *timer) static inline void debug_deactivate(struct timer_list *timer) { - debug_timer_deactivate(timer); + debug_timer_deactivate(timer, false); trace_timer_cancel(timer); } @@ -1251,12 +1278,15 @@ int __del_timer(struct timer_list *timer, bool free) if (timer_pending(timer)) { base = lock_timer_base(timer, &flags); ret = detach_if_pending(timer, base, true); - if (free) + if (free) { timer->function = NULL; + debug_timer_deactivate(timer, true); + } raw_spin_unlock_irqrestore(&base->lock, flags); } else if (free) { base = lock_timer_base(timer, &flags); timer->function = NULL; + debug_timer_deactivate(timer, true); raw_spin_unlock_irqrestore(&base->lock, flags); } @@ -1276,8 +1306,10 @@ static int __try_to_del_timer_sync(struct timer_list *timer, bool free) if (base->running_timer != timer) ret = detach_if_pending(timer, base, true); - if (free) + if (free) { timer->function = NULL; + debug_timer_deactivate(timer, true); + } raw_spin_unlock_irqrestore(&base->lock, flags);