From patchwork Thu Oct 27 15:05: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: 11824 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp286506wru; Thu, 27 Oct 2022 08:10:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4vfsj0O26MlUtwzVNySGmkjqC+HoTBS97cYTmbG3tzl1nhAcPTxdeL21c5G3HWuEhiQPAj X-Received: by 2002:a17:907:75e9:b0:7a4:31c:ae0d with SMTP id jz9-20020a17090775e900b007a4031cae0dmr22901080ejc.79.1666883454861; Thu, 27 Oct 2022 08:10:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883454; cv=none; d=google.com; s=arc-20160816; b=e5VZPjcVsZKPTEmESbSQ/NIhip2w3jdn4XBwRh//AKMSOmx3pziBMVFyygyle7A11W q309C0fpOH7ZdYt5g93xtwVpz0qrdfLonszKgL7Q+d+I5lW8m6RYTZRgP6OlOWWh3sbg hlAbi1hT34Z4S6noBU7CgObpIjH/9VpbxrPxws8YHcM8GcEb7+zc8YJYSo0xHAbaXG6A kZW2KWSSmdKhon5X6uETcxPRoXqoPqtNeJa4h+rfzRI5IcRU1RsNB95cJZd2H40NkrAE wW4Tj2g0XxSi5oSifkZL0ZCOO+A74uT4dBeadNkGFLQNzmfY+Xsoazw8NTG/WjZ7Ta9j PsrQ== 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=T0HU7luPS6b76RCNSuiumirBJ19Zy5OZROh5GVDCjQQ=; b=e+75SRoLaY0SnTtRi9N2O2o63pNqOwiXpKlnnY4NI17oga0bTAWWNnaKS8esv7/A39 GI0n4lZiKU+FRNmVHuOE++W0GlG8xmQXZJU7xCEZn6QEbctmREE9s2FVm4XUzvy5MtaC VlNQwoiKjCmYD/3o/AZXX9K2cawiQDVhSuElVRp+isHYoo6PIdCUD89DiaeDr+XURYvm r/vUf/3RrHLRQG6xeROrzyyl+WoBw0qclBjnXwz/pIwWz7XLv8GnE2XEiXtBydUZktsz St5rgGLEqXv4HRilEv47CsAaHDwfhsZMDi7HqRhE9CHAibozt4efpoz3gtbAjt0qF/a5 Z/JA== 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 d1-20020a50cd41000000b004589ea2d983si1587373edj.287.2022.10.27.08.10.28; Thu, 27 Oct 2022 08:10:54 -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 S236338AbiJ0PJt (ORCPT + 99 others); Thu, 27 Oct 2022 11:09:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235994AbiJ0PJP (ORCPT ); Thu, 27 Oct 2022 11:09:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 458A618F251 for ; Thu, 27 Oct 2022 08:09:13 -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 C0717B826AA for ; Thu, 27 Oct 2022 15:09:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61C9BC433D7; Thu, 27 Oct 2022 15:09:10 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4VZ-00BvS7-1L; Thu, 27 Oct 2022 11:09:25 -0400 Message-ID: <20221027150925.248421571@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:26 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck Subject: [RFC][PATCH v2 01/31] timers: Add del_timer_shutdown() to be called before freeing timers References: <20221027150525.753064657@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?1747853985502613853?= X-GMAIL-MSGID: =?utf-8?q?1747853985502613853?= 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 del_timer_shutdown() 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 del_timer_shutdown() 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. 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 | 4 ++ include/linux/timer.h | 27 +++++++++--- kernel/time/timer.c | 43 +++++++++++-------- 5 files changed, 54 insertions(+), 24 deletions(-) diff --git a/Documentation/RCU/Design/Requirements/Requirements.rst b/Documentation/RCU/Design/Requirements/Requirements.rst index a0f8164c8513..5c27f94a4fc2 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 del_timer_shutdown(). 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..a3a63cd57006 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); + del_timer_shutdown(&test_timer); } module_init(test_init); diff --git a/Documentation/kernel-hacking/locking.rst b/Documentation/kernel-hacking/locking.rst index 6805ae6e86e6..c8b852ab8214 100644 --- a/Documentation/kernel-hacking/locking.rst +++ b/Documentation/kernel-hacking/locking.rst @@ -1009,6 +1009,10 @@ 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, del_timer_shutdown() shoud 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..daccfe33da42 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -183,12 +183,29 @@ 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); +} + +/** + * del_timer_shutdown - 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 del_timer_shutdown(struct timer_list *timer) +{ + return __del_timer_sync(timer, true); +} #define del_singleshot_timer_sync(t) del_timer_sync(t) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 717fcb9fb14a..111a3550b3f2 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); @@ -1266,14 +1269,7 @@ int del_timer(struct timer_list *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 +1281,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 +1375,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 +1412,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 +1442,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 +1452,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 Thu Oct 27 15:05:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11823 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp286384wru; Thu, 27 Oct 2022 08:10:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7cTqcHVg2L7qJBKN/hjRd/2Fz2jRwUK+hY0EOvvsvu8a9/9AUVjDM3CWaBu4DcsLDKSsJC X-Received: by 2002:a05:6402:27cf:b0:462:75b3:a277 with SMTP id c15-20020a05640227cf00b0046275b3a277mr6779621ede.175.1666883443956; Thu, 27 Oct 2022 08:10:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883443; cv=none; d=google.com; s=arc-20160816; b=zm/mRgJEguyQ6jZvY1hA87Y/kUAPwuO36jqYzDuIkRRdhfQF/nBPCByyMevS7Gqdga AbfZ0jd/CHvH5ARS9xNF73bYU3H8/x7mQEZJWPFMVOlVYtHrsu1/5zo5VTpyeXWUKF9I qu2fEeRkmxGGU4XCU4/Xr3JUMYjlBm3TfcxxLdzSXYAPA4WTc8kVwBlGkWhi1D1gL47A Osu/mIPS5D/j7IhTCk5YTPPVgOzdIByj8ShY34G53IfyhxhYC2QLfg9bNQo44aqwGsi8 GKUaCKeaOEeD6b10M4QdBXA5J34geo5oDEZAZrcNEdaIKECJNfs+xs63CWNsUn4aN1+R 41TA== 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=UAzCjtm/QYTuntMuyzQWU4Xdx4DO1uFin2OZwI9Og9U=; b=JEFXa7j/BP1QlUqe9lWAn8/UINo3NE7WYzP4W8nmr0xJNivyi0mQRqfi99tVKTsCB4 z2tcsRelf1qKWnM2VFGjz5bIEb6QhZhavabE5vKk1WXjWFg5t29oK3NaOSJqrQEVC6BP zAw6+PiCXcsvrh4dZAaSSgsOGxQ3+vTzOTpN7rC/HsxFP/Wo0gb1Hv3FabSHBk4O0xyt +Jt2zk+JX5KQDhMfCXEf9Ltz8wLwg4nBsVyF7xt4yxqYKSqptRIzFW+pxPLWr+jcPOs3 t5idbHSY+oLKHrpHdQY4XdGQaufY6T7jcZ3Vc6d5Km6EdZ/+IcFOTdYev1PAj5hl/Kt2 zLjg== 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 nd33-20020a17090762a100b0078dc7f7d0ebsi1961038ejc.822.2022.10.27.08.10.20; Thu, 27 Oct 2022 08:10:43 -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 S236313AbiJ0PJo (ORCPT + 99 others); Thu, 27 Oct 2022 11:09:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236235AbiJ0PJN (ORCPT ); Thu, 27 Oct 2022 11:09:13 -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 7C32518F0CF; Thu, 27 Oct 2022 08:09:11 -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 14CED62395; Thu, 27 Oct 2022 15:09:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74AFEC43470; Thu, 27 Oct 2022 15:09:10 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4VZ-00BvSf-1y; Thu, 27 Oct 2022 11:09:25 -0400 Message-ID: <20221027150925.435425818@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:27 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , linux-s390@vger.kernel.org Subject: [RFC][PATCH v2 02/31] timers: s390/cmm: Use del_timer_shutdown() before freeing timer References: <20221027150525.753064657@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?1747853974066356578?= X-GMAIL-MSGID: =?utf-8?q?1747853974066356578?= From: "Steven Rostedt (Google)" Before a timer is freed, del_timer_shutdown() 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..6ade449343d2 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); + del_timer_shutdown(&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); + del_timer_shutdown(&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 Thu Oct 27 15:05:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11830 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp286745wru; Thu, 27 Oct 2022 08:11:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7BqCpjeI3bGev3vA6iYevZtWfn8O1cCg2A5b53sYm3XMXqmQa9Xb0h6PUDi4zvCZIiJ4ZX X-Received: by 2002:a05:6402:1e96:b0:462:89aa:d402 with SMTP id f22-20020a0564021e9600b0046289aad402mr4423300edf.190.1666883474028; Thu, 27 Oct 2022 08:11:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883474; cv=none; d=google.com; s=arc-20160816; b=E7fQM6NrBhNe8Kah8hvU9HzO/MNyMl+NaBIQRUphyjd8U83vQb++bmu/bZEAgx487z wQm9RQF4LiB/QdtoXmdRVWt+GTPzOzIuWdjHhzFqh5Cm42fryACkTUqV0EpKvMlZswEj oUu1SnzBAhuVNVfOpAbXskoK/ep/WG+RRp+YeP1BdCi1rxlBBwYlkHE1lCVJWDglhTfi mfdt4hBDIrP8yDhXLSeu/7Y6QDSBpd5Ngf9LzUwsf3svF0DOx2FX5UN1P+jKOef36pBx n9SyvlwCY8TXuQ9/QPHCwQ4EeZphcCEKkVgIP/oktEq7Efo9NDAUv1hhi07m+DtIImv/ +4KQ== 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=IHWpHvpG+/xuPTQ5K5O6XRoCSb+Tn+Nw6LyiyfTXnjo=; b=cXtd5rW1Dkllt+kIEvkEkbIikTd4Eg20Lj/k0jT0+T4vyaTH0+8EjQDuRsDO/D61Fd zEEuMilu/45oHqDmDZ4zsQUTFV6Ya4Z6YNSmkCqmLt/8VmQk5UTAY3PUI5LXuNqCEmf4 cqWC2EGUEs6yGDMmNhveYmJmAfBWMbMFkdbmLIF4k5nizI1QLpFbTLWUC1ElKBF2gB9R vDPtDlqoc793m23vXO/alRCgRG2mKL1c4CAI9VUi0zrWxnotzfTurSiQDVYqEpHIGvd8 4csWef2RhIReSYU6p0fVMmzJ155aYE0NcaRRmKYpzlNIVKDZMgA0Eoe4lDMYVXZhMEkw +DQQ== 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 l9-20020a170906794900b0079b8cce1170si1670824ejo.950.2022.10.27.08.10.50; Thu, 27 Oct 2022 08:11: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 S236376AbiJ0PKQ (ORCPT + 99 others); Thu, 27 Oct 2022 11:10:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236236AbiJ0PJN (ORCPT ); Thu, 27 Oct 2022 11:09:13 -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 BF58A18F0D8; Thu, 27 Oct 2022 08:09:11 -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 45A8762398; Thu, 27 Oct 2022 15:09:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA016C43144; Thu, 27 Oct 2022 15:09:10 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4VZ-00BvTD-2a; Thu, 27 Oct 2022 11:09:25 -0400 Message-ID: <20221027150925.638910550@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:28 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org Subject: [RFC][PATCH v2 03/31] timers: sh: Use del_timer_shutdown() before freeing timer References: <20221027150525.753064657@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?1747854005575858073?= X-GMAIL-MSGID: =?utf-8?q?1747854005575858073?= From: "Steven Rostedt (Google)" Before a timer is freed, del_timer_shutdown() 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..2ebdd604f6d0 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); + del_timer_shutdown(&psw->debounce); free_irq(irq, pdev); kfree(psw); From patchwork Thu Oct 27 15:05:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11834 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp286974wru; Thu, 27 Oct 2022 08:11:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5FAEV2tYuuO9z2VYPeVFAaXnLnQZ8lVFqxN5fVsbDl0+7KyNnvDgqHkOrB7OmjeTe713M3 X-Received: by 2002:a05:6402:10c2:b0:45c:3c87:721f with SMTP id p2-20020a05640210c200b0045c3c87721fmr47878351edu.251.1666883493624; Thu, 27 Oct 2022 08:11:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883493; cv=none; d=google.com; s=arc-20160816; b=QxACRmqXgFHaGvGlqJwaId+22htAzGKfQBcaM2VC1r2UM3V0TMo0lmDz9YaATyBgpE nJX3akoFBgzMKY1GSlTjUq1+Nbx6XWC/6N++JCrjpl0PzGJ/MGv9qlFfBJ9wv2KNKYiS w8jhz6/OvkczCA6M9n5I/1WeCBEU+wtfXxNwYwaXJW/zMVVIDT79RoW3r78+c8SPct04 C3ihZen+f4Z1DdcIWC+fiT/WkhKLDvR9C0dqaIqvNJbcfaOkTxz90mcpQuK9LqfpQZ0V 6UaFmT4kweMgqWRMyyPpdvrdddXlqYoPGEMeY8c+4XiipWuRUDlR2ut29vYSCmkuNDE5 MzyQ== 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=hLYf6h8Gy4gj5veiRtZcD8YRllrfZbjnTqXoXZ08cGU=; b=YBU6BR4IzgLvH3moSewO+uCrYuySRv7gs2MX9/W24NBAtMdPNkBsGwb61S/CESpxiC qTATML1pyDFGswj6ioWUw2YqBuJqcAkkHwTb/j4WySNXwPjAVbLaBoFwTqdTYiJIRyTG o61xZnM+1hYFLnLaEUqLs7XZ+ZWDcQIF17zQEophFTsX/OZWQTb8+k4U4y97IXdk3lAl gU47yFW3zaowDKtGysrkN7dp9Vf3NTlzPLCLUvQk00iN0gmH1OG7D+Qu/uGX09aKvJTE ISkektSOovXJzgsNWSe4ZjAoYpPVylDAELZgBVdHGXGW3mSZYOBBC9ipqWIk2l6ohRLH ku+A== 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 jg42-20020a170907972a00b007418e87eea8si1754370ejc.770.2022.10.27.08.11.07; Thu, 27 Oct 2022 08:11:33 -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 S236415AbiJ0PKe (ORCPT + 99 others); Thu, 27 Oct 2022 11:10:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236004AbiJ0PJP (ORCPT ); Thu, 27 Oct 2022 11:09:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B33B818F25A; Thu, 27 Oct 2022 08:09:13 -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 563AFB826AC; Thu, 27 Oct 2022 15:09:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 056BEC43145; Thu, 27 Oct 2022 15:09:11 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Va-00BvUJ-0a; Thu, 27 Oct 2022 11:09:26 -0400 Message-ID: <20221027150926.006142977@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:30 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , "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 v2 05/31] timers: ACPI: Use del_timer_shutdown() before freeing timer References: <20221027150525.753064657@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?1747854026307544573?= X-GMAIL-MSGID: =?utf-8?q?1747854026307544573?= From: "Steven Rostedt (Google)" Before a timer is freed, del_timer_shutdown() 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: Rafael J. Wysocki 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 80ad530583c9..916b952b14d0 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); + del_timer_shutdown(&ghes->timer); break; case ACPI_HEST_NOTIFY_EXTERNAL: free_irq(ghes->irq, ghes); From patchwork Thu Oct 27 15:05:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11833 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp286879wru; Thu, 27 Oct 2022 08:11:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6RRDtxc16NGeQlCM/g9vxYMxlXpW11U/Ce5YfTdUEGug/F+UQYzXdZbalflA7v3ypl4s/O X-Received: by 2002:a17:907:9495:b0:78e:1bee:5919 with SMTP id dm21-20020a170907949500b0078e1bee5919mr42175614ejc.701.1666883488078; Thu, 27 Oct 2022 08:11:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883488; cv=none; d=google.com; s=arc-20160816; b=EKxolo26xjFoIsAhHvhPS5qSAT6I9nAz1VlythkCoC7cgS9BAFE0emC5m/e6+MkgaA 3JnTC15HDR7hFOkchf/KoDdEUI+E+srjwW8W/KSMY+kBG1LUQCSk2a0TsOG3RRnQGpFm K2RlA3syutzT4IZAwX4B1Oz8wZIBFKzi+nRhSqzdQVsZNak/vWtckTX+HFuDojMCfu+K WGSkVbgcvB2qBoQBSDyB0g6YiU8GDX6CHQffTMzQiSTSKXCxATG2UzQBriY1UveCGe8d wX+hZOFclNE+K2Xj1DXILKLgX1paQeBG6pl7I1OpqMhQZp70XaOS2F+76oXidNKM5Scl TyfA== 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=0Wd7A23YqugtH6RLVdghmjy3wZibr1xGgEPfWz5pfmI=; b=pp8/uIuYA6J1q5Z/etl6YYGeqv7WfK7rpRpwmfFgSRvNs+OxzNLgd7zWhvXFgR+cKo eGrMHJhWWI83eHuJpO9U3F0fEJQUcGWYzwD61a1xRGOAVu0r6mXMVMpvQEXPbBUOl8Gl aN//ufnjtJiE+KzWSP5ZyPZfXOIuSdnPnPtnXUyBYQpi+rUsPjCvFKxf7KhO44ADWUFp +wHQPkfyKO+U9bZcieAv+GaJ9GFx/n4/FxkLoyimPC7KcVFxsEdN1wVs86oDoI1x3ecB ZaKPH06nQrWjBoeWkEiJXb7cdQVpPHRPZ27reCrdxToNNUbhrk2ci7as/zM5bQeSCXZB KokQ== 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 sb17-20020a1709076d9100b0078d8b6976eesi1618147ejc.140.2022.10.27.08.11.03; Thu, 27 Oct 2022 08:11: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 S236410AbiJ0PKb (ORCPT + 99 others); Thu, 27 Oct 2022 11:10:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236042AbiJ0PJQ (ORCPT ); Thu, 27 Oct 2022 11:09:16 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16C0518F26C; Thu, 27 Oct 2022 08:09:14 -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 BADD0B82686; Thu, 27 Oct 2022 15:09:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70659C43470; Thu, 27 Oct 2022 15:09:11 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Va-00BvUr-1D; Thu, 27 Oct 2022 11:09:26 -0400 Message-ID: <20221027150926.201144139@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:31 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Chas Williams <3chas3@gmail.com>, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org Subject: [RFC][PATCH v2 06/31] timers: atm: Use del_timer_shutdown() before freeing timer References: <20221027150525.753064657@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?1747854020405005488?= X-GMAIL-MSGID: =?utf-8?q?1747854020405005488?= From: "Steven Rostedt (Google)" Before a timer is freed, del_timer_shutdown() 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..2e7806ae251b 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); + del_timer_shutdown(&stats_timer); + del_timer_shutdown(&restart_timer); } module_exit(idt77105_exit); diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c index 681cb3786794..fdb1151f1f32 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); + del_timer_shutdown(&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); + del_timer_shutdown(&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..74eed1816f58 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); + del_timer_shutdown(&ia_timer); } module_init(ia_module_init); From patchwork Thu Oct 27 15:05:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11829 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp286679wru; Thu, 27 Oct 2022 08:11:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6WZM03AeFbjZOtlfJ5zJb5o+yCVfXZZrZJD2lJDKtmfNHUK8vW5Xlvp9/T1lNSDrGYoV/p X-Received: by 2002:a17:906:401:b0:73d:af73:b78 with SMTP id d1-20020a170906040100b0073daf730b78mr43862244eja.122.1666883469493; Thu, 27 Oct 2022 08:11:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883469; cv=none; d=google.com; s=arc-20160816; b=hCul1+EOik9g6djUPwDT6P/u8zIeSvScGGNfPVe2O8t/Y0iRWBIKmIFuJW+jNlj6EU S4ihypELvN64fu5QmF70k8qmKnDAqUAyj49peBcsGA95nr6JdftFHn5Zt2K+A+ax2kYk jfWx/T4LGzTBOtUktU+mkEyJYraa1TrF73WItxIslgF9Kn70Y3zyymM/91gmMdugstuO UOG65VdkU46AoADQRhaUCeX3j6d5w33E30lEzY8Suw7HJaxuIH7zJKEmuDPRkslYoO8Z OqSiTGCWmI9Gs9N5orgn+MlIOLoxMTlEEhT2FwSnPkMCj6HY/k6IPOvPpbsr5mbor4bt t84A== 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=f5xOwNz6cYb7XAXe8w7TLgPXpRiJZWumV3U6aTiyNkk=; b=YwQ1NlArp/lQEkHswzAQoyKQqT1KsOvUs6C5tJxmLLSrHmIXiyIC9sTKfeKDb8iNEc YOp5hF/O32hSFIJArKax1WyzvqJo8jfiz0gx0wARlqU483rS7ZwJKjjizuSn+qQiBWeb vLdK7CBw9ckqB7YmW3lyM02ws5Fx6nPhdG+eZuiibO41bOZL6xE6943pEznDWP4VtLOb /AVQIcN3/SshjQFMG5ZtKSVARVZPgA1h3VyKLvNvMCrQKTPSrr7UdGHT6Qnd0NJh+M4Y ooBR7o3+9oMrexHvdwO0AKOZHxionaJPUQClrEzzHNPAs47tARaIlezF0clAyfbmdo1u eCYA== 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 s15-20020a50d48f000000b00457e9f88b90si1566018edi.246.2022.10.27.08.10.44; Thu, 27 Oct 2022 08:11: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 S236367AbiJ0PKJ (ORCPT + 99 others); Thu, 27 Oct 2022 11:10:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236245AbiJ0PJN (ORCPT ); Thu, 27 Oct 2022 11:09:13 -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 5CB2118E73F; Thu, 27 Oct 2022 08:09:12 -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 ECCE06236E; Thu, 27 Oct 2022 15:09:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63875C433B5; Thu, 27 Oct 2022 15:09:11 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Va-00BvVQ-1p; Thu, 27 Oct 2022 11:09:26 -0400 Message-ID: <20221027150926.394670044@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:32 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , linux-pm@vger.kernel.org Subject: [RFC][PATCH v2 07/31] timers: PM: Use del_timer_shutdown() References: <20221027150525.753064657@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?1747854001007987340?= X-GMAIL-MSGID: =?utf-8?q?1747854001007987340?= 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 del_timer_shutdown() 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) Acked-by: Rafael J. Wysocki --- 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..c690f6c0d670 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; + del_timer_shutdown(&ws->timer); } EXPORT_SYMBOL_GPL(wakeup_source_remove); From patchwork Thu Oct 27 15:05:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11827 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp286670wru; Thu, 27 Oct 2022 08:11:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7XSOlYV6NECfffUQCcrUy3eQgzRf56IuyL2Z6HAXSQaC2PxFD8AQZZ3wmSLPX1MAOSI6Dv X-Received: by 2002:a17:906:9bd8:b0:78d:85f9:36ae with SMTP id de24-20020a1709069bd800b0078d85f936aemr43295857ejc.342.1666883468000; Thu, 27 Oct 2022 08:11:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883467; cv=none; d=google.com; s=arc-20160816; b=T3o1L1kF9SrFkSXXJ3RTWDswFGBhWj3te4ZaJdakp8VueUjy4Gjxbld+8GCMKZYGqe AtMLsJbuFcMSb50DNUklj5HaAe+0b/zTEg7yW32iooKuM3MQR97/ZsP1uQ+hJkjBQLZt vj/1jdEdd/nNlRdjQfjGrj9UPfpt7sRAoZ2QdY4RrFiVscPdVAAQrE0BdpyjAzEKXqZ2 ZiHvCIZHa16zmKkyTbOnanr6jg+WeCoIqpndQ7SsPR9rjS19VLf6HDbtH7Q/svfKWvf6 4Q3zAEk8t8iNLnwl8/oSUdSpdxffk9dTdb6PPXwgQr62f0flw5rqkq97oCOMTsyv3Rex 14Ow== 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=dwbk4ip1Y97M92+SVR+/StU9XSOK8x7PmLHV5xAygd8=; b=xG2uXpfHl6OUqRf37obWh9c3MBEZ8D+xCAyhR75RkHcQ7/e7PM4svJLOC6BekuGCCE bpoO933zV83SDtfokGzAMvD/VxrpSscWv4sif6P9wYXUcxrqJSkL8f6UUjo/Jdw70nhy 8GhHoLEufycEQejSvSCjNL+xCUlx0Z2rC9Wx9lsC/NgEjQ6w/Isy4PTbGhQ+Ki6jm0xl xhEz17xqdjLISCziIZEPnHigM040FI0Iq2jF6cNz6aEzytPRnevxGq786fvgC9TKbkvh PtMfkKP3h2rwGVJK4GM/KWrpPJeEMxdyuVsY71lxWzsaL8lguS8hTan6CigZPXDF1iRs ugMw== 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 dz11-20020a0564021d4b00b0045d292ef641si2112878edb.493.2022.10.27.08.10.42; Thu, 27 Oct 2022 08:11:07 -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 S236357AbiJ0PKA (ORCPT + 99 others); Thu, 27 Oct 2022 11:10:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236247AbiJ0PJO (ORCPT ); Thu, 27 Oct 2022 11:09:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 367DE18F0D9; Thu, 27 Oct 2022 08:09:13 -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 1E706623A4; Thu, 27 Oct 2022 15:09:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D0FFC43148; Thu, 27 Oct 2022 15:09:11 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Va-00BvW0-2R; Thu, 27 Oct 2022 11:09:26 -0400 Message-ID: <20221027150926.587581591@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:33 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , linux-bluetooth@vger.kernel.org Subject: [RFC][PATCH v2 08/31] timers: Bluetooth: Use del_timer_shutdown() before freeing timer References: <20221027150525.753064657@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?1747853999124042142?= X-GMAIL-MSGID: =?utf-8?q?1747853999124042142?= From: "Steven Rostedt (Google)" Before a timer is freed, del_timer_shutdown() 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) Acked-by: Luiz Augusto von Dentz --- 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..69caaff37141 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); + del_timer_shutdown(&bcsp->tbcsp); hu->priv = NULL; diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c index c5a0409ef84f..08a36ea9eea9 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); + del_timer_shutdown(&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..1796166ba35d 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); + del_timer_shutdown(&qca->tx_idle_timer); + del_timer_shutdown(&qca->wake_retrans_timer); qca->hu = NULL; kfree_skb(qca->rx_skb); From patchwork Thu Oct 27 15:05:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11831 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp286786wru; Thu, 27 Oct 2022 08:11:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5AGHR+0almI5zLGZJHZimGtFwPleBiH00sxXl//nFOTl72ODdpp8DWD+HG+jJYTTUFqNub X-Received: by 2002:a05:6402:517c:b0:461:e7e7:c0b9 with SMTP id d28-20020a056402517c00b00461e7e7c0b9mr16915415ede.73.1666883477918; Thu, 27 Oct 2022 08:11:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883477; cv=none; d=google.com; s=arc-20160816; b=CgvnzoRJuA+nGaIKZK6NWG6aA1wFTz8n+lCqFlZV8Q4fc5SSfg35b/8p1Y9lkvhr5a EVgWTRRgQfUy6YLyv7LEYgtzXAU7d2sILXwRwUyTdub+Vg4PZPUYvmaa+9/nDqthRYU2 dGXD2c48SuEpkWjfO3jUf8pbZ1hBBOCe6ij81aWIa1VTesQXTTZEOeLttd80g/2IKpBT XbinjsDdhRdVz6CkdGg/Gs2d4geQdjneY6U20jatUZ1twwtwH8OcWoWwrYFrpVoELWFJ mBptq6eLobWYVU34ef1ZijALVgejN6dAp63YNC92uHaDI3yoxhcV0S4ohpb1ZHJ+kp4V xtSA== 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=5O1Hv3YWuJcoEa9mcuQ1GJVKGICc7pK+pvqYAdzIBnw=; b=VZIhvV30hdIRao4eWONwSts0inZXoc4XUWHDMqJffXpSCmqos4u6IjZAU1i2Ks2dx/ 3I7Q0nv+6zWamo88xmtrXEX32A5T05vHo3uat35DJJ33H9mJRD7J/dQWGxQiWwT/pDes R98Rou8BguB509s3jCJyuc4mxnk1K6P6dHbjZ+hwERIPTYecAW3Ykv2ItL+QhIyFVHLx td4JoArPmyNT/DzmdCeLqVq5M6w/46nQwMZ5ZqWnC3FST5ivPI5o1pi1Itt8wSIL59Vy toGVggJDfD16BKkFmp6gPYZaa5QqDP8MJjISdPCYvJoNYRG3jBUsX3XG+ar8jy60+Yn9 soqA== 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 sh7-20020a1709076e8700b0077ef3eeca17si1863343ejc.155.2022.10.27.08.10.52; Thu, 27 Oct 2022 08:11:17 -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 S236382AbiJ0PKU (ORCPT + 99 others); Thu, 27 Oct 2022 11:10:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236039AbiJ0PJQ (ORCPT ); Thu, 27 Oct 2022 11:09:16 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5293815A8DD for ; Thu, 27 Oct 2022 08:09:14 -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 07340B826A9 for ; Thu, 27 Oct 2022 15:09:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7CC7C43141; Thu, 27 Oct 2022 15:09:11 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Va-00BvWZ-34; Thu, 27 Oct 2022 11:09:26 -0400 Message-ID: <20221027150926.777015185@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:34 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Arnd Bergmann , Greg Kroah-Hartman Subject: [RFC][PATCH v2 09/31] timers: hangcheck: Use del_timer_shutdown() before freeing timer References: <20221027150525.753064657@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?1747854009827774143?= X-GMAIL-MSGID: =?utf-8?q?1747854009827774143?= From: "Steven Rostedt (Google)" Before a timer is freed, del_timer_shutdown() must be called. 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/hangcheck-timer.c b/drivers/char/hangcheck-timer.c index 4181bcc1c796..0b7e8758746c 100644 --- a/drivers/char/hangcheck-timer.c +++ b/drivers/char/hangcheck-timer.c @@ -167,7 +167,7 @@ static int __init hangcheck_init(void) static void __exit hangcheck_exit(void) { - del_timer_sync(&hangcheck_ticktock); + del_timer_shutdown(&hangcheck_ticktock); printk("Hangcheck: Stopped hangcheck timer.\n"); } From patchwork Thu Oct 27 15:05:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11836 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp287120wru; Thu, 27 Oct 2022 08:11:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4BUlMZG2MFcHARwB1z5X2qi8vGY2udzL18wnD58QMGez115A2JzlHBsgpR641G59eYoqDj X-Received: by 2002:a05:6402:500d:b0:459:3e56:e6f9 with SMTP id p13-20020a056402500d00b004593e56e6f9mr47141033eda.367.1666883511911; Thu, 27 Oct 2022 08:11:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883511; cv=none; d=google.com; s=arc-20160816; b=QHXDfCNl4+eD/uRnr7TzI5lGZa6z0KvIt7NJB55ETjQyovf0NOD6k7gI4eq30/PBQQ vQpvwMUqNkZrxZqVTnf4BhNRDANpMR05AMP4IET/styv3AC2x7spG6SFTf+WQhMiRdOD ZPlr/jx3pA2uhF7/5q22Ceton4PMN0+h+gxP2v0VRui5AHYtI6FGup2gmROWY6weT+Yh OE6vuNzb5KDXXAjcdGET9yNTGX42ndeUY2l5NoiJ/7fIW7gRFyx/DmjlDAPCwtjjJcpM bVhMC/Mv6jBabYneszf141wAMbGPnRPuko0dZoF2EtwmNQPl21XLAp+RzC0P+SSpSg1t oxDg== 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=R9/dyHU0ttQhAMauVjiics3a+M2cPLLX5UeGSlLMrCo=; b=ord9m2FEwp5urGcGxxxu/YEN4MJqoztrZSXbxC5Ovg6jDXbc9Uhx5V6LQ+7u+X+PY1 ttwoKDSfcZkQORxV68A6p+bXCyU+S4p9J69OE7aTSaRJxsejZ5XSm546RMjYlG6hMIbm M338lUy6TlcDoaCRV96ajP2sHrLef8AqWAPNg3p8M1aYEZAFpbpu2PyoFkeSe7LWS2Wz 4V85d5wrowgXrGffhSHsdqjRmSwiasPhy3Yo0sl0xrliIruD95hHgzrIfvILBhzacMxQ grcfHf9/2MvGb0WmkBAf5EUoDtN/BHmN/qpeRjrNNRQQ8XFEfVFnPXkfuGNrGhzaFSAg 3PxA== 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 ne19-20020a1709077b9300b0078dcaaa2638si1736968ejc.708.2022.10.27.08.11.27; Thu, 27 Oct 2022 08:11:51 -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 S236425AbiJ0PKj (ORCPT + 99 others); Thu, 27 Oct 2022 11:10:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236072AbiJ0PJR (ORCPT ); Thu, 27 Oct 2022 11:09:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8114618F27E for ; Thu, 27 Oct 2022 08:09:14 -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 3E0C1B826AF for ; Thu, 27 Oct 2022 15:09:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC0A3C4347C; Thu, 27 Oct 2022 15:09:11 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Vb-00BvX8-0S; Thu, 27 Oct 2022 11:09:27 -0400 Message-ID: <20221027150926.969147187@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:35 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Corey Minyard , openipmi-developer@lists.sourceforge.net Subject: [RFC][PATCH v2 10/31] timers: ipmi: Use del_timer_shutdown() before freeing timer References: <20221027150525.753064657@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?1747854045809973514?= X-GMAIL-MSGID: =?utf-8?q?1747854045809973514?= From: "Steven Rostedt (Google)" Before a timer is freed, del_timer_shutdown() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: Corey Minyard Cc: openipmi-developer@lists.sourceforge.net Signed-off-by: Steven Rostedt (Google) Acked-by: Corey Minyard --- 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..b577f66f3ca6 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); + del_timer_shutdown(&ipmi_timer); initialized = false; diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c index e1072809fe31..bb4df879a5ab 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); + del_timer_shutdown(&ssif_info->watch_timer); + del_timer_shutdown(&ssif_info->retry_timer); if (ssif_info->thread) { complete(&ssif_info->wake_thread); kthread_stop(ssif_info->thread); From patchwork Thu Oct 27 15:05:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11828 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp286671wru; Thu, 27 Oct 2022 08:11:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5tfTG9HYXUpQ7BwCQXfLcQlo/jsJ9PAGglWcaPepb6MByKrZ5Nd91P+dlmO8kmP+jKHGRY X-Received: by 2002:a17:907:3207:b0:741:3a59:738d with SMTP id xg7-20020a170907320700b007413a59738dmr42323674ejb.110.1666883468043; Thu, 27 Oct 2022 08:11:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883468; cv=none; d=google.com; s=arc-20160816; b=G7vTsJBG9/PUtoDTdmHRcarz81bCfhdvETWovUUN4YgBpCRAkgofPfwYHR3b3IZNuO QKtvC/acKfGbDN/gM6OVWEwOAE7ueA79AqrK+bJioVYxfnmuDrlol2KkO863XLZCtba7 upIxgtPhdz0CnmDUE/KzWoazA0I5AfOBO9XJDM87RXGuXR4fvyZ+zDnFhhq4efSDD7ac xP/NUKDrkprtlonQ3V9PgSbbj+9eA3B+3YIQG+Gygh/x8Hivk96Aa5XxM7ONu+ZSB1Hz PbW206buinrdmhfYNT1s1VQhD0rEusOimr+xHufXyR50chLrE7SqcrzYxzErHWeqYzGi w5lw== 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=ofddB1JS3YaGH9OvPMa+th+TWwFmMgygM4cd3gm0eCk=; b=lhfOm6YOKLuSH5uuM0yk+mS0L5CRROXFQVz9UlWmraMcI3Z6/DfjgfRTrNdT7R7yhM v1D9Simeo3D1wfmML0c2MHwFHxGcVh8ZlWbuQjwleyTga79jZy2ahNlqHuV4ZH3nOZrR 0noaXbN8iB1jJMux9fl/vGz6fH3J3BFpAZQldpobCtmgay4hAkHeMs0c2JWt2nB3XNmH PAA3AaOToRhrYI7Ug6ijl4Eq/0fZYhwTupe1/pIUyqrvqQ90+8zG0M8oAFu75HVvtlJc A9zaXfA3dkbB+MBrkuov3u2CMTiLTiQJxtkxONahrZgU46UOMTbYXlwDfCVwbFLEe3hk tc8g== 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 o20-20020a170906975400b00782161b3422si1803179ejy.914.2022.10.27.08.10.43; Thu, 27 Oct 2022 08:11: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 S236362AbiJ0PKF (ORCPT + 99 others); Thu, 27 Oct 2022 11:10:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236246AbiJ0PJO (ORCPT ); Thu, 27 Oct 2022 11:09:14 -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 368FD18F0F0 for ; Thu, 27 Oct 2022 08:09:13 -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 6A4DF6239C for ; Thu, 27 Oct 2022 15:09:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43AB3C433D7; Thu, 27 Oct 2022 15:09:12 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Vb-00BvXh-17; Thu, 27 Oct 2022 11:09:27 -0400 Message-ID: <20221027150927.162027754@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:36 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , "Theodore Tso" , "Jason A. Donenfeld" Subject: [RFC][PATCH v2 11/31] timers: random: Use del_timer_shutdown() before freeing timer References: <20221027150525.753064657@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?1747853999306540367?= X-GMAIL-MSGID: =?utf-8?q?1747853999306540367?= From: "Steven Rostedt (Google)" Before a timer is freed, del_timer_shutdown() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: "Theodore Ts'o" Cc: "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 2fe28eeb2f38..b774fdefc840 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); + del_timer_shutdown(&stack.timer); destroy_timer_on_stack(&stack.timer); mix_pool_bytes(&stack.entropy, sizeof(stack.entropy)); } From patchwork Thu Oct 27 15:05:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11826 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp286639wru; Thu, 27 Oct 2022 08:11:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM79BFyctqFHo+9s8ydKrrNQP2EYKScKIFo86kDBzGuL29ZHct8cpC6I5/npfNMuGcPW8aSL X-Received: by 2002:a17:907:744:b0:741:36b9:d2cc with SMTP id xc4-20020a170907074400b0074136b9d2ccmr41042031ejb.613.1666883465483; Thu, 27 Oct 2022 08:11:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883465; cv=none; d=google.com; s=arc-20160816; b=ULt1p1LRTkhFDcwSeMleF6RxK/6gre2HwgW9reRqCB9S4h/9nhLT1/v89dIAEO7AEb K6CRVfeeKBzx3lKkpOY0e8bTznga9lwfl/sH7U0xiWQmtTrg239gqiMSATc7nJYf3/L5 RfhzlxhdqFePFWuvqo8/qog3bWH/2AuLXhgMga8Hfd4GjxoZHVEuI6O92TpTrIbNz8XZ g35ru3OCkvQLItSeTjb9oXU8Fv3u462XOyaXtXOP3o2oMPcKbgjNy/1z0xikSp4Wwate k6MNtxVG4cLVLiNpniKSyXVjkOYR/rNZvow+G3ZLyFqo48Sb8iUJVz8alexz3QaryGl7 K+zw== 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=zFid6gq4STUIfdArzrgperDhMhS36cevOha+2dP34FY=; b=mznGWxGAvDGULV5wN8J6az1l+VZIfo1mNEu0YBP3V0Z1M1cVLkPwCHQ7PTxdmI6ZF6 xtstEpQsB05fglDkvv5r6ACvAoFtx/g6xcqWK6OVzKYhwNcW6be19arnd2An+l74XyGL uWRuYh1DrHqESxLuZg+ujaGzzVvmxApN2BGUieA7KHeGwEeKZWOIH3gka/pI1hNNSz/7 ZD8HWW3z/JEu3QC3qccJQHjxK3sLyTJOIgP9B+Cm1atPH/nZ6LmBvXiRn6ZkGq78/5ha IQ9PaTrX3JTthAo7PyF5GFqNaV5Om27xNXMthBjQM0VflYLXu10ho7FV63QS+LSTxFpS Xj5w== 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-20020a170907a0d300b007ad79c4f58fsi1146201ejc.120.2022.10.27.08.10.40; Thu, 27 Oct 2022 08:11:05 -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 S236352AbiJ0PJ4 (ORCPT + 99 others); Thu, 27 Oct 2022 11:09:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235863AbiJ0PJO (ORCPT ); Thu, 27 Oct 2022 11:09:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9299418F259; Thu, 27 Oct 2022 08:09:13 -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 E88C062377; Thu, 27 Oct 2022 15:09:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C44A8C433C1; Thu, 27 Oct 2022 15:09:12 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Vb-00BvZP-39; Thu, 27 Oct 2022 11:09:27 -0400 Message-ID: <20221027150927.803761506@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:39 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , David Rheinsberg , Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org Subject: [RFC][PATCH v2 14/31] timers: HID: Use del_timer_shutdown() before freeing timer References: <20221027150525.753064657@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?1747853996459605342?= X-GMAIL-MSGID: =?utf-8?q?1747853996459605342?= From: "Steven Rostedt (Google)" Before a timer is freed, del_timer_shutdown() 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..d10fa38de297 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); + del_timer_shutdown(&wdata->timer); device_remove_file(&wdata->hdev->dev, &dev_attr_devtype); device_remove_file(&wdata->hdev->dev, &dev_attr_extension); From patchwork Thu Oct 27 15:05:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11825 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp286531wru; Thu, 27 Oct 2022 08:10:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ryjC494108DljhTSB6kIyJB0goMgVyuZmEOsz0CeiE10QsdW+/OcFg/C4/l6VpWuxTYHL X-Received: by 2002:a05:6402:1052:b0:459:2c49:1aed with SMTP id e18-20020a056402105200b004592c491aedmr46116515edu.212.1666883457948; Thu, 27 Oct 2022 08:10:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883457; cv=none; d=google.com; s=arc-20160816; b=izR5h3oqmvJznIuIE3HuS1Daeh7DZPuxRu8+369zNwy6ba7Gh4f7alLo4GCu9wRG4j Mue2kLttz/xGIta2H2ppsGUZ5ROVRB63j4yx+zbyTVIGS+OUJtGCYd+wN/pCpckeGzMY VVKOXJwwC1pINr/fIzR3FQVr1SEYGihaGYD7g1lKuTUwL2t6rROmO4LlOQmAJUA8H7fM GyomGaSW5C3HgRQWAqsGgwTeN732OgRgVcSn0XrWqhqSCtQD2UK/aUZCAgffCYAN80Lr Fl04J4FGEUc7nu7BOcbR80ISqpNwH1ETafk0OXI61q6qLJNiRtLsmOcRgvMDdcbNc+yG HQAA== 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=NLpZDBrOTjUXxsZQETl74CNlxAzKKzeUZPc2B7eALow=; b=0Hn0oY7xOwFwCOK3/mE9gBqz9xovR8vPZZQPLZd16WyiMaGtE+Wm5UAs1zA0x5SlQC PNsqYA56YsC6XHUORsr7Qd0RvcqvVrt8UIgA1++aMUpjbIuqmbfPOPHz2eiBsfs9i00f 5ol4GbilAtnP76Qy6sEmzClUsfrkcoXUV74NjnRJP4Bkd5p28J51E8c8jThfL+UCbsMU RM8tFqFA/KxB/5Z90iSY8xsRY4w/xJj2ztsw8fwn12uWB8W+i23wONse0fJ4AmR8Iv8E rVjZBaI4xEEPYv7UJQZhCHkDs6OOqD+CQuN8916KvJuuJv0atz0WYP2O9DgXR58C1t4R oVew== 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 xg11-20020a170907320b00b0076f16ec62d6si1673970ejb.959.2022.10.27.08.10.33; Thu, 27 Oct 2022 08:10:57 -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 S236345AbiJ0PJx (ORCPT + 99 others); Thu, 27 Oct 2022 11:09:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236002AbiJ0PJP (ORCPT ); Thu, 27 Oct 2022 11:09:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B54D918F263; Thu, 27 Oct 2022 08:09:13 -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 4FE3362393; Thu, 27 Oct 2022 15:09:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C4ECC433D6; Thu, 27 Oct 2022 15:09:13 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Vc-00BvaW-18; Thu, 27 Oct 2022 11:09:28 -0400 Message-ID: <20221027150928.182961808@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:41 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Karsten Keil , netdev@vger.kernel.org Subject: [RFC][PATCH v2 16/31] timers: mISDN: Use del_timer_shutdown() before freeing timer References: <20221027150525.753064657@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?1747853988803198056?= X-GMAIL-MSGID: =?utf-8?q?1747853988803198056?= From: "Steven Rostedt (Google)" Before a timer is freed, del_timer_shutdown() must be called. 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 | 2 +- drivers/isdn/mISDN/l1oip_core.c | 4 ++-- drivers/isdn/mISDN/timerdev.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c index 4f7eaa17fb27..8a212c17a093 100644 --- a/drivers/isdn/hardware/mISDN/hfcmulti.c +++ b/drivers/isdn/hardware/mISDN/hfcmulti.c @@ -4544,7 +4544,7 @@ release_port(struct hfc_multi *hc, struct dchannel *dch) spin_lock_irqsave(&hc->lock, flags); if (dch->timer.function) { - del_timer(&dch->timer); + del_timer_shutdown(&dch->timer); dch->timer.function = NULL; } diff --git a/drivers/isdn/mISDN/l1oip_core.c b/drivers/isdn/mISDN/l1oip_core.c index a77195e378b7..2d4b19e7d48b 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); + del_timer_shutdown(&hc->keep_tl); + del_timer_shutdown(&hc->timeout_tl); cancel_work_sync(&hc->workq); diff --git a/drivers/isdn/mISDN/timerdev.c b/drivers/isdn/mISDN/timerdev.c index abdf36ac3bee..9d69efb8a1bc 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); + del_timer_shutdown(&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); + del_timer_shutdown(&timer->tl); kfree(timer); return id; } From patchwork Thu Oct 27 15:05:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11832 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp286858wru; Thu, 27 Oct 2022 08:11:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5CDYMh6LAWs0hKPAGBEk8PnKPP40yGAJiw/al9h/QzN1V/c7QMg2sSYXH9qgqhh9XYv7wo X-Received: by 2002:a17:907:31c3:b0:770:852b:71a2 with SMTP id xf3-20020a17090731c300b00770852b71a2mr42716719ejb.557.1666883485606; Thu, 27 Oct 2022 08:11:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883485; cv=none; d=google.com; s=arc-20160816; b=efMyjayJ+fjlypU9mPTvopGXagBWOyh+ctIr/8IVN4loXuXDRgC/4tE1d0ZoEvpWns A8Wv/sXpW3SJWp76WUBi9mQmL2Cz2VdUnNbvGP1/uuKUCgyfDC+Fg+/71HPvkHxBSyt9 wDSN6abWo1akmg5QTuHUDKE2uDT3ovfVEXH2HGvi7aJUwKcEEYgtWMNvz6NvwJ7pFFxR kCwiPP/TAIC41t3KWDuRe/KLqRMV4qHbhc/0RcqUFGvZB3u0Ykg+k+MFLGjphhD6JTAq kgz57CcxoTNxIy9MgvubQufhTQlZYWp4CIhHb5BUbpmKuiVit0rzCoLJO1tyN8TO5PtO T7og== 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=xnopSeg2aZXY+jiDF8Zc50BE0Q4WCFRWd+VW7bVfyzc=; b=gHsNJnboJOowGA8ZQkU26C6MaHY6DCs1hNLvZ1yuvUJNRs4AE8O8wrOsFUDqPdvJwQ zx7r1qhMqXdpm5+jtSZESJjDlB8Xb82zK4qH3Hn4+JGueisxG+vn17f8B6SzjEGdZ5e2 9tW0IzK3cYMNrZl2EBJvwW3M+B1OacD6cGZQi4KGWZa8IOnrRdXzRcVH1RDS51L+YE2v IS0rI6WDd7LbMUv7Jw1KBvVka7duBhigg8YMjy5g/NoeZjf6jxM+J+5qq2t+K4slGRGb UjPYEboGSN2eL895y/PD5iWs6jt50Ee32YEbSl6B+A9RWF4JmwtT3PL+cYClNw7mFpfr PggA== 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 ga20-20020a1709070c1400b0072f38ecf74asi1829844ejc.794.2022.10.27.08.11.00; Thu, 27 Oct 2022 08:11: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 S236405AbiJ0PK0 (ORCPT + 99 others); Thu, 27 Oct 2022 11:10:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236026AbiJ0PJQ (ORCPT ); Thu, 27 Oct 2022 11:09:16 -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 DF25718F0E9; Thu, 27 Oct 2022 08:09:13 -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 773B1623A7; Thu, 27 Oct 2022 15:09:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 526EFC433D7; Thu, 27 Oct 2022 15:09:13 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Vc-00Bvb5-1j; Thu, 27 Oct 2022 11:09:28 -0400 Message-ID: <20221027150928.367913405@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:42 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Pavel Machek , linux-leds@vger.kernel.org Subject: [RFC][PATCH v2 17/31] timers: leds: Use del_timer_shutdown() before freeing timer References: <20221027150525.753064657@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?1747854017425579204?= X-GMAIL-MSGID: =?utf-8?q?1747854017425579204?= From: "Steven Rostedt (Google)" Before a timer is freed, del_timer_shutdown() 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..dc2c7b5ef67e 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); + del_timer_shutdown(&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..7c46457f31a1 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); + del_timer_shutdown(&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..f50da27fea47 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); + del_timer_shutdown(&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..1f28f13b1764 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); + del_timer_shutdown(&transient_data->timer); led_set_brightness_nosleep(led_cdev, transient_data->restore_state); kfree(transient_data); } From patchwork Thu Oct 27 15:05:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11850 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp295785wru; Thu, 27 Oct 2022 08:28:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5GDfZA7aOmgf28q9pSKOnSZa5Exao+8Ux8VHK9Qch+tLf1kg0CGyN4NDRsaJCgfgdSYEec X-Received: by 2002:a05:6402:3509:b0:45d:c25b:b80e with SMTP id b9-20020a056402350900b0045dc25bb80emr46326412edd.250.1666884485964; Thu, 27 Oct 2022 08:28:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666884485; cv=none; d=google.com; s=arc-20160816; b=xJWt3J+cJ3hgx+dTVgfNgBhyQ+t0cCqm0XzFyG6OFkGYpGvvPNGhygrohQivkZatEI 4LNP9Lq7dVxK6n61ie7asjZ16t74yGeL8RlYLBSgZGPeDnaZTJjfok+om6J1FXYbir3A svQc/8YXYLy7IgQs/2blO73TNB6w8s7HN4xQsf2oET6jVbW3Hum4hUvC+RRI7EEgCkDC 0y3UnS7kbCK15i+M57SJD3T99ESd40fs6jIaGVi5sFCJkNmSyqouA2uAUfxsmdrUdEDG cRrhsa0RhP0eG4zHqWGPrXhOGjF1d7YIBkSSRUMCsuY9StdP+VJMi22oZiWVBzLDDkmC 9Ysg== 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=JfzPqYR+bZQDf/LrfgVS5s7YGB0LEriIDbBIwFk5ex4=; b=0CELBAHomkdYA1hwQ7GapwByloT1fFJw0kuLeIeBb6SOm63LtrPKaZkmm0p+GUcfkp HPtHOOcCQYv9gvNZntoJL0wR5KC4AUDSkiRTUwEWHkeLlfrechycG/1mdtzrAgHrgNMl uitOrIJ02XRa8EOdPCGqoAI7Aef62BrDluY1/LyoKSZzcR787Sxte3bHf0m6odLtZplB NsnG2b+vtmUPVr+jUdjngUQ88p+N32WtKAO1ZWHLcS9o44ZD6jYOdEkKNwgiHVBPIcvb +3j6uz/+QBGKHXJGgDUo4yV75OU8A7eNYfqcHB9aRk6CGCoBvURtCicZ/13j9wkVJotN WVKA== 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-20020aa7c503000000b0045782fcb80asi1436943edq.225.2022.10.27.08.27.41; Thu, 27 Oct 2022 08:28:05 -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 S236522AbiJ0PLw (ORCPT + 99 others); Thu, 27 Oct 2022 11:11:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236108AbiJ0PJS (ORCPT ); Thu, 27 Oct 2022 11:09:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0323118F924; Thu, 27 Oct 2022 08:09:15 -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 80390623A5; Thu, 27 Oct 2022 15:09:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0333C43141; Thu, 27 Oct 2022 15:09:13 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Vc-00BvcD-37; Thu, 27 Oct 2022 11:09:28 -0400 Message-ID: <20221027150928.780676863@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:44 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , 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 v2 19/31] timers: net: Use del_timer_shutdown() before freeing timer References: <20221027150525.753064657@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?1747855066612373710?= X-GMAIL-MSGID: =?utf-8?q?1747855066612373710?= From: "Steven Rostedt (Google)" Before a timer is freed, del_timer_shutdown() must 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/sock.c | 2 +- net/ipv4/inet_timewait_sock.c | 2 +- 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/tipc/discover.c | 2 +- net/tipc/monitor.c | 2 +- 27 files changed, 35 insertions(+), 35 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 2c07fa8ecfc8..81e9f232ca69 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -15528,7 +15528,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); + del_timer_shutdown(&pf->service_timer); i40e_shutdown_adminq(hw); iounmap(hw->hw_addr); pci_disable_pcie_error_reporting(pf->pdev); @@ -16147,7 +16147,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); + del_timer_shutdown(&pf->service_timer); err_mac_addr: err_configure_lan_hmc: (void)i40e_shutdown_lan_hmc(hw); @@ -16209,7 +16209,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); + del_timer_shutdown(&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..9d8a9ae64681 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); + del_timer_shutdown(&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..f008812356ef 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); + del_timer_shutdown(&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..75d4956fc1e6 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); + del_timer_shutdown(&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..dced4d0384c7 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); + del_timer_shutdown(&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..34236d793b80 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); + del_timer_shutdown(&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..8fd4d603fe37 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); + del_timer_shutdown(&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..7a96f9828c97 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); + del_timer_shutdown(&hif_drv->scan_timer); + del_timer_shutdown(&hif_drv->connect_timer); + del_timer_shutdown(&vif->periodic_rssi); + del_timer_shutdown(&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..610753f269ca 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); + del_timer_shutdown(&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..72d4680ce170 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); + del_timer_shutdown(&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..0724c45049e4 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); + del_timer_shutdown(&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); + del_timer_shutdown(&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); + del_timer_shutdown(&pg->timer); kfree_rcu(pg, rcu); } diff --git a/net/bridge/br_multicast_eht.c b/net/bridge/br_multicast_eht.c index f91c071d1608..78dcfba2b16c 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); + del_timer_shutdown(&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); + del_timer_shutdown(&eht_set->timer); kfree(eht_set); } diff --git a/net/core/gen_estimator.c b/net/core/gen_estimator.c index 4fcbdd71c59f..834287d0675e 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); + del_timer_shutdown(&est->timer); kfree_rcu(est, rcu); } } diff --git a/net/core/sock.c b/net/core/sock.c index a3ba0358c77c..10cc84379d75 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -3352,7 +3352,7 @@ EXPORT_SYMBOL(sk_stop_timer); void sk_stop_timer_sync(struct sock *sk, struct timer_list *timer) { - if (del_timer_sync(timer)) + if (del_timer_shutdown(timer)) __sock_put(sk); } EXPORT_SYMBOL(sk_stop_timer_sync); diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c index 66fc940f9521..549a4c1990ea 100644 --- a/net/ipv4/inet_timewait_sock.c +++ b/net/ipv4/inet_timewait_sock.c @@ -208,7 +208,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 (del_timer_shutdown(&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..459a80325247 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); + del_timer_shutdown(&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..9bd993046ebe 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); + del_timer_shutdown(&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..d4c7c67a4dee 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); + del_timer_shutdown(&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..6a8b0e80385b 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); + del_timer_shutdown(&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..1f08ba927d0e 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); + del_timer_shutdown(&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..f939a00826d6 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); + del_timer_shutdown(&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..0093fa1d07c6 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); + del_timer_shutdown(&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..3f353f1f38ee 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); + del_timer_shutdown(&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..b23fbd2d4b5a 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); + del_timer_shutdown(&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..b07bc9f9b3bd 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); + del_timer_shutdown(&serv->sv_temptimer); /* * The last user is gone and thus all sockets have to be destroyed to diff --git a/net/tipc/discover.c b/net/tipc/discover.c index da69e1abf68f..09d69670506e 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); + del_timer_shutdown(&d->timer); kfree_skb(d->skb); kfree(d); } diff --git a/net/tipc/monitor.c b/net/tipc/monitor.c index 9618e4429f0f..cedc4a468315 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); + del_timer_shutdown(&mon->timer); kfree(self->domain); kfree(self); kfree(mon); From patchwork Thu Oct 27 15:05:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11840 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp287356wru; Thu, 27 Oct 2022 08:12:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6qzneIqQrZaJMSgRlpL3dYI5CtNOZ2m0ZSWTcsTwMmgbqgfJlfSvR64eHsrv7WUfuaHPcm X-Received: by 2002:a17:906:7304:b0:6ff:a76:5b09 with SMTP id di4-20020a170906730400b006ff0a765b09mr41815862ejc.193.1666883534401; Thu, 27 Oct 2022 08:12:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883534; cv=none; d=google.com; s=arc-20160816; b=c60n8t7CyOJzaFj8eOZqWiFvUo18a+CPceJQHQbWbZJz5M3k4IbYIuVK6dQfa16xIB +fDjqHI4qP4XtnOf6ryi+BstVubbSK2JDpKYHGK8pGAB/8w/8Am/muMkAMphF8QA/Yfp EaaxwiTBqkbXeDGG/MAfZjAm120J9UxptdfpUsmw4t5iTNng97+BsVWjchs+ibasAYRj nBGJYchzgPd+VJBPhDq8r5gF3X+zc8xKQrm7wJ4qmoBJUU/lr/w2WA2lnB5fNHCJtZcF zmXTBUbUR8X40G5YNn9SwJSHgQZdmujvh9Lyio0/eyXKPgTSQuqAqQguxyiBWLpty2Wi lx0g== 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=fzr8Y6wveoEqIycO9L8kHEtVmDjMcrF4SYgUx58WS+4=; b=q2g+F2HpgZEBGRtlKQKd9c5vn+JaxKLx/uroXft1yD+SB1Q2Ag60iZAEy2l0FVZl+U Sp8rNlvTMqsp03VCUXqqRlHCJ9u+Eo/L3hE3txMuc6TKIywSJRI7PDt9DGcXJRlW85/1 xRYIHvEojZScUCtopSqDksUJD3FlayhZ8sp6+enW0RB24w7YeWbvFJzZeDk2knrDOeBW BXuPXqF5SSSbizEhxs6xwH/E4pC1VcLQTLpm+M1pqSJ0uHkgSOBeiQskKNE8I8jiRZ+O EVkOOK/rvzODyKoYxLWIgumOh9CqalNTxQHWSeEw68MQgA+e5o20iH3Kn7FBqoV79n31 sj7g== 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 k19-20020a508ad3000000b004599fc7f310si1554525edk.140.2022.10.27.08.11.49; Thu, 27 Oct 2022 08:12: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 S236457AbiJ0PKu (ORCPT + 99 others); Thu, 27 Oct 2022 11:10:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236073AbiJ0PJR (ORCPT ); Thu, 27 Oct 2022 11:09:17 -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 A71D418F90F; Thu, 27 Oct 2022 08:09:14 -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 82469623A9; Thu, 27 Oct 2022 15:09:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E98B0C433D6; Thu, 27 Oct 2022 15:09:13 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Vd-00Bvcm-0V; Thu, 27 Oct 2022 11:09:29 -0400 Message-ID: <20221027150928.983388020@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:45 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , 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 v2 20/31] timers: usb: Use del_timer_shutdown() before freeing timer References: <20221027150525.753064657@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?1747854069297134282?= X-GMAIL-MSGID: =?utf-8?q?1747854069297134282?= From: "Steven Rostedt (Google)" Before a timer is freed, del_timer_shutdown() 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/core/hub.c | 3 +++ drivers/usb/gadget/udc/m66592-udc.c | 2 +- drivers/usb/serial/garmin_gps.c | 2 +- drivers/usb/serial/mos7840.c | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index bbab424b0d55..397f263ab7da 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -1261,6 +1261,9 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type) /* Don't do a long sleep inside a workqueue routine */ if (type == HUB_INIT2) { + /* Timers must be shutdown before they are re-initialized */ + if (hub->init_work.work.func) + del_timer_shutdown(&hub->init_work.timer); INIT_DELAYED_WORK(&hub->init_work, hub_init_func3); queue_delayed_work(system_power_efficient_wq, &hub->init_work, diff --git a/drivers/usb/gadget/udc/m66592-udc.c b/drivers/usb/gadget/udc/m66592-udc.c index 931e6362a13d..a6e2f8358adf 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); + del_timer_shutdown(&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..2a53f26468bd 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); + del_timer_shutdown(&garmin_data_p->timer); kfree(garmin_data_p); } diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 6b12bb4648b8..a90a706d27de 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); + del_timer_shutdown(&mos7840_port->led_timer2); usb_kill_urb(mos7840_port->led_urb); usb_free_urb(mos7840_port->led_urb); From patchwork Thu Oct 27 15:05:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11837 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp287170wru; Thu, 27 Oct 2022 08:11:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6126iAvL98OSpE48omqiZReqLQ6uzlJRK9szwTbJ5uGK0AjcxOgTHjPGQ0PBVyDuD97/c+ X-Received: by 2002:a17:907:72cf:b0:7ad:7e95:69d7 with SMTP id du15-20020a17090772cf00b007ad7e9569d7mr7158151ejc.97.1666883518098; Thu, 27 Oct 2022 08:11:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883518; cv=none; d=google.com; s=arc-20160816; b=Pl9cmer+9NrNi3H1uQwiKEzho8iGXGZri/zN4Upd5AKnD77/rxcPCAi/NQfkVbq9r0 D4pO9nFT+OIkp+OuTopoxfXAmqPavL2P+rRn3sAGgcSdeMnwASfI+dCFhOSs9Yt8z2ia iu4KXe153pSYzZ76F3lENdv6Dpd1sjZ+i2hn+5DFcLBCzjSwHKH4ivvef3I9076deucH TalvoMj1s/C1CxlDsac8Ntd12GLorBQ8G+SQN812e708fWzrvSPV50EEttdjZk+C7Ppx 7Ol13YXRXEu0AJZ9Nq2L1tpNOKsmFEvOm+DEHAkScJjP0hxEqskIVEqgIhX+yRD1h+XL waHw== 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=qvIV17nAC1dw5GQVFlNDcDKM2LrRRV2gvfVzTbA05ZU=; b=iu2gL3pm2/7AmnyFnylhdg5Qwjyxqh8NS/62xoH9jPirhYTJ/9Sf76IdG/cQgSpEEp VdbcFf5zYLWR/fOH1slE4tD7BrM4XhkYEh1zE9RnA/wDDIWh4Jp/cVs73XrHTB7o0LMk RoKnWY9USqXR39wiykTclrp+zNoknURZnNXr3HnEiyzGCcP4UpvtKzv4lQ4yFzk8hvkl FwxhlzUwtZMvouB1NomRs9ffzzxDnkjOp63yzLSXRXJe0HcMgz3QEUOKY2M/nr82cWDW GPWPSCc5bJLiBAlYJ7EtfS1UmKpZaX8RZBz81kWQA5ZXx2ZBjurnu4Z2OhgfcvdmboD5 viKw== 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 m5-20020a056402430500b004590ae88029si2227633edc.610.2022.10.27.08.11.33; Thu, 27 Oct 2022 08:11: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 S236141AbiJ0PKo (ORCPT + 99 others); Thu, 27 Oct 2022 11:10:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236068AbiJ0PJR (ORCPT ); Thu, 27 Oct 2022 11:09:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7198018F26F; Thu, 27 Oct 2022 08:09:14 -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 5271F623AD; Thu, 27 Oct 2022 15:09:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E33EC43148; Thu, 27 Oct 2022 15:09:14 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Vd-00BvdL-18; Thu, 27 Oct 2022 11:09:29 -0400 Message-ID: <20221027150929.173042402@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:46 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Tejun Heo , Zefan Li , Johannes Weiner , cgroups@vger.kernel.org Subject: [RFC][PATCH v2 21/31] timers: cgroup: Use del_timer_shutdown() before freeing timer References: <20221027150525.753064657@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?1747854051800997570?= X-GMAIL-MSGID: =?utf-8?q?1747854051800997570?= From: "Steven Rostedt (Google)" Before a timer is freed, del_timer_shutdown() 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 7f486677ab1f..4b15a481ca2c 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -1669,7 +1669,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); + del_timer_shutdown(&cfile->notify_timer); } kernfs_remove_by_name(cgrp->kn, cgroup_file_name(cgrp, cft, name)); From patchwork Thu Oct 27 15:05:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11838 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp287309wru; Thu, 27 Oct 2022 08:12:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6hZzxObhgS2Rop+7oon3sjuoHorQYoq7/rOt/MjTfJao9EzK64AxRTSwLy2k4ZAytqxsml X-Received: by 2002:a17:907:75d0:b0:7ad:8a7a:1a53 with SMTP id jl16-20020a17090775d000b007ad8a7a1a53mr4319332ejc.47.1666883530636; Thu, 27 Oct 2022 08:12:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883530; cv=none; d=google.com; s=arc-20160816; b=mCKOfBaPPGMyRbSI8WH3saBDQOm+yuild76lXoNyPpHaVlCbpHhpU4CRH6NNGtusyA CQUphUu2193jXfanjlKovnucQZ8E3xRu3XVbLAnmEiBBhPWSx1AEW/tWCyo/2zoMUjZ9 W2zbESulk84qJNC+vqz52nowXsDRsjOMCLmrsjNjp8HY7odaXJuppmIQvsv/LqvHqTEw yxFN/+FZqpmnCNkdogvIDpPIg3psDK27nTczXuwYcAdlB9mujFKHLQCghfZMGWZqMcwi rd7KtYBoVD6oVPfReKGQ7cao6AWv92RnLGKyOpqn6uvasJDo0EjlwRWjQeveqKPXKo7a tJdg== 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=YTpRKrfVjguSQrLrMHNcSNQDiq8JMXCyBd+cVGuxVUg=; b=DPzIRe18HQf08UPezltVCe6RCNliOoLRvD+5PYbqnGHnXvHKRnb4FgE35fmfXQ68U1 y0U5DTrZi+QPHBVdFjtikUnZhi0hci6abbl3BLqH+sI0AUmj7Tsq+csAXzdfiBIpuDHK xefweaVlMzL1p62ARnfRAI38up874fHApMUfOPNnFATWB4gwjyPJNiIjE3gk1CFEzbDo +zX9sHUKPl3NGwq5Jz6+Vl+s6gXf7RuQNGpr5fAvmTLBZnRSI58GHaO0+wpuZABe/fwv SYPHJVF3MsvMOr+UrHJJq2c2hzW/xnrgboMjkoRPosFMGVzH9fK5wSjh2mr3+fkNBVew ROJg== 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 z25-20020a50cd19000000b00459cf784343si1581717edi.176.2022.10.27.08.11.46; Thu, 27 Oct 2022 08:12:10 -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 S236452AbiJ0PKs (ORCPT + 99 others); Thu, 27 Oct 2022 11:10:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236070AbiJ0PJR (ORCPT ); Thu, 27 Oct 2022 11:09:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 952F318F90B for ; Thu, 27 Oct 2022 08:09:14 -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 758FA623A3 for ; Thu, 27 Oct 2022 15:09:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50A2CC4314D; Thu, 27 Oct 2022 15:09:14 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Vd-00Bvdu-1k; Thu, 27 Oct 2022 11:09:29 -0400 Message-ID: <20221027150929.370900127@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:47 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Tejun Heo , Lai Jiangshan Subject: [RFC][PATCH v2 22/31] timers: workqueue: Use del_timer_shutdown() before freeing timer References: <20221027150525.753064657@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?1747854064708609547?= X-GMAIL-MSGID: =?utf-8?q?1747854064708609547?= From: "Steven Rostedt (Google)" Before a timer is freed, del_timer_shutdown() 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..47a7124bbea4 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); + del_timer_shutdown(&pool->idle_timer); + del_timer_shutdown(&pool->mayday_timer); /* RCU protected to allow dereferences from get_work_pool() */ call_rcu(&pool->rcu, rcu_free_pool); From patchwork Thu Oct 27 15:05:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11839 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp287357wru; Thu, 27 Oct 2022 08:12:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4z/GSZxCAnQO6ohIAl6lK16VnC8UyLaEJSztf6UDh0nU6UvlVNOa0zm7IqmqCxRmaPKF6G X-Received: by 2002:a17:906:5d0c:b0:7a5:ad82:f319 with SMTP id g12-20020a1709065d0c00b007a5ad82f319mr21019365ejt.318.1666883534419; Thu, 27 Oct 2022 08:12:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883534; cv=none; d=google.com; s=arc-20160816; b=tgvVMyPr9blH/moPuhW4tz7LGi9en0AiDM7aJiBaOhDiDN9XQcVS48FFjZPy+vfL1y eRWSDhladDNYIl5xJwZsJXafgEXjVb7kxivWEMInT9ix3cF0sAvRBk1f+ry6LqldZKtr OPEMLJ9Gll61ttJhP3KrcQWVCF7kwr5JMZWzCEg8ruVcdLG7zl+axcWYJ01eyCMg2b/k +uvaIRnKo5acLctF7VuiNbZu/uRgfi7cBdHaf3U956OmPJATINfTbYIT2ASqaXO7pHjz kS6kEZsV4udmWyFWcmrGfZaVyzXq4yQyRcDwzFeJ0GxPrRWHNvvAN9hZHbsyT3b7AQLG 7N+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=2Pi5z+SAZUlwWP1lW4UaefzEyKERlKuZL1W71h4uA/Q=; b=toEUZLt/Ymp6F+1LLEF6WsXcXkVydzIga6g63DPPN/VGZtlQgbjtmFDVh2Ig6xRgkz 8u8gdiCBTHVf4V+mh1ApARLGGMMJQj/qi2n4z8+dk4LX6xKchIiw3675Z8oAvA2r32Lj EhV4jj+pQaKPSxtbMHtPa9xrXfMq1v+CTM1TscRz9ugChMiM56IV6VwJKI2+NEfVdgFO m2znZKrrZn2YftsYIrwT3agfYSVYj/zwJQ/LuPqmoQw8OA+AaLphlv8z2Pu2W0Kk/nSu tO2wMqsPr9XkvChDxsZXx/B27EMXaCRZNn5sDQ9NpKacvqX3dCacy5EQ32V4x5XzeYus Q/SQ== 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 lf20-20020a170906ae5400b0078054af5eeasi1324554ejb.374.2022.10.27.08.11.50; Thu, 27 Oct 2022 08:12: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 S236166AbiJ0PKz (ORCPT + 99 others); Thu, 27 Oct 2022 11:10:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236085AbiJ0PJS (ORCPT ); Thu, 27 Oct 2022 11:09:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EB1B18F243; Thu, 27 Oct 2022 08:09:15 -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 AB4D8623B8; Thu, 27 Oct 2022 15:09:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 831DFC43470; Thu, 27 Oct 2022 15:09:14 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Vd-00BveT-2M; Thu, 27 Oct 2022 11:09:29 -0400 Message-ID: <20221027150929.558084770@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:48 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Krzysztof Kozlowski , "David S. Miller" , Dan Carpenter , Chengfeng Ye , Lin Ma , Duoming Zhou , netdev@vger.kernel.org Subject: [RFC][PATCH v2 23/31] timers: nfc: pn533: Use del_timer_shutdown() before freeing timer References: <20221027150525.753064657@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?1747854068935957089?= X-GMAIL-MSGID: =?utf-8?q?1747854068935957089?= From: "Steven Rostedt (Google)" Before a timer is freed, del_timer_shutdown() 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..e882191649cd 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); + del_timer_shutdown(&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..a40676422237 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); + del_timer_shutdown(&pn532->cmd_timeout); kfree_skb(pn532->recv_skb); kfree(pn532); } From patchwork Thu Oct 27 15:05:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11843 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp287531wru; Thu, 27 Oct 2022 08:12:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4+M05Xpc1pBBpF6VvbdnzshjxOT2b0anaXV8V1eFN7A3n+tjKO6FaE+Sbq/HC7pMNgR0of X-Received: by 2002:a17:907:1ddd:b0:7ad:8371:b59c with SMTP id og29-20020a1709071ddd00b007ad8371b59cmr6484442ejc.429.1666883550512; Thu, 27 Oct 2022 08:12:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883550; cv=none; d=google.com; s=arc-20160816; b=XvwQxu8pbv2ChtyzNFm86zWKzGyshzt6E98g0hHRdLdFd19fuDBnR+kHZp0Oaec5Jk j4gneukuOBstI8ytoWPa71Smve9BN6E2UXzwc/bWmjywsXk7nhdmuegQj7aT13FnVoAF pL/XzA1DsUtK6t25Scfk6NyIH2PDeHufme+3nLcONXwgWW3TukmTSFOJa/sTrS2q2b1F KssZ10fxBawyzvELOlm6W7pUwWUzugWe/TW4GgAKAzCAzM1IoDSlhF4mENnCMCBURJYU qia+VKJAA/uP/n31eKVkWVFVM0kmlXhp9HQmWhQp9deoGnOw8ufm2sQmGB/cMf7Gu3Ba 2ZYg== 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=HpXPPwRIe1ojYt0JdPs6C/GAXYJXj1ZQK/zWSpL8lv8=; b=tSqreP1o42BGTLgTGzC7ff/lt7HNmeszY9dXPHDo7XfSnLuO/onfojfmEtraJILYvo ao8azn+VLTHEMdbf1NL4e4Yz1QE1qjxPLqU+G1dhuhm3TOnKGyIyuqDkUUucNA84Eu8X Ye38sqPNo1YcnDeMaTV6b9Zk+IhNjwubGP5OCYyVVdHfQlyw80j2gZ36aJeCoeAPdQKP fpGS0BgKNs8JyfgUV7itzYb4pwLxZXFTz8c5lIvIpdkvhMWi+UPSNFm+aproUN2RVycj /fq5ENYBi448fJZ7Giw3ldbr6BiNUN0VdDfvJMn3ZyfQ0QVd5KcRwWvut9OZ5welKghO qkVQ== 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 h1-20020a056402280100b00461eff7bb0csi2248591ede.31.2022.10.27.08.12.05; Thu, 27 Oct 2022 08:12:30 -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 S236176AbiJ0PLH (ORCPT + 99 others); Thu, 27 Oct 2022 11:11:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236093AbiJ0PJS (ORCPT ); Thu, 27 Oct 2022 11:09:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86C2A18F936 for ; Thu, 27 Oct 2022 08:09:15 -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 48BC8623B1 for ; Thu, 27 Oct 2022 15:09:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7914C43141; Thu, 27 Oct 2022 15:09:14 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Vd-00Bvf2-2y; Thu, 27 Oct 2022 11:09:29 -0400 Message-ID: <20221027150929.749620335@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:49 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Dominik Brodowski , Minghao Chi , Tony Lindgren , Arnd Bergmann , Cai Huoqing , "Paul E. McKenney" Subject: [RFC][PATCH v2 24/31] timers: pcmcia: Use del_timer_shutdown() before freeing timer References: <20221027150525.753064657@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?1747854085719250086?= X-GMAIL-MSGID: =?utf-8?q?1747854085719250086?= From: "Steven Rostedt (Google)" Before a timer is freed, del_timer_shutdown() must be called. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: Dominik Brodowski Cc: Minghao Chi Cc: Tony Lindgren Cc: Arnd Bergmann Cc: "Souptick Joarder Cc: Cai Huoqing Cc: "Paul E. McKenney" 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..1e96fa905bb0 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); + del_timer_shutdown(&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..3c9a77a4c5d5 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); + del_timer_shutdown(&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..f4c0ea073f14 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); + del_timer_shutdown(&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..539aeca0501c 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); + del_timer_shutdown(&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); + del_timer_shutdown(&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..8bceaf30d094 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); + del_timer_shutdown(&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); + del_timer_shutdown(&socket->poll_timer); unmap: iounmap(socket->base); yenta_free_resources(socket); From patchwork Thu Oct 27 15:05:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11842 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp287454wru; Thu, 27 Oct 2022 08:12:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4MxMFZIIkNTBRAGT+FNaW2kWyfIC97/BqdWxaMmx/aC6QVAVCWww5F/DjUBISvkAKggPN3 X-Received: by 2002:a17:907:b01:b0:78d:ce3d:905d with SMTP id h1-20020a1709070b0100b0078dce3d905dmr42111564ejl.45.1666883543677; Thu, 27 Oct 2022 08:12:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883543; cv=none; d=google.com; s=arc-20160816; b=XL/Y42rd8DRZQfaXg0QbLD7d6XiiJwwF0X3WIVw2iKShFEFYXjC3roKDoNkrFE5m/n Km8GZgVSBANOCbcEaFa/4jnaMGW3gKPGh/fkQUrMqFBU1JeNrQMskLen51PdRSNzCw+A GsoWyvepi0iMCeiHpANHghIMmRkuefMf3TU33BH6q14Il+eOvZ/FFMfyoMC8lClVBHdA 7BFmBWzKBP9obukMl5KW1g5mbYzv4oDLzUL1FoN/R8cikyDJskWt8jObtMCmzEMf1xjc OXHS9/GV/jRXveHfwcXvkjh3eCn8qxL53UHNST2FwlV6rkcb/Tfx0Yr7tBCydJ1IZjyc RliA== 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=+ZiM2WL2W+wDDLkGTxQJK3z+JCIJhYwjkVq2WJqyH9c=; b=GfHO1CNj8n+VKHN/m1Sozin9hiF+KyGCEYQzcyY//iIldHh8oNcwlYGb8DjKt4zQJ+ KUevdMZJOQKVDXAU7S08YJoCCJb07xH6BbxqoVAi1BsA6kSv67nfzrRlsQEPN17zbTNs Fgu1+DejTxjZzGP11O8uh0YeG+z7gI2ayDE3NFs07tjVK4Hew2T3AQQmtGKZq+k7x+Ti PZeBJ82fgAUE0O9H5jCO/uiZdC7kVMYRiXY5a2UMmQzAphWLwmzC5ceDmHfsFpBrOxKx nuDfTjNQwfY+t7LlbnGz+usABr4DSAxY8acjyk+cIXvPndXYJn2C+Rhm6sWEyynAiX9g rvjg== 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 m8-20020a170906848800b007ad7e956407si922410ejx.461.2022.10.27.08.12.00; Thu, 27 Oct 2022 08:12:23 -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 S236477AbiJ0PLC (ORCPT + 99 others); Thu, 27 Oct 2022 11:11:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236092AbiJ0PJS (ORCPT ); Thu, 27 Oct 2022 11:09:18 -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 EE15918F242; Thu, 27 Oct 2022 08:09:15 -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 7441162396; Thu, 27 Oct 2022 15:09:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5404C433D6; Thu, 27 Oct 2022 15:09:14 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Ve-00Bvfa-0M; Thu, 27 Oct 2022 11:09:30 -0400 Message-ID: <20221027150929.939073415@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:50 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Nilesh Javali , GR-QLogic-Storage-Upstream@marvell.com, "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org Subject: [RFC][PATCH v2 25/31] timers: scsi: Use del_timer_shutdown() before freeing timer References: <20221027150525.753064657@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?1747854078619469494?= X-GMAIL-MSGID: =?utf-8?q?1747854078619469494?= From: "Steven Rostedt (Google)" Before a timer is freed, del_timer_shutdown() must be called. 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 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_edif.c b/drivers/scsi/qla2xxx/qla_edif.c index 00ccc41cef14..01fc6869b99a 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); + del_timer_shutdown(&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); + del_timer_shutdown(&edif_entry->timer); ql_dbg(ql_dbg_edif, vha, 0x5033, "%s: releasing edif_entry %p, new sa_index: 0x%x\n", From patchwork Thu Oct 27 15:05:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11845 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp288556wru; Thu, 27 Oct 2022 08:14:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6hKRHRB9pvWWEvxFHxCouuDZMkMYFh7JkJibZ1o0iIpsOo+Qy4lzyp6yOERJSeWzNZ9QNb X-Received: by 2002:a05:6402:3213:b0:461:dec8:336d with SMTP id g19-20020a056402321300b00461dec8336dmr18653323eda.221.1666883657064; Thu, 27 Oct 2022 08:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883657; cv=none; d=google.com; s=arc-20160816; b=saVbITSFiUymz8TJq7lcAx4un83AeAHv2ZIlfpXttLhmaCPzU9OAuFRCieysxRswNi TUIH8lN5Yod5ELn18C+E0N6rbfBYPZH2k9SlDmP43Pe4zQSbW/0dqzgjLdGDQX70DhLO GwycBVdY8BRz7hSzUh+7+FRdUWtrdnYr2TAysUAMmhcQPmziX11ryeq3yQh/mC5eSxdv A1IZ1lBLs+4KlhSSrlcGo0C6pCeYE4FIHHc/e8CUk+iZ9GS/AYZQlFxVpvlJFsj4JNQo pT0WHi7Dt8+I/N6Eiuae1fgo89wA/fgn4sK9LGRgm1Tw26hh2rWd1tFGiIIWKRi+2AlC I6Lg== 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=t2ZZCrPVY0HVi/XJvqNDhAGre/ipex3cWMwE3RJtDBY=; b=S72E24VW0P6moz5UpfOZ7xsUU3ReZHOWn1ry89jwVFvrx5EVgbmiP1TvZEmZVgETrH taN3qHGMf95e8So65Vl9EdwQ7BnpPVE1sXouhZfeHKVGXdV+KjPokTPbnKAnUOy00wo1 /3u3fnwmZNs7MSJahIIxBMsI0B+kgfwsY9d5XMJHvMBQOADKz58homZuTwbaM3zp6Rrw 3eKsfD+tbpsEi4Fsyv61uXj6W3Sqm7HGjHQmgbPYKKwnkq0ONAPKM7jc38YeGEB/Lcl8 ArWGW1sf3doRaGy11pdLCbzyP483T6XrRDOABdfUkMFZ3iBhMc3PdmCPn3xQ4vdgxbKI zgFg== 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 wt5-20020a170906ee8500b0078db719e54csi1958769ejb.98.2022.10.27.08.13.51; Thu, 27 Oct 2022 08:14:17 -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 S236016AbiJ0PL2 (ORCPT + 99 others); Thu, 27 Oct 2022 11:11:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236120AbiJ0PJS (ORCPT ); Thu, 27 Oct 2022 11:09:18 -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 4B757190447 for ; Thu, 27 Oct 2022 08:09:16 -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 A2A5662377 for ; Thu, 27 Oct 2022 15:09:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 191DBC43143; Thu, 27 Oct 2022 15:09:15 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Ve-00BvgA-0z; Thu, 27 Oct 2022 11:09:30 -0400 Message-ID: <20221027150930.128814334@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:51 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Greg Kroah-Hartman , Jiri Slaby Subject: [RFC][PATCH v2 26/31] timers: tty: Use del_timer_shutdown() before freeing timer References: <20221027150525.753064657@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?1747854197299659471?= X-GMAIL-MSGID: =?utf-8?q?1747854197299659471?= From: "Steven Rostedt (Google)" Before a timer is freed, del_timer_shutdown() 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) Reviewed-by: Jiri Slaby --- 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..1d167469a700 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); + del_timer_shutdown(&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..20b1c9802506 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); + del_timer_shutdown(&sysrq->keyreset_timer); input_unregister_handle(handle); kfree(sysrq); } From patchwork Thu Oct 27 15:05:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11846 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp288562wru; Thu, 27 Oct 2022 08:14:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5D1eWYwLd+vQqMo3biYNQX210oCmfm+8/1ZIni89haPf9h5d+E9taOjo0Oy+MYm0MqXwWU X-Received: by 2002:a17:907:7e87:b0:791:a477:1109 with SMTP id qb7-20020a1709077e8700b00791a4771109mr39404656ejc.354.1666883657386; Thu, 27 Oct 2022 08:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883657; cv=none; d=google.com; s=arc-20160816; b=dtkDiEHplgE33msVWzsUclErWT/CeSHb8MMKVLCauUshgxTpTKMEyD0BxErhHXD2nF GlhsXHZO1QjLhPaaMWneelzQGdf2t7RiMlSHJgN7vmP3zKgPyt1jC8wwR06MYJwDIEVx +WZZh3kvHujDwCnqw4mER2nJpMD40HV2hTSKjCEUshkGSQBtzIrJPpVOJLbyEfIvZEM/ pj1e4mPESp4TJ+k51LDjOVrUDCFBsNGnJurU2fe+k0kHmISqwhOUYj0M683tJaeNhXX9 m7a9NDVTLYmYJiqrS/JWvy/87Aqxg9qQeHAEvZuboy0Q7y+2HR6DQFDOmK1OAZ6e4+WA mm7g== 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=yCVp3WKmsW+m7Q5nR3e+rgwLsL1A1BuGiIiFpsBLjFc=; b=dyytPuCfwl/VJ+zodOwNYvWn3UTFR+RRvdMGCl8Sth3lEMKQyZeyuXuh9HGxRwdHaE +Ih3PX0qlGeQYR2ElczY9PdYixvx8S5f5llWK309AWLU53lip5lAL6oyOq+XnrtdIEBI LN9SvErV5FOjhr+qt2u8eS9t6/p9AgxDvxObLxQvH9x5mQ/yVwLzr7jZ/dc0fiLV//F8 wY1ukdVHoY8ECeouBe04GpvSJjb0A16geAXd8geNo5s4zSBwlwDavWRjbacfVu/0jqBO xWAiYPxjZ/LhI6PilkAPlQmvRr5+Kv1MGQKWUxdpFVVKQc+l8CsMXW89TCwToBq7tTyB rV7Q== 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 y10-20020a056402358a00b00461cb980126si1926030edc.309.2022.10.27.08.13.53; Thu, 27 Oct 2022 08:14:17 -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 S236503AbiJ0PLa (ORCPT + 99 others); Thu, 27 Oct 2022 11:11:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236125AbiJ0PJS (ORCPT ); Thu, 27 Oct 2022 11:09:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE29618F26D; Thu, 27 Oct 2022 08:09:15 -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 7A8B8623BB; Thu, 27 Oct 2022 15:09:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52D42C433B5; Thu, 27 Oct 2022 15:09:15 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Ve-00Bvgj-1a; Thu, 27 Oct 2022 11:09:30 -0400 Message-ID: <20221027150930.322796357@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:52 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , linux-ext4@vger.kernel.org Subject: [RFC][PATCH v2 27/31] timers: ext4: Use del_timer_shutdown() before freeing timer References: <20221027150525.753064657@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?1747854198172873912?= X-GMAIL-MSGID: =?utf-8?q?1747854198172873912?= From: "Steven Rostedt (Google)" Before a timer is freed, del_timer_shutdown() 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 989365b878a6..c8a59e3148e2 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); + del_timer_shutdown(&sbi->s_err_report); ext4_release_system_zone(sb); ext4_mb_release(sb); ext4_ext_release(sb); From patchwork Thu Oct 27 15:05:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11844 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp288113wru; Thu, 27 Oct 2022 08:13:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7DTI917EvjYSl/+/CFKpuBexgncqww6vNaf6TlZmMcRY8cGfo7sB5DTNwuEkoj9W4K6bEu X-Received: by 2002:a05:6402:2947:b0:451:32a:2222 with SMTP id ed7-20020a056402294700b00451032a2222mr45471768edb.376.1666883608482; Thu, 27 Oct 2022 08:13:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883608; cv=none; d=google.com; s=arc-20160816; b=bKjavLfKWP/yHdjMmUptOJCeTZGM3tho8YK9jkWJBkZGSWrnPIE8bzbgl6irLGya/3 3guO6MLYR5Dbn/meFXZisa1cdjlQpXcceSfdZrug72UIE7d2jQFaZI4W2jGAWRmbQF0E +QZTtu52PzGSopA6P42UI/vtUiLDQqnWEKG0EI6PH74kPa9E7p9xLTija/frWuoVnodF bQ/vxKysTacJ4K+uXAwLLNi0w1Zr2tr38sTqbeFqcjxjeiXOR4rH9CAPWP/L3eSC+6GH KIU32ceeKa8vaNajp4eH+p+wEUtLkspBzHLf3wZ6QsuNymD1pwYY6Bn/6XMhRI0gb4AU MgMg== 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=o+Qxlbpq7cXY84Ran2sV5m6w0zf1JZXvGBog8MgOtf4=; b=zTSW9BnLlLkYC3gvn79eMv8l0mndtQbcBwLiNw37jF12BYt5f95zqzfZLiqe0QgVuX ONgR+xFAqu84ovjwZUSxWNWrJiXLtsNhr0jnO/55anzDAr71Huu3of9p91oV5zBp7/Ql 7vGsQZSfnioLIi+rmkDNzaEe65Jw2J/+aQZdHC8HyHJWyG3KfXjEX4jAH+xJku3VRtpJ tQ8vdA58rVnTfRqv4TieV5Xq3d2lj++R9AnjzS75oagUvV7Eq10RN9lUIxTC+Dylvcoj qYIFrAhynOGLH8twsvEo1rUiPF+7RLcX17MJGexkSHhlN2sgvqgOoTyx7jAsk7tjRSmX IUsA== 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 kl7-20020a170907994700b00783a0e64f8asi1284605ejc.246.2022.10.27.08.13.03; Thu, 27 Oct 2022 08:13: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 S236493AbiJ0PLT (ORCPT + 99 others); Thu, 27 Oct 2022 11:11:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236087AbiJ0PJS (ORCPT ); Thu, 27 Oct 2022 11:09:18 -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 C309D18F0D8; Thu, 27 Oct 2022 08:09:15 -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 A3132623B9; Thu, 27 Oct 2022 15:09:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F4CCC43141; Thu, 27 Oct 2022 15:09:15 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Ve-00BvhI-2D; Thu, 27 Oct 2022 11:09:30 -0400 Message-ID: <20221027150930.513327801@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:53 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Ryusuke Konishi , linux-nilfs@vger.kernel.org Subject: [RFC][PATCH v2 28/31] timers: fs/nilfs2: Use del_timer_shutdown() before freeing timer References: <20221027150525.753064657@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?1747854146617464193?= X-GMAIL-MSGID: =?utf-8?q?1747854146617464193?= From: "Steven Rostedt (Google)" Before a timer is freed, del_timer_shutdown() 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..1d3f89de1cd2 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); + del_timer_shutdown(&sci->sc_timer); kfree(sci); } From patchwork Thu Oct 27 15:05: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: 11841 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp287413wru; Thu, 27 Oct 2022 08:12:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Q4WRbWidYJdAa+vA1rRPzr48s1GLi1O/vgBG0OFpGxsL2NiiBEPkg/V0+B5JH9bN4IdWf X-Received: by 2002:a05:6402:7c4:b0:462:9bc2:d0d0 with SMTP id u4-20020a05640207c400b004629bc2d0d0mr2819380edy.122.1666883539731; Thu, 27 Oct 2022 08:12:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883539; cv=none; d=google.com; s=arc-20160816; b=CBcxUeg8nLcaXWs1sU2qkmdWaXUrCW3CDdoFYfha7p9hSYSu3iUTcai94aXTqk3g6q lkTX141C97oz640lTPQgEAHq/9h6E8BQSi4j+COKsVBdlVBkhQY+EiZbewXUqO2J6Yvl XtDYgsLMH6mznDDRh+fAFzF7BkIvljMb8dQj9Xt90CeXywVYzRhvaMYGaCCpOFklyBLu hfOl8rIoRoXaAxMYR7/EuJ5enj5MadQ9ExnbrZFCJfiWRKPNN9xB1fWXVpC6FLC2JBdF Kgubj83GchNzWU5I4a6ei3m71PGWjV5FaXOLtL1y18p3qFL9QLr4+KlM7usxA9weJu+V 7RCg== 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=T/IFwRCpXkpfGu2EvCxOyZPHcmt/6iyYYKY1uEo6ZmA=; b=sWAPrrWVpcGt8nBl70jdG8565eg6sS8XeBZR5gGVJnDxmnZsa+BuRr8RdmUkITiGqn DP0nnmXDcT6Q6S2/hNZShIJkVoX625lcoOQaCiroRSlNgXDKAeZT/ORH3OLlfxXWkFaE bqxvp8gLr/jbhrKg1+CLMnsVZDiH7sAYtZR2Qqdarvfz7kLdQltflOlgor21jQv3FFqj TY/R3dWQpDkTOK9xHsh0DDY5qG4GmDYhlHYzMwpHEl2mIgowlaeoqH2a/8Eay+ON4QjW Cq8QhX3fP6kfM8r4jtlPhYTgAAYphYIMbV5SqJZaa64vHdCsvJMjUK+wD2lU8K1KDTd6 Kucg== 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 dd15-20020a1709069b8f00b007a7f207a1b9si1752589ejc.664.2022.10.27.08.11.55; Thu, 27 Oct 2022 08:12:19 -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 S236463AbiJ0PK6 (ORCPT + 99 others); Thu, 27 Oct 2022 11:10:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236088AbiJ0PJS (ORCPT ); Thu, 27 Oct 2022 11:09:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE38E18F937 for ; Thu, 27 Oct 2022 08:09:15 -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 C300C623C1 for ; Thu, 27 Oct 2022 15:09:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E617C433D7; Thu, 27 Oct 2022 15:09:15 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Ve-00Bvhr-2p; Thu, 27 Oct 2022 11:09:30 -0400 Message-ID: <20221027150930.702028779@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:54 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Jaroslav Kysela , Takashi Iwai , Austin Kim , alsa-devel@alsa-project.org Subject: [RFC][PATCH v2 29/31] timers: ALSA: Use del_timer_shutdown() before freeing timer References: <20221027150525.753064657@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?1747854074504736495?= X-GMAIL-MSGID: =?utf-8?q?1747854074504736495?= From: "Steven Rostedt (Google)" Before a timer is freed, del_timer_shutdown() 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..5269ab7321a4 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); + del_timer_shutdown(&chip->timer); kfree(chip); } diff --git a/sound/synth/emux/emux.c b/sound/synth/emux/emux.c index a870759d179e..a43025f466bb 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); + del_timer_shutdown(&emu->tlist); snd_emux_proc_free(emu); snd_emux_delete_virmidi(emu); From patchwork Thu Oct 27 15:05: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: 11847 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp292732wru; Thu, 27 Oct 2022 08:21:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM53/KQ6Z1icJGHhZDDkZbPNvltrx1K9hfoDuHnXfZaNglTbo9k5qePRMsel2nXBNqMfdf7h X-Received: by 2002:aa7:c6c8:0:b0:460:e19b:ec12 with SMTP id b8-20020aa7c6c8000000b00460e19bec12mr35584105eds.209.1666884113643; Thu, 27 Oct 2022 08:21:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666884113; cv=none; d=google.com; s=arc-20160816; b=Cy9aiaSYEOLqbIawnDjo/BE9QFG4Kqi4a5OQVtm5n2rK//3WXSJu85Z8UynWZRSkrd qq/uwOQ7KZ30cR0bAizHM4ryBxEWofcZ7JQeGm+pnPk7KV/nCyu8f5cPBaaeaV4IpB97 46erFagKja2GsLpP1NHHw3zcPF9fpIYU9JFjRSaW7cqM4IfD0h5KnvFoo9fs+5uF1fNa wrJFnivfeC5A6N9jm5Q31kydk1DUSr2wxgEe1kqMilFYLaP1dE1BokPGijo9hFjzMHnq 3wjOT6BmUpy9yT2NiPmMybp7p9/PN0coG2tg03ZBUJKC5YZFRxCVP2TNEa1HoZi2cAR9 ueYQ== 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=q7CuJ/THrQj8yd574SugeLAMwMVXAcoc8fno8C0QzY0=; b=d4+76WdnDMY0S+pYHPZRtM8mTDPLxwmtAbDX0Rtvpr8L1WEebS7N+OIqiJF1ZamuNh WOBFLmJfomDGh2hclRu6gWioOwcbuJVCJsSC62gJH99WY6CLgnCCTPNkYyt1VR+L/x7u OnsnBGL1vo7tRHCM/jD5/9LRYQmqZkjDYkM7ysnP56CPDOsD6NE5SLCV/Bew7C6tJ5YL IzuXFYDi7SATNAbrhNfywufbHU7nPHZhmmKdj83Yy1Wwiz4ivY8V1x7AnVUERkY+VtRX hl8SrID/xrJb2esa4dQVDSJkwPn7Gh0CQCRXyR72qQea0g7+5115+1ba3c6ca+0ZZGyT Bdlg== 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 a3-20020a50e703000000b0045d9ceae669si1567863edn.404.2022.10.27.08.21.27; Thu, 27 Oct 2022 08:21:53 -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 S235859AbiJ0PLs (ORCPT + 99 others); Thu, 27 Oct 2022 11:11:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236132AbiJ0PJS (ORCPT ); Thu, 27 Oct 2022 11:09:18 -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 82C9418E73F; Thu, 27 Oct 2022 08:09:16 -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 63A02623A7; Thu, 27 Oct 2022 15:09:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D64C0C433D6; Thu, 27 Oct 2022 15:09:15 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Vf-00BviQ-0B; Thu, 27 Oct 2022 11:09:31 -0400 Message-ID: <20221027150930.891623466@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:55 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Tony Luck , Borislav Petkov , Ingo Molnar , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-edac@vger.kernel.org Subject: [RFC][PATCH v2 30/31] timers: x86/mce: Use __init_timer() for resetting timers References: <20221027150525.753064657@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?1747854676580614470?= X-GMAIL-MSGID: =?utf-8?q?1747854676580614470?= From: "Steven Rostedt (Google)" DEBUG_OBJECTS_TIMERS is now checking if a timer is ever enqueued, and if so, it must call del_timer_shutdown() 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 Thu Oct 27 15:05: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: 11849 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp294544wru; Thu, 27 Oct 2022 08:25:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Uqzpw/s1ophDyzWTk/8N27WJEHfv4gRW7y5bX2u/Uv2Dc15vlhdX+rFfeOJbk9uTznJoI X-Received: by 2002:a17:906:8a47:b0:7a3:86dd:d33b with SMTP id gx7-20020a1709068a4700b007a386ddd33bmr23829152ejc.67.1666884316802; Thu, 27 Oct 2022 08:25:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666884316; cv=none; d=google.com; s=arc-20160816; b=0G4xw8U97kabVy/F28BS+/jkGWbbnWSGUpkUIvk/aTVzJkqvfnuYJEMEaR/K+OGKm8 P5/uEdfgxgrvYp9JFXNcb2Fn92L3whrSYmMs9HYSNXzf4K7zpkqUnM2Jn5t7gwTQg0nw 9b0ODovVUr3VRccvqMnYaveiHE1lY5BzykHN/bZaBm8ax3bQzN8GWnMEvYyNBeQDnLRD uYIXL/zIb7iGk9cy+VqQ6PEGjz7UzrX1f/U9J4WSDwdWYayqLQu8J1v/jt3WOQnDpNy0 /mNZ9cQ1zZItwaEWfnZWgbRfWThuTd3+Citi3o0AFHAfEDxlVj4x2qZX38UzzfJ3f0lr TdQg== 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=iQXpMS0sym5teXHWa9JhkeGsZbGGjuKneQJJZOMspaA=; b=oMwQBD7OMHM0fTl9zgIP0K2y+k4NiZB4Rq/sGU9NR60VU+wZJjqWEWqGTam5f3WFIQ LoyD+F9Pc3r3SSiuMRPhferfUnxIlMxI6OP7BoDthDIFQDXw23KUvEoTQ5WuIXPMArm8 O+iO1FBBaE4DWx/Jkktcg7oB3p766b31S4bHm32yeSiIUoy0pSNhjCBEuHC37XmF2+D2 e4T0iqrN5KrXHGl1yyWrUZIBTBLeaeTjVrHfeaAiL4hGpFc6kBgyv4XBazRWyHpNAeHt IIq2dGMd4E7Rl7P8OWHmw3J7xF+FzopK7jaxOYIb+TQ4B3UuI8b/5pK195qglb8lSQWu VZdQ== 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 hr31-20020a1709073f9f00b0078e1246e7d6si1769121ejc.748.2022.10.27.08.24.51; Thu, 27 Oct 2022 08:25:16 -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 S236523AbiJ0PMA (ORCPT + 99 others); Thu, 27 Oct 2022 11:12:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236159AbiJ0PJT (ORCPT ); Thu, 27 Oct 2022 11:09:19 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9454918F24A for ; Thu, 27 Oct 2022 08:09:18 -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 4D54AB826A9 for ; Thu, 27 Oct 2022 15:09:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F8C6C433D7; Thu, 27 Oct 2022 15:09:16 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Vf-00Bviz-0n; Thu, 27 Oct 2022 11:09:31 -0400 Message-ID: <20221027150931.071195430@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:56 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , John Stultz Subject: [RFC][PATCH v2 31/31] timers: Expand DEBUG_OBJECTS_TIMER to check if it ever was used References: <20221027150525.753064657@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?1747854889732915958?= X-GMAIL-MSGID: =?utf-8?q?1747854889732915958?= 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 del_timer_shutdown() is to be called before freeing, move the checks of DEBUG_OBJECTS_TIMER to if it ever gets armed to where del_timer_shutdown() is called. If there's a case where a timer is armed, and then freed without calling del_timer_shutdown() DEBUG_OBJECTS_TIMER will now trigger on it. This catches cases that are potential issues instead of just catching when the race condition occurs. Cc: Thomas Gleixner Cc: John Stultz Cc: Stephen Boyd Signed-off-by: Steven Rostedt (Google) --- include/linux/timer.h | 20 ++++++++++++++++++-- kernel/time/timer.c | 16 +++++++++++----- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/include/linux/timer.h b/include/linux/timer.h index daccfe33da42..d4d90149d015 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -18,6 +18,9 @@ struct timer_list { void (*function)(struct timer_list *); u32 flags; +#ifdef CONFIG_DEBUG_OBJECTS_TIMERS + u32 enabled; +#endif #ifdef CONFIG_LOCKDEP struct lockdep_map lockdep_map; #endif @@ -128,6 +131,19 @@ 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 = 0; \ + __init_timer((_timer), (_fn), (_flags)); \ + } while (0) +#else +#define __init_timer_debug(_timer, _fn, _flags) \ + do { \ + __init_timer((_timer), (_fn), (_flags)); \ + } while (0) +#endif + /** * timer_setup - prepare a timer for first use * @timer: the timer in question @@ -139,7 +155,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)) @@ -207,7 +223,7 @@ static inline int del_timer_shutdown(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) del_timer_shutdown(t) extern void init_timers(void); struct hrtimer; diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 111a3550b3f2..1d17552b3ede 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -774,17 +774,22 @@ static const struct debug_obj_descr timer_debug_descr = { static inline void debug_timer_init(struct timer_list *timer) { - debug_object_init(timer, &timer_debug_descr); + if (!timer->enabled) + debug_object_init(timer, &timer_debug_descr); } static inline void debug_timer_activate(struct timer_list *timer) { - debug_object_activate(timer, &timer_debug_descr); + if (!timer->enabled) { + timer->enabled = 1; + debug_object_activate(timer, &timer_debug_descr); + } } static inline void debug_timer_deactivate(struct timer_list *timer) { - debug_object_deactivate(timer, &timer_debug_descr); + if (timer->enabled) + debug_object_deactivate(timer, &timer_debug_descr); } static inline void debug_timer_assert_init(struct timer_list *timer) @@ -828,7 +833,6 @@ static inline void debug_init(struct timer_list *timer) static inline void debug_deactivate(struct timer_list *timer) { - debug_timer_deactivate(timer); trace_timer_cancel(timer); } @@ -1281,8 +1285,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); + } raw_spin_unlock_irqrestore(&base->lock, flags);