From patchwork Sat Nov 5 06:00:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15907 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp829487wru; Fri, 4 Nov 2022 23:03:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM630XaPv9pYhwBkz6jbbVgKA+nNaSsvxP6ej9zpVap9yDgh0Q+clZsH7MPGCCVZ3bNGUHOo X-Received: by 2002:a63:ff4f:0:b0:439:61d6:197 with SMTP id s15-20020a63ff4f000000b0043961d60197mr32874589pgk.67.1667628227724; Fri, 04 Nov 2022 23:03:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628227; cv=none; d=google.com; s=arc-20160816; b=YatUvL//9Dm8yk2h1RIsIyjfekO5kH64ELlGDQLazrd/qQJdOXISWI5LzKoyxhrRVc kmm4oRNU7gbz9CxoCj9SgpFGtEbrC55kjGa1OQjIad3AW6JMCyVKgFPSS+paM3RlUYYB 7R2WfIX8n+nBQHkV9Upn5jzDv21lPLWMLk+LiAa9BMvN3ZNv6FaYPbL7B0Rwvrli+Cfz 3QNo/anj7Pge80kplV8LYyyMxnDIkid6HAy37OxHkHHjzFNLV8fA3HwznibnqmZVvHTD PcxfH9tck9mwVfS0z/d4fvJAgXzbtz9kNTwR34tlUxqGInaSM+dtbK6MkavE+ZMe5f26 x9uA== 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=em9iAyk0CTbCQlUK2lILCgLoAu2/EB9G6eH2NCjbt84=; b=YKVQJ5/wqgtS2Jk2YtAc99/hpwsgupoAwevWapa2yGn6HqUvWgYod1YTSzGnS5wRD7 ts9r0BN42luqZ9XI+NU5392eo2qjzlO90HSXNQRC6/6b6/+ynmaokmlq6NVvthFkYlX7 9C2ap1r5QYtyYBJG4rA9L/Bhdw3lYEWCf+xnv1sFMcEGzzWqr8cKutQjfC1gsC9hPN+8 GuIp43mJb+cU+lh2XjveIP2tcJcWn+ZBuWkFhlEsZTMigBJXAhVFk1M9qeIU9INUgag/ QxnhXAx+NJd00Nwa6NWTQ7MWUTXpIfNf0AvXSyIGG1G0muNzJhhpRXcDTvnJ+LTxWDUo pAlQ== 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 m12-20020a656a0c000000b0044d72a10ab0si2370537pgu.342.2022.11.04.23.03.35; Fri, 04 Nov 2022 23:03:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229947AbiKEGDC (ORCPT + 99 others); Sat, 5 Nov 2022 02:03:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229547AbiKEGBa (ORCPT ); Sat, 5 Nov 2022 02:01:30 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E32F030560; Fri, 4 Nov 2022 23:01:29 -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 81756B830BB; Sat, 5 Nov 2022 06:01:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17943C433D7; Sat, 5 Nov 2022 06:01:27 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFf-007OfS-0g; Sat, 05 Nov 2022 02:01:55 -0400 Message-ID: <20221105060155.047357452@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:25 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Chuck Lever , Jeff Layton , Trond Myklebust , Anna Schumaker , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-nfs@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v4a 01/38] SUNRPC/xprt: Use del_timer_sync() instead of del_singleshot_timer_sync() References: <20221105060024.598488967@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?1748634936379482998?= X-GMAIL-MSGID: =?utf-8?q?1748634936379482998?= From: "Steven Rostedt (Google)" Back on June 22, 2005, it was decided to use del_singleshot_timer_sync() because it wouldn't loop like del_timer_sync(), and since the timer that was being removed was not about to be rearmed, it was considered an efficiency to use del_singleshot_timer_sync() over del_timer_sync(). But on June 23, 2005, commit 55c888d6d09a0 ("timers fixes/improvements") happened, which converted del_singleshot_timer_sync() into: #define del_singleshot_timer_sync(t) del_timer_sync(t) Making the to equivalent. Now work is being done to add a "shutdown" state to timers where a timer must be in that state in order to be freed to prevent use-after-free bugs caused by timers being re-armed just before being freed, the del_singleshot_timer_sync() is now being converted into something that will set the timer to the shutdown state. This means that once del_singleshot_timer_sync() is called, the timer can no longer be re-armed. As the timer here will be re-armed, it can not use del_singleshot_timer_sync(). But as the reason it was used in the first place no longer exists, just use del_timer_sync(). Link: https://lore.kernel.org/lkml/20221028145005.28bc324d@gandalf.local.home/ Cc: Chuck Lever Cc: Jeff Layton Cc: Trond Myklebust Cc: Anna Schumaker Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: linux-nfs@vger.kernel.org Cc: netdev@vger.kernel.org Fixes: 0f9dc2b16884b ("RPC: Clean up socket autodisconnect") Signed-off-by: Steven Rostedt (Google) --- net/sunrpc/xprt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 656cec208371..ab453ede54f0 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -1164,7 +1164,7 @@ xprt_request_enqueue_receive(struct rpc_task *task) spin_unlock(&xprt->queue_lock); /* Turn off autodisconnect */ - del_singleshot_timer_sync(&xprt->timer); + del_timer_sync(&xprt->timer); return 0; } From patchwork Sat Nov 5 06:00: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: 15893 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp829222wru; Fri, 4 Nov 2022 23:03:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM72eAe2OuIK9u4CE3U8uKae4nLJcOxE8B4RsZExvN21DbI4/jjm8TSjQbQRd/uGB4X1zixZ X-Received: by 2002:a17:903:2343:b0:188:5f62:8e15 with SMTP id c3-20020a170903234300b001885f628e15mr8830813plh.5.1667628192914; Fri, 04 Nov 2022 23:03:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628192; cv=none; d=google.com; s=arc-20160816; b=fHU3T01tjNYZykKzAiNoIcu1xTzYQKQPzoVfrlwZBLPQPl0vcr5TX7j1WtbcYOMTOI Vlh1IqU9FXTBr3AAsA1pxhj5ylY4jJikYFfvZjra1Lat/qkD66v5PvFryKug96aeRMAa +dI26YcqRyptFKyrxyyZ4SDR6joWDC4zWW72ZXBPA0WuJWekc6sd8I5yY4MbkADrKNaV ojs/zIVTTFQJVQOY6qwu3OJP12tyiXBU++8r76Hg+bYADM+kQAj7Nt2xW2OMWASLhBQM zh1+w9zu+qpWEPC/+5pTNT0/2ezbbopBHMfS4vke2gBGc/Tq5nBC+N58h3GdogdZBwAa mKeQ== 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=Qlw9xC2rS1sqjX/RhIwtZmOVoSy0Fo5N1QjRkn7Ke2s=; b=fdS60XzX8XT0mbhU2pJBEkwXOHmaePAgvi+/p8oF2zFGjAelVNF3YZFMjFj9NX9iFi 4XWbG6pPRR+ZcHSQm9ID3bnbaHq7Jq07AlP/BjeOZCQttV++8pmQ9jKbnXF5mtUeoE/G qrUNS2rgwuOrZznruFwLTZkR6rC6g8SyhJdTA7iGpq+BZwxJJbmgdZ+bl/fsRxzN2P4e XVNLby3eKxZ/BXtHqFm+42z2+CFoVPislG3f6HXknud/tU+Qof40KoW0VNG0hiPPeC7l YBMaaciM28shx8lDiF53zbcE5IkGRkkJTs5WS+kNkNA/WVyA/Ip02Z8JtcdLPCMknGOt X4vw== 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 ob6-20020a17090b390600b00213997a5fe6si2234750pjb.113.2022.11.04.23.03.00; Fri, 04 Nov 2022 23:03:12 -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 S229477AbiKEGBh (ORCPT + 99 others); Sat, 5 Nov 2022 02:01:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229511AbiKEGBa (ORCPT ); Sat, 5 Nov 2022 02:01:30 -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 B39772D764 for ; Fri, 4 Nov 2022 23:01:28 -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 42FA8609D0 for ; Sat, 5 Nov 2022 06:01:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84B9FC43147; Sat, 5 Nov 2022 06:01:27 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFf-007OgY-1q; Sat, 05 Nov 2022 02:01:55 -0400 Message-ID: <20221105060155.409832154@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:27 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Mark Rutland , Marc Zyngier , Daniel Lezcano , linux-arm-kernel@lists.infradead.org Subject: [PATCH v4a 03/38] clocksource/drivers/arm_arch_timer: Do not use timer namespace for timer_shutdown() function References: <20221105060024.598488967@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?1748634900240336571?= X-GMAIL-MSGID: =?utf-8?q?1748634900240336571?= From: "Steven Rostedt (Google)" A new "shutdown" timer state is being added to the generic timer code. One of the functions to change the timer into the state is called "timer_shutdown()". This means that there can not be other functions called "timer_shutdown()" as the timer code owns the "timer_*" name space. Rename timer_shutdown() to clk_timer_shutdown() to avoid this conflict. Cc: Mark Rutland Cc: Marc Zyngier Cc: Daniel Lezcano Cc: Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Steven Rostedt (Google) Reviewed-by: Guenter Roeck --- drivers/clocksource/arm_arch_timer.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index a7ff77550e17..c36042d6a2f8 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -687,8 +687,8 @@ static irqreturn_t arch_timer_handler_virt_mem(int irq, void *dev_id) return timer_handler(ARCH_TIMER_MEM_VIRT_ACCESS, evt); } -static __always_inline int timer_shutdown(const int access, - struct clock_event_device *clk) +static __always_inline int clk_timer_shutdown(const int access, + struct clock_event_device *clk) { unsigned long ctrl; @@ -701,22 +701,22 @@ static __always_inline int timer_shutdown(const int access, static int arch_timer_shutdown_virt(struct clock_event_device *clk) { - return timer_shutdown(ARCH_TIMER_VIRT_ACCESS, clk); + return clk_timer_shutdown(ARCH_TIMER_VIRT_ACCESS, clk); } static int arch_timer_shutdown_phys(struct clock_event_device *clk) { - return timer_shutdown(ARCH_TIMER_PHYS_ACCESS, clk); + return clk_timer_shutdown(ARCH_TIMER_PHYS_ACCESS, clk); } static int arch_timer_shutdown_virt_mem(struct clock_event_device *clk) { - return timer_shutdown(ARCH_TIMER_MEM_VIRT_ACCESS, clk); + return clk_timer_shutdown(ARCH_TIMER_MEM_VIRT_ACCESS, clk); } static int arch_timer_shutdown_phys_mem(struct clock_event_device *clk) { - return timer_shutdown(ARCH_TIMER_MEM_PHYS_ACCESS, clk); + return clk_timer_shutdown(ARCH_TIMER_MEM_PHYS_ACCESS, clk); } static __always_inline void set_next_event(const int access, unsigned long evt, From patchwork Sat Nov 5 06:00: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: 15901 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp829349wru; Fri, 4 Nov 2022 23:03:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7kVJV90FfbV44GKGqftPwQMKTrtVBwp3c9JkMuz1YoEqPelKhttkyUAbO9bWL5wR6WgYaR X-Received: by 2002:a17:902:7689:b0:187:1461:9b27 with SMTP id m9-20020a170902768900b0018714619b27mr449457pll.165.1667628209185; Fri, 04 Nov 2022 23:03:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628209; cv=none; d=google.com; s=arc-20160816; b=UJhO4NMmK/IoNl/5QNkz2Jcn83B9gA+/nWSphPCk2OrgurgWYEei+Ob9l/JdWpNeId 6O6Bt+MWOaDM4dStZI5AfB7iGGgEAIiWEVhRx2g19Zsk7g5mwxz7W1zEbRXN7eNU4SR1 UtHbpyJ9E++9iQezb6l1FUmrMjWvb/h+PfUFdNOGEvYyRYGncBC1HHWbgt++mIRZer1N JtBiqEfYdkG28Qb4WOfWXqaK4KDirdqY3rry/gcYjt9657QHnkMw4TNg8eupZZ4+LgMP xW3gcymydUV6UxmeMRPZ1ly6Nqyy5aB26YJYlUJxDJ8onzxepHJ+2v6OADYQNx/FH0Hd rqtQ== 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=wQ/9JX2FW1D7V7oy37/oHyM+7UeRX3yjhvj/TQvvxJU=; b=hMyl8bDMlTiqgO5zkqI7EYnjvXkO06mT80gtuhgppo0z3QjLW7w0DCfwCZXrjJFlJE aH0MvdaFVpeBymoSlty8h3c89KVhWppUgl1dbXDBtrZahLU3YRMOdpB0ZxxWKHzC6BuH Cv6tgtXe9+W2MMA7ZAF6MO0NCFyrEWZ05BY0y3338YfFEOD0xoh2HlJY/1JAFzbFCDoI UjOhVC43sRoNtCuss+WiQC46ikQb9EEX7lqPGJ+7k5YCJEC1TYTy3dxntPsi+33w+ybg GD9MdPMlgwGxBH0pL3FPsIe5oLqK8YtZ43Dy9TU+aD6TWeknuP3SXlJohnjXXA0jyHP8 wtZg== 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 a8-20020a63e848000000b0046ff70b1cf3si2000422pgk.463.2022.11.04.23.03.16; Fri, 04 Nov 2022 23:03:29 -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 S229749AbiKEGBp (ORCPT + 99 others); Sat, 5 Nov 2022 02:01:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229542AbiKEGBa (ORCPT ); Sat, 5 Nov 2022 02:01:30 -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 BE40E30548 for ; Fri, 4 Nov 2022 23:01:28 -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 47D01609EB for ; Sat, 5 Nov 2022 06:01:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F225C43148; Sat, 5 Nov 2022 06:01:27 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFf-007Oh6-2R; Sat, 05 Nov 2022 02:01:55 -0400 Message-ID: <20221105060155.592778858@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:28 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Daniel Lezcano Subject: [PATCH v4a 04/38] clocksource/drivers/sp804: Do not use timer namespace for timer_shutdown() function References: <20221105060024.598488967@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?1748634917237832084?= X-GMAIL-MSGID: =?utf-8?q?1748634917237832084?= From: "Steven Rostedt (Google)" A new "shutdown" timer state is being added to the generic timer code. One of the functions to change the timer into the state is called "timer_shutdown()". This means that there can not be other functions called "timer_shutdown()" as the timer code owns the "timer_*" name space. Rename timer_shutdown() to evt_timer_shutdown() to avoid this conflict. Cc: Daniel Lezcano Cc: Thomas Gleixner Signed-off-by: Steven Rostedt (Google) Reviewed-by: Guenter Roeck --- drivers/clocksource/timer-sp804.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/clocksource/timer-sp804.c b/drivers/clocksource/timer-sp804.c index e6a87f4af2b5..cd1916c05325 100644 --- a/drivers/clocksource/timer-sp804.c +++ b/drivers/clocksource/timer-sp804.c @@ -155,14 +155,14 @@ static irqreturn_t sp804_timer_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static inline void timer_shutdown(struct clock_event_device *evt) +static inline void evt_timer_shutdown(struct clock_event_device *evt) { writel(0, common_clkevt->ctrl); } static int sp804_shutdown(struct clock_event_device *evt) { - timer_shutdown(evt); + evt_timer_shutdown(evt); return 0; } @@ -171,7 +171,7 @@ static int sp804_set_periodic(struct clock_event_device *evt) unsigned long ctrl = TIMER_CTRL_32BIT | TIMER_CTRL_IE | TIMER_CTRL_PERIODIC | TIMER_CTRL_ENABLE; - timer_shutdown(evt); + evt_timer_shutdown(evt); writel(common_clkevt->reload, common_clkevt->load); writel(ctrl, common_clkevt->ctrl); return 0; From patchwork Sat Nov 5 06:00:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15908 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp829852wru; Fri, 4 Nov 2022 23:04:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6s/f8zZq6R7L+QvmqXBfGcR/MQ7N3lfJ8pureflStDYsTeSfIadoVZZyhNKPkCnURRv6KP X-Received: by 2002:a17:903:1207:b0:185:4042:23d2 with SMTP id l7-20020a170903120700b00185404223d2mr38388369plh.143.1667628275938; Fri, 04 Nov 2022 23:04:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628275; cv=none; d=google.com; s=arc-20160816; b=enZgnbdAX6vMBA+JLLPuHwK8ly7nPEUuc7gO6I8zbYy+PLjEoN852ABiIUk7Oa1hjz 0I4KGGctmyi4fqLhigrH+mS1sci+HojNLcj3eo/qDKuS+vuIUZoKZKQBcc6sn4TLKPYb XzP9R32MrkH0AV4ROwyTaNxR/4CL5nresq7mck3DUlR/Qhf8r8EBXQf2MRnpENb1/Iiv s8oFX47+p9yugkQcPAN5s4SN1gmcbFbkz9lDGBG4fvJG7wvQWAuU7h0S3mDgSNHocVcv gobY11BzFVGinucNI1f45eTi/Uzt0vPZNxFHJLDBdlawyTaAi87rnj6Pn+IP6WUJgDKc J6uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=WAqDd1tnAJTJYasjPPgY+hLtSrFpMoqsJLCfHN23Hro=; b=PEkzwek/iZgxplxNdvc6xqOVA9Be+ib2FZ+C22HPKZMPvz5OoFNg1nrW1rJyCEy6h1 QF1kqmWzkSeLeMT3l5uq/WlEhC5mnJxpejjfcTJMP7AWjaqo3ruEhojfSHxWxryYDAx/ 2f60gg3i3XWZjg5goqUkXwqHa+/53svNHhDNEsLo6zLuf5oWpcGAeLvmIR/WUzbiEcJg D4sdXR9RBfGsx9qDFIdikQRS7JkLyBfsIhHg+xW6+JLA/A5iWCmcM9R7cFN/u0BANHCm X3sjb33rcmmzoQlHejrTIwg401OpnkwluMzV2cvRGd+uyBLsGOrnDqxrmMTfAAspdbYw vUqg== 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 c10-20020a170902d48a00b00186994f6e90si2315963plg.529.2022.11.04.23.04.22; Fri, 04 Nov 2022 23:04:35 -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 S229887AbiKEGCg (ORCPT + 99 others); Sat, 5 Nov 2022 02:02:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229600AbiKEGBe (ORCPT ); Sat, 5 Nov 2022 02:01:34 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C382D2D1FD for ; Fri, 4 Nov 2022 23:01:30 -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 28AD1B830BE for ; Sat, 5 Nov 2022 06:01:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9B08C4314D; Sat, 5 Nov 2022 06:01:27 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFf-007Ohe-30; Sat, 05 Nov 2022 02:01:55 -0400 Message-ID: <20221105060155.775989316@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:29 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton Subject: [PATCH v4a 05/38] timers: Add timer_shutdown_sync() and timer_shutdown() to be called before freeing timers References: <20221105060024.598488967@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?1748634987354070219?= X-GMAIL-MSGID: =?utf-8?q?1748634987354070219?= From: "Steven Rostedt (Google)" We are hitting a common bug were a timer is being triggered after it is freed. This causes a corruption in the timer link list and crashes the kernel. Unfortunately it is not easy to know what timer it was that was freed. Looking at the code, it appears that there are several cases that del_timer() is used when del_timer_sync() should have been. Add a timer_shutdown_sync() that not only does a del_timer_sync() but will mark the timer as terminated in case it gets rearmed, it will trigger a WARN_ON. The timer_shutdown_sync() is more likely to be used by developers that are about to free a timer, then using del_timer_sync() as the latter is not as obvious to being needed for freeing. Having the word "shutdown" in the name of the function will hopefully help developers know that that function needs to be called before freeing. The added bonus is the marking of the timer as being freed such that it will trigger a warning if it gets rearmed. At least that way if the system crashes on a freed timer, at least we may see which timer it was that was freed. There's some situations that already know that the timer is shutdown and does not need to perform the synchronization (or can not due to its context). For these locations there's timer_shutdown() that only shuts down the timer (prevents it from being rearmed) but does not add checks if the timer is currently running. This code is taken from Thomas Gleixner's "untested" version from my original patch and modified after testing and with some other comments from Linus addressed. As well as some extra comments added. Link: https://lore.kernel.org/all/87pmlrkgi3.ffs@tglx/ Signed-off-by: Steven Rostedt (Google) --- .../RCU/Design/Requirements/Requirements.rst | 2 +- Documentation/core-api/local_ops.rst | 2 +- Documentation/kernel-hacking/locking.rst | 5 ++ include/linux/timer.h | 64 +++++++++++++++++-- kernel/time/timer.c | 64 ++++++++++--------- 5 files changed, 98 insertions(+), 39 deletions(-) diff --git a/Documentation/RCU/Design/Requirements/Requirements.rst b/Documentation/RCU/Design/Requirements/Requirements.rst index a0f8164c8513..ec6de88846b9 100644 --- a/Documentation/RCU/Design/Requirements/Requirements.rst +++ b/Documentation/RCU/Design/Requirements/Requirements.rst @@ -1858,7 +1858,7 @@ unloaded. After a given module has been unloaded, any attempt to call one of its functions results in a segmentation fault. The module-unload functions must therefore cancel any delayed calls to loadable-module functions, for example, any outstanding mod_timer() must be dealt -with via del_timer_sync() or similar. +with via timer_shutdown_sync(). Unfortunately, there is no way to cancel an RCU callback; once you invoke call_rcu(), the callback function is eventually going to be diff --git a/Documentation/core-api/local_ops.rst b/Documentation/core-api/local_ops.rst index 2ac3f9f29845..0b42ceaaf3c4 100644 --- a/Documentation/core-api/local_ops.rst +++ b/Documentation/core-api/local_ops.rst @@ -191,7 +191,7 @@ Here is a sample module which implements a basic per cpu counter using static void __exit test_exit(void) { - del_timer_sync(&test_timer); + timer_shutdown_sync(&test_timer); } module_init(test_init); diff --git a/Documentation/kernel-hacking/locking.rst b/Documentation/kernel-hacking/locking.rst index 6805ae6e86e6..eb341b69fd15 100644 --- a/Documentation/kernel-hacking/locking.rst +++ b/Documentation/kernel-hacking/locking.rst @@ -1009,6 +1009,11 @@ use del_timer_sync() (``include/linux/timer.h``) to handle this case. It returns the number of times the timer had to be deleted before we finally stopped it from adding itself back in. +Before freeing a timer, timer_shutdown() or timer_shutdown_sync() should be +called which will keep it from being rearmed, although if it is rearmed, it +will produce a warning. + + Locking Speed ============= diff --git a/include/linux/timer.h b/include/linux/timer.h index 648f00105f58..0758b447afd7 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -168,12 +168,45 @@ static inline int timer_pending(const struct timer_list * timer) return !hlist_unhashed_lockless(&timer->entry); } +extern int __del_timer(struct timer_list * timer, bool free); + extern void add_timer_on(struct timer_list *timer, int cpu); -extern int del_timer(struct timer_list * timer); extern int mod_timer(struct timer_list *timer, unsigned long expires); extern int mod_timer_pending(struct timer_list *timer, unsigned long expires); extern int timer_reduce(struct timer_list *timer, unsigned long expires); +/** + * del_timer - deactivate a timer. + * @timer: the timer to be deactivated + * + * del_timer() deactivates a timer - this works on both active and inactive + * timers. + * + * The function returns whether it has deactivated a pending timer or not. + * (ie. del_timer() of an inactive timer returns 0, del_timer() of an + * active timer returns 1.) + */ +static inline int del_timer(struct timer_list *timer) +{ + return __del_timer(timer, false); +} + +/** + * timer_shutdown - deactivate a timer and shut it down + * @timer: the timer to be deactivated + * + * timer_shutdown() deactivates a timer - this works on both active + * and inactive timers, and will prevent it from being rearmed. + * + * The function returns whether it has deactivated a pending timer or not. + * (ie. timer_shutdown() of an inactive timer returns 0, + * timer_shutdown() of an active timer returns 1.) + */ +static inline int timer_shutdown(struct timer_list *timer) +{ + return __del_timer(timer, true); +} + /* * The jiffies value which is added to now, when there is no timer * in the timer wheel: @@ -183,14 +216,31 @@ extern int timer_reduce(struct timer_list *timer, unsigned long expires); extern void add_timer(struct timer_list *timer); extern int try_to_del_timer_sync(struct timer_list *timer); +extern int __del_timer_sync(struct timer_list *timer, bool free); -#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT) - extern int del_timer_sync(struct timer_list *timer); -#else -# define del_timer_sync(t) del_timer(t) -#endif +static inline int del_timer_sync(struct timer_list *timer) +{ + return __del_timer_sync(timer, false); +} + +/** + * timer_shutdown_sync - called before freeing the timer + * @timer: The timer to be freed + * + * Shutdown the timer before freeing. This will return when all pending timers + * have finished and it is safe to free the timer. + * + * Note, after calling this, if the timer is added back to the queue + * it will fail to be added and a WARNING will be triggered. + * + * Returns if it deactivated a pending timer or not. + */ +static inline int timer_shutdown_sync(struct timer_list *timer) +{ + return __del_timer_sync(timer, true); +} -#define del_singleshot_timer_sync(t) del_timer_sync(t) +#define del_singleshot_timer_sync(t) timer_shutdown_sync(t) extern void init_timers(void); struct hrtimer; diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 717fcb9fb14a..7c224766065e 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1017,7 +1017,8 @@ __mod_timer(struct timer_list *timer, unsigned long expires, unsigned int option unsigned int idx = UINT_MAX; int ret = 0; - BUG_ON(!timer->function); + if (WARN_ON_ONCE(!timer->function)) + return -EINVAL; /* * This is a common optimization triggered by the networking code - if @@ -1193,7 +1194,8 @@ EXPORT_SYMBOL(timer_reduce); */ void add_timer(struct timer_list *timer) { - BUG_ON(timer_pending(timer)); + if (WARN_ON_ONCE(timer_pending(timer))) + return; __mod_timer(timer, timer->expires, MOD_TIMER_NOTPENDING); } EXPORT_SYMBOL(add_timer); @@ -1210,7 +1212,8 @@ void add_timer_on(struct timer_list *timer, int cpu) struct timer_base *new_base, *base; unsigned long flags; - BUG_ON(timer_pending(timer) || !timer->function); + if (WARN_ON_ONCE(timer_pending(timer) || !timer->function)) + return; new_base = get_timer_cpu_base(timer->flags, cpu); @@ -1237,18 +1240,7 @@ void add_timer_on(struct timer_list *timer, int cpu) } EXPORT_SYMBOL_GPL(add_timer_on); -/** - * del_timer - deactivate a timer. - * @timer: the timer to be deactivated - * - * del_timer() deactivates a timer - this works on both active and inactive - * timers. - * - * The function returns whether it has deactivated a pending timer or not. - * (ie. del_timer() of an inactive timer returns 0, del_timer() of an - * active timer returns 1.) - */ -int del_timer(struct timer_list *timer) +int __del_timer(struct timer_list *timer, bool free) { struct timer_base *base; unsigned long flags; @@ -1259,21 +1251,20 @@ int del_timer(struct timer_list *timer) if (timer_pending(timer)) { base = lock_timer_base(timer, &flags); ret = detach_if_pending(timer, base, true); + if (free) + timer->function = NULL; + raw_spin_unlock_irqrestore(&base->lock, flags); + } else if (free) { + base = lock_timer_base(timer, &flags); + timer->function = NULL; raw_spin_unlock_irqrestore(&base->lock, flags); } return ret; } -EXPORT_SYMBOL(del_timer); +EXPORT_SYMBOL(__del_timer); -/** - * try_to_del_timer_sync - Try to deactivate a timer - * @timer: timer to delete - * - * This function tries to deactivate a timer. Upon successful (ret >= 0) - * exit the timer is not queued and the handler is not running on any CPU. - */ -int try_to_del_timer_sync(struct timer_list *timer) +static int __try_to_del_timer_sync(struct timer_list *timer, bool free) { struct timer_base *base; unsigned long flags; @@ -1285,11 +1276,25 @@ int try_to_del_timer_sync(struct timer_list *timer) if (base->running_timer != timer) ret = detach_if_pending(timer, base, true); + if (free) + timer->function = NULL; raw_spin_unlock_irqrestore(&base->lock, flags); return ret; } + +/** + * try_to_del_timer_sync - Try to deactivate a timer + * @timer: timer to delete + * + * This function tries to deactivate a timer. Upon successful (ret >= 0) + * exit the timer is not queued and the handler is not running on any CPU. + */ +int try_to_del_timer_sync(struct timer_list *timer) +{ + return __try_to_del_timer_sync(timer, false); +} EXPORT_SYMBOL(try_to_del_timer_sync); #ifdef CONFIG_PREEMPT_RT @@ -1365,10 +1370,10 @@ static inline void timer_sync_wait_running(struct timer_base *base) { } static inline void del_timer_wait_running(struct timer_list *timer) { } #endif -#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT) /** - * del_timer_sync - deactivate a timer and wait for the handler to finish. + * __del_timer_sync - deactivate a timer and wait for the handler to finish. * @timer: the timer to be deactivated + * @free: Set to true if the timer is about to be freed * * This function only differs from del_timer() on SMP: besides deactivating * the timer it also makes sure the handler has finished executing on other @@ -1402,7 +1407,7 @@ static inline void del_timer_wait_running(struct timer_list *timer) { } * * The function returns whether it has deactivated a pending timer or not. */ -int del_timer_sync(struct timer_list *timer) +int __del_timer_sync(struct timer_list *timer, bool free) { int ret; @@ -1432,7 +1437,7 @@ int del_timer_sync(struct timer_list *timer) lockdep_assert_preemption_enabled(); do { - ret = try_to_del_timer_sync(timer); + ret = __try_to_del_timer_sync(timer, free); if (unlikely(ret < 0)) { del_timer_wait_running(timer); @@ -1442,8 +1447,7 @@ int del_timer_sync(struct timer_list *timer) return ret; } -EXPORT_SYMBOL(del_timer_sync); -#endif +EXPORT_SYMBOL(__del_timer_sync); static void call_timer_fn(struct timer_list *timer, void (*fn)(struct timer_list *), From patchwork Sat Nov 5 06:00: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: 15903 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp829373wru; Fri, 4 Nov 2022 23:03:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6rzaoZKRrl44YOugBq30c8z4ds+J2NejW1kjkN4UvuF11A8FZ8Lf9iAGmzmXZf+VLA4+gJ X-Received: by 2002:aa7:9421:0:b0:56b:b2a8:6822 with SMTP id y1-20020aa79421000000b0056bb2a86822mr38814961pfo.86.1667628213129; Fri, 04 Nov 2022 23:03:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628213; cv=none; d=google.com; s=arc-20160816; b=K2Yab/PTiGsjbVdKD39MQraHTwdt3VuflaY/noakEBSI69sdPQSYw33BvRn7bOmF5j 4Xn4g0f7h0/DiKL2LwtH9+U9TMYP3CfyUoF0koPR9rFBLRVuUjGhu8MlooSOQY8TB3ek C2v/7PLYWj9veuzTeOOYJDpr1q5XPbJ595QUCsB4xlvumRJFw9xeOwqA9Fm7yvr10YZ6 rTcEUHDv5wAobZcBBI10sDorcxJc5sUadT9qfzj5vmEa/TM11OOhvXOY417YeduJSOzq YBKn/Ztuaz3ZwMppBeLAuYOj69pO7YUPIeNECvy9yCFqQaIQ9I+5312q304x00bj8Ifc ZQcQ== 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=qn9twAwRFqq1YDE3SrYlbyfJ+kHbRNWAZ3lHF2cpxbg=; b=FCawChPYJOPGBX26TbFUCesTdojdtzpu4+J/kdQI73+cx3/WpZT2335TihLs0/tt9q NLDo2GMBvi5LOrmCASFoZq8K5MBTlNYj3sKuHbLmGJF8FiTwsvfmPA9butUP+B15txb1 fp9NxRmmTC9pDZtCPGfOeU3cA0byJXHJgz891Ep9lxUGz+jJ+kudSu3Th33J5XoWkqvt m1OtRsiNLjf4+pPnWG0XQnIOKkrjAuMHW7pzO1F9KlbqkJWAH7ShnfY0czARypsROX42 T+FVVXGjbTxri4ZklE3bg9M8VfdDV6i39aEw15qlBmWmvB1snMx2qqE/K5Ii4zKV22F2 Ak2Q== 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 b4-20020a170902d50400b00187337cb651si2253624plg.505.2022.11.04.23.03.20; Fri, 04 Nov 2022 23:03: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 S229894AbiKEGCi (ORCPT + 99 others); Sat, 5 Nov 2022 02:02:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229571AbiKEGBc (ORCPT ); Sat, 5 Nov 2022 02:01:32 -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 C39B230F43; Fri, 4 Nov 2022 23:01:30 -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 36218B830BD; Sat, 5 Nov 2022 06:01:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E59C4C433B5; Sat, 5 Nov 2022 06:01:27 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFg-007OiC-0M; Sat, 05 Nov 2022 02:01:56 -0400 Message-ID: <20221105060155.948440898@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:30 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org Subject: [PATCH v4a 06/38] timers: sh: Use timer_shutdown_sync() before freeing timer References: <20221105060024.598488967@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?1748634921057220149?= X-GMAIL-MSGID: =?utf-8?q?1748634921057220149?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- arch/sh/drivers/push-switch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sh/drivers/push-switch.c b/arch/sh/drivers/push-switch.c index 2813140fd92b..c95f48ff3f6f 100644 --- a/arch/sh/drivers/push-switch.c +++ b/arch/sh/drivers/push-switch.c @@ -102,7 +102,7 @@ static int switch_drv_remove(struct platform_device *pdev) platform_set_drvdata(pdev, NULL); flush_work(&psw->work); - del_timer_sync(&psw->debounce); + timer_shutdown_sync(&psw->debounce); free_irq(irq, pdev); kfree(psw); From patchwork Sat Nov 5 06:00: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: 15888 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp828815wru; Fri, 4 Nov 2022 23:02:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4lrzKqFwZvNawNa6Qek2+S6IYN8qzvG8assXYECa0/sxk7LH0uZ8ByFWzC8x8aYx5W+FBV X-Received: by 2002:a63:4307:0:b0:464:a24d:8201 with SMTP id q7-20020a634307000000b00464a24d8201mr33935854pga.116.1667628143923; Fri, 04 Nov 2022 23:02:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628143; cv=none; d=google.com; s=arc-20160816; b=ken+xp1+U3pLpnTlCcGb1e3vtfBGqAjA8SBsmIr55CwI6wnVfQSdx9iEPEH3tEseHd i/nye3IPSX25yhLd/0EzU28xNkfMbKExLpWZoSG8IHAI1ZDxekRqk9WDZbtdfh3kTfXp eUP+gwKPACdXKjZ0uOWXhh6FuCuPzUaSTWMek52HCtn/8tG82FLH3CjJOp4+xM3LH1m7 zL0wML0VUIQ9H7/vVXIuvpCnKumioPQKoE0BkpvRbGnnRqNspqoAmLrCiLHwfyI5IXE1 3F2SsdCNDt3cIEO7L68E54OTFTtFYjIo4J1boRhfu1WZrvFr429v9+RBZXMLJlTMj4ZH VVJw== 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=mtNgni7UChPla6TVUcKRO9B42APNJICJOv46N9vTyZs=; b=PxCNI+f0uSfWry9moDhJa/8gDvp7dXdZPbEuxfdyJUCWGFR6avqnmI9YKGCvLIrRQ7 HKdYyBbZq0pIcaTCm4R8Gc77fXr8w1n0X0t5HwIBGv54+eJMr7sgqa03Za0z7EVyh1M/ DR5NzWqsqoRsBfA8vOrBR8iNEvr5j7IG5xBgOSJHf+4t4oZrY2SnvUL79wfK0ngtrBOv Y5HQbscNxSw0b5rFFrQEZuscU+LLLfzXu4kC1PE3VcoNGUtKx9wJsBzhidLGN4QC2AG5 0k/CxsBjCdA73FPhIAx5BOu/C2bTcUZzxUKNy4jKlvefvp3HTReZGgi+vCS24BKIcLnN JdWA== 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 w191-20020a6382c8000000b0046fc1844cb6si2065360pgd.548.2022.11.04.23.02.10; Fri, 04 Nov 2022 23:02: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 S229709AbiKEGBl (ORCPT + 99 others); Sat, 5 Nov 2022 02:01:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229544AbiKEGBa (ORCPT ); Sat, 5 Nov 2022 02:01:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BE633054F; Fri, 4 Nov 2022 23:01:29 -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 1250660A16; Sat, 5 Nov 2022 06:01:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7920EC43150; Sat, 5 Nov 2022 06:01:28 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFg-007OjK-1Y; Sat, 05 Nov 2022 02:01:56 -0400 Message-ID: <20221105060156.314289131@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:32 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , "Rafael J. Wysocki" , Len Brown , James Morse , Tony Luck , Borislav Petkov , Shuai Xue , Dave Hansen , Jarkko Sakkinen , linux-acpi@vger.kernel.org Subject: [PATCH v4a 08/38] timers: ACPI: Use timer_shutdown_sync() before freeing timer References: <20221105060024.598488967@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?1748634848335532801?= X-GMAIL-MSGID: =?utf-8?q?1748634848335532801?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ 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) --- drivers/acpi/apei/ghes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 9952f3a792ba..9a0e41c21cf9 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -1405,7 +1405,7 @@ static int ghes_remove(struct platform_device *ghes_dev) ghes->flags |= GHES_EXITING; switch (generic->notify.type) { case ACPI_HEST_NOTIFY_POLLED: - del_timer_sync(&ghes->timer); + timer_shutdown_sync(&ghes->timer); break; case ACPI_HEST_NOTIFY_EXTERNAL: free_irq(ghes->irq, ghes); From patchwork Sat Nov 5 06:00: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: 15909 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp829933wru; Fri, 4 Nov 2022 23:04:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5d4ImkBK9eGvPwNXZaRIjU/7SpnQCabtYsmk731EwoBmiJY8EmLzbExKeUV0fPJ+eEKJrg X-Received: by 2002:a17:90a:7061:b0:213:da75:f149 with SMTP id f88-20020a17090a706100b00213da75f149mr32262604pjk.85.1667628289013; Fri, 04 Nov 2022 23:04:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628289; cv=none; d=google.com; s=arc-20160816; b=K/Gjm9mgt2W+KRQ6JWPzXMIsRNJYhtvNHTYwhqT0QPa/TWdxi/w+lZICJHVmCAu/k8 U1djMNDwkf4cMyilkAfGngvvTy/9byLOM9YWw+GTqpMKcoxGSJAOlxKAOL7kiW3WP5A5 78W7cGMC211XODE9v2kuLOapfpft/rCDOhiHb0i+o5ufeWFck8aSJx+Ikbsa37OtDuuZ ifKIbiyaDWSNlnnV/VDWgJw9P9OOmcrhlkp8R3gkNMRllCkvR5Fso/SLgLsVYy7IcCt+ uVsBHCaQX6HuhsX73TVfc3X4Rpn7+DqUrc/qtpS2CW74lR2m3oeyP5wVRr7G33NQgTZb YBHw== 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=CqBFgolRWgug6E2gGNJzXZFY/P7ssFQv95w87kGNbXk=; b=NAhydTv5qjFrYxaW88GLqc8j4yedJ2A+omKwJurrMCVkv+kO5z5kAzC2ncYluNX8og avOOHr46YmJJzv5dTubMO9Z5aSjY0y1xTjEdRF8rITTU3RMGTGhVC0LEKVzK9CZTuK0B 9z0UHjH+oCz79le6q04XNufuxAp1yqm2Yb22WGOyal/sxjR+1rWUNNwOnvJO68xCyzUU pQaULa100XQopPEqTxuoJtqiMm/MahmWV2YHDf+Sx8SNkU5SzHg/OKE12ZxMx0muoE2t Rup1/qYuYtAt59h3pxu2XhwxH1jNStdPL4jkV7BRje9IAF0zuSy4Nd7XZ6uDpXQ5JfGo pN4w== 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 u18-20020a170902e81200b0017f61ac5a53si2532599plg.111.2022.11.04.23.04.36; Fri, 04 Nov 2022 23:04:49 -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 S229833AbiKEGDH (ORCPT + 99 others); Sat, 5 Nov 2022 02:03:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229545AbiKEGBa (ORCPT ); Sat, 5 Nov 2022 02:01:30 -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 920273055C; Fri, 4 Nov 2022 23:01:29 -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 063B0609AD; Sat, 5 Nov 2022 06:01:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 739A1C43152; Sat, 5 Nov 2022 06:01:28 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFg-007Ojt-29; Sat, 05 Nov 2022 02:01:56 -0400 Message-ID: <20221105060156.498024847@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:33 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Chas Williams <3chas3@gmail.com>, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org Subject: [PATCH v4a 09/38] timers: atm: Use timer_shutdown_sync() before freeing timer References: <20221105060024.598488967@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?1748635000354513962?= X-GMAIL-MSGID: =?utf-8?q?1748635000354513962?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ 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/idt77252.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c index 681cb3786794..99cae174d558 100644 --- a/drivers/atm/idt77252.c +++ b/drivers/atm/idt77252.c @@ -2213,7 +2213,7 @@ idt77252_init_ubr(struct idt77252_dev *card, struct vc_map *vc, } spin_unlock_irqrestore(&vc->lock, flags); if (est) { - del_timer_sync(&est->timer); + timer_shutdown_sync(&est->timer); kfree(est); } @@ -3752,7 +3752,7 @@ static void __exit idt77252_exit(void) card = idt77252_chain; dev = card->atmdev; idt77252_chain = card->next; - del_timer_sync(&card->tst_timer); + timer_shutdown_sync(&card->tst_timer); if (dev->phy->stop) dev->phy->stop(dev); From patchwork Sat Nov 5 06:00: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: 15896 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp829268wru; Fri, 4 Nov 2022 23:03:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6/H6LfMxz9sOrly21+y0NEuIuiw/HJkFb4qwS7005pnflae5zH006xGdlVz3WdGxkYFX98 X-Received: by 2002:a17:902:edcd:b0:17a:6fa:228d with SMTP id q13-20020a170902edcd00b0017a06fa228dmr39406747plk.29.1667628198454; Fri, 04 Nov 2022 23:03:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628198; cv=none; d=google.com; s=arc-20160816; b=gX5k3tBMbqvbjpyq57hgs52uSm8XzxxvFKCGovA4ezUHCbbEaH+gI3yg6wi6kOpamD uc/xGiYrMHJePPVILn9YUvA91F0eLF29Tc16WD2saw5pPqjEAqEq9wAwg1S98CCRIHSB frWM6++vJHqMUyjOPU/dSVCTmFaZZcv8Wf1c6FkJUnfb2aC3Jwa8OADpq4hAge4hHqgl VVeADjuOdA7L2H36I1zP4kQSfWsuw1ssMcd7ne5Olo+V0Ab3NztuMTXxcMt5CygR3IRK CTEZpAXWuHJ53wmXAygbJzbIkXaj9hd9H/X0nfBcYjcpyjtRRLe7mC4l/Bh9K3A5kNr4 JtGw== 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=YzGicS3q6s/hyPgHpdJHnDf/pdfSk/0UfRZaCbuf4OI=; b=YiclGR7Iy3CKcku+tWMsdqVVt+NjTBEvNrGnkVckHNqWvMMZY/bnCF4RukA+DlBKy8 EJJiq+eqstwfsRyeS+mVE8VY5mjv8CltTBtR4A8yCR6ucjowxSEQvfS8E3WDOZIcbSdn 9oKp5tG4S6+XW/IKlxtbcO+KCqY/oeCyZpAN0VTY2Vslm7rvGKU4SoBUsgmkg7lsLA0w ntrP5flnpDFKUBpM9H8nX9RwTQmtLi3Q996cpzZpZepNoheu/ZPTYQV5gY9bv3PePd66 jqaCc8RWuzDq1q6CWdyOCH/9jExdOTDbJxFRqPJAol3ZTdM4L4S72lEVSqH4IpSNet5m PW0Q== 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 j3-20020a17090a94c300b0020a1c6bb23csi5623216pjw.74.2022.11.04.23.03.05; Fri, 04 Nov 2022 23:03:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229797AbiKEGCL (ORCPT + 99 others); Sat, 5 Nov 2022 02:02:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229628AbiKEGBe (ORCPT ); Sat, 5 Nov 2022 02:01:34 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01CE83121C; Fri, 4 Nov 2022 23:01:31 -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 F40F5B830C6; Sat, 5 Nov 2022 06:01:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A421FC43141; Sat, 5 Nov 2022 06:01:28 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFg-007OkS-2j; Sat, 05 Nov 2022 02:01:56 -0400 Message-ID: <20221105060156.686027537@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:34 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , linux-bluetooth@vger.kernel.org Subject: [PATCH v4a 10/38] timers: Bluetooth: Use timer_shutdown_sync() before freeing timer References: <20221105060024.598488967@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?1748634906060382764?= X-GMAIL-MSGID: =?utf-8?q?1748634906060382764?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. In h5_close(), the timer is removed with del_timer_sync(), but it is only freed if hu->serdev is NULL. I added timer_shutdown_sync() just before it is freed. timer_shutdown() may also be used, but just in case it gets re-armed somehow, I figured another sync will keep that from being an issue. Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ Cc: Marcel Holtmann Cc: Johan Hedberg Cc: Luiz Augusto von Dentz Cc: linux-bluetooth@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- drivers/bluetooth/hci_bcsp.c | 2 +- drivers/bluetooth/hci_h5.c | 4 +++- drivers/bluetooth/hci_qca.c | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c index cf4a56095817..834b2efaa9bf 100644 --- a/drivers/bluetooth/hci_bcsp.c +++ b/drivers/bluetooth/hci_bcsp.c @@ -737,7 +737,7 @@ static int bcsp_close(struct hci_uart *hu) { struct bcsp_struct *bcsp = hu->priv; - del_timer_sync(&bcsp->tbcsp); + timer_shutdown_sync(&bcsp->tbcsp); hu->priv = NULL; diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c index c5a0409ef84f..633f3027abd2 100644 --- a/drivers/bluetooth/hci_h5.c +++ b/drivers/bluetooth/hci_h5.c @@ -265,8 +265,10 @@ static int h5_close(struct hci_uart *hu) if (h5->vnd && h5->vnd->close) h5->vnd->close(h5); - if (!hu->serdev) + if (!hu->serdev) { + timer_shutdown_sync(&h5->timer); kfree(h5); + } return 0; } diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index 8df11016fd51..eb81296b284c 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -697,8 +697,8 @@ static int qca_close(struct hci_uart *hu) skb_queue_purge(&qca->txq); skb_queue_purge(&qca->rx_memdump_q); destroy_workqueue(qca->workqueue); - del_timer_sync(&qca->tx_idle_timer); - del_timer_sync(&qca->wake_retrans_timer); + timer_shutdown_sync(&qca->tx_idle_timer); + timer_shutdown_sync(&qca->wake_retrans_timer); qca->hu = NULL; kfree_skb(qca->rx_skb); From patchwork Sat Nov 5 06:00: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: 15905 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp829435wru; Fri, 4 Nov 2022 23:03:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4bt7Cs97JOHaRuOWKeSWrE7AKOFEJKaL8k6Bv1wR78USicexIjymVRatugGxAycGn2kcs8 X-Received: by 2002:a17:902:8698:b0:181:f060:7133 with SMTP id g24-20020a170902869800b00181f0607133mr38552100plo.1.1667628219844; Fri, 04 Nov 2022 23:03:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628219; cv=none; d=google.com; s=arc-20160816; b=HNXZcQqQSylof7A49AeP1uzsffBDSLhjJxHcHWbviOKE3sKv/0d/5yZ6p3AWvL6JJ0 t1vzcRhRc9PDpQdmxfD9vvHlCRQAiTztbQiguf1OFOvfeWgzl42Q/fk9/l+C6Dogp93e a4N1G+B3SQTRKA8H5UrIzCv7GhSo1xAAPmCkrL2dBcuteTgvbsIjHusumwmkB+h8Ejca DF6HLTyBbynJ8Ft/gxXOdlNL6Gl7qbJHKHuV2lby718YXI3DjdzAB3Y/vHfMXcUuk3EM eRbTDUUh5Qe7KwQcZwRaAzfhPtfOLtdl1jW044246pUP7WgemkAsn0ZwQMsIC+N2Bsew J2Cw== 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=WxzNMVsKJvwBUKRdsSEGIIQZxZpB1Be3/JVzb4UOoLA=; b=I+N7B1LPrOAYh3SUg4SWdf4smdB6cwhVMy0D1KJYF13VocTN0CLZmRPkb2tvddNzqI wpw+EsXhhC1kdzTy9R5yidPDTnYJe6c4TKoBjZ5GKiR8D8ZfcFqihAp2d1UVdzSoU8qf g0SbGFFseWFZ8yaYFScPuGQLGRNpiYNplRRwyXp+BfHLQrc3hTm87PUBdfNr/ougMTEH k3/KPB6ICKFzuOmVZVHwNwwxCj6/gyEdYl39q2XrU6wKk12fdKZQQTzrVPLF9J4DVxua 6CffmE1NBviEjsmp44Bd5VFKWlH1IBnc9t1sbMp6c4yLrqNxdyV2Gn/dtCtBFwRVylEe e4cQ== 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 v1-20020a1709029a0100b00182c500d95bsi1697031plp.1.2022.11.04.23.03.27; Fri, 04 Nov 2022 23:03:39 -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 S229910AbiKEGCs (ORCPT + 99 others); Sat, 5 Nov 2022 02:02:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229550AbiKEGBb (ORCPT ); Sat, 5 Nov 2022 02:01:31 -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 4B89430567; Fri, 4 Nov 2022 23:01:30 -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 3244160A22; Sat, 5 Nov 2022 06:01:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A983C43145; Sat, 5 Nov 2022 06:01:29 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFh-007Olb-0g; Sat, 05 Nov 2022 02:01:57 -0400 Message-ID: <20221105060157.055629836@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:36 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , David Rheinsberg , Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org Subject: [PATCH v4a 12/38] timers: HID: Use timer_shutdown_sync() before freeing timer References: <20221105060024.598488967@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?1748634927915078077?= X-GMAIL-MSGID: =?utf-8?q?1748634927915078077?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ Cc: David Rheinsberg Cc: Jiri Kosina Cc: Benjamin Tissoires Cc: linux-input@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- drivers/hid/hid-wiimote-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-wiimote-core.c b/drivers/hid/hid-wiimote-core.c index 4399d6c6afef..2c94308dda3c 100644 --- a/drivers/hid/hid-wiimote-core.c +++ b/drivers/hid/hid-wiimote-core.c @@ -1764,7 +1764,7 @@ static void wiimote_destroy(struct wiimote_data *wdata) spin_unlock_irqrestore(&wdata->state.lock, flags); cancel_work_sync(&wdata->init_worker); - del_timer_sync(&wdata->timer); + timer_shutdown_sync(&wdata->timer); device_remove_file(&wdata->hdev->dev, &dev_attr_devtype); device_remove_file(&wdata->hdev->dev, &dev_attr_extension); From patchwork Sat Nov 5 06:00:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15904 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp829422wru; Fri, 4 Nov 2022 23:03:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM62DLrG25yLbXuLo4T3YF54OSMb4WCzTPVuzRDzpP4M//JvBxm1A32+3nbF6WqPff4oM60z X-Received: by 2002:a63:4a26:0:b0:46f:7b0f:1a60 with SMTP id x38-20020a634a26000000b0046f7b0f1a60mr19573516pga.131.1667628217933; Fri, 04 Nov 2022 23:03:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628217; cv=none; d=google.com; s=arc-20160816; b=mxHhjBdaQ7MYsGFG9Eho8h7kIoH6eHXqsTPzkY0cMV1ds0BrnpaS+vaX32z6kCtlOG +dBP944Y+B3wG4696o/NbKDMtRAhxMhqLB08h9H6aMR9IJ71EAZ+/t48xp+5CxWDQ09P o87DV9Bd72oij+ezsEOcfdIY8DEsp6pS8GbTdjD0UqUYskqTPpsO0BADEuuiZ5C8YtFh wdVAM8I/rajofZuOgDUpIOpuo8u7aZIt0rJ5raRXGFMe2q3i9milQ8NRoQIOaMsctNNj 8hyApDYCahU1xrrInIITOTH7LB5aW8gHP2GrwtXTqPiR2KSb0a2W2XrpYGJLNBVQQBfC 0/VA== 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=Zc1wzz+5hD/3vq8JO26Hkbx8RqCHxE6rHABZUf06KKE=; b=UvaX6b604AJalkVC3c/wyj+E1mFGEfoyjveizlKHMxJ2AFTXncf4sgn4poBcBJ5OUb pA/+wxFyCfXnKNKgaA0hjTFiMJKXozptsTUPzCJbZXMe0XOITxW8MSNIx4Sbxig8sRL3 bN0KuG/wVrg00PUhBy9hV0/GxovbWwuEeLZtSoRI1jDSP+JixT6wO2ZF+B2pG58ZUHLC oIXAkwE0hS5FmAzR9uNlcXuD65dDIzFfIOTLH9qe2jO3S6g9Oy8YZk962jq1pqH5nesh pcHgdAGz2hrKLFL5XcrCezZj9M4HnknjAoX7rLXz7tX/TGDdEJo+s4qXl+Fd8APHiB51 fF0w== 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 a10-20020a170902b58a00b00186dcc389a8si1786754pls.329.2022.11.04.23.03.25; Fri, 04 Nov 2022 23:03:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229902AbiKEGCn (ORCPT + 99 others); Sat, 5 Nov 2022 02:02:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbiKEGBc (ORCPT ); Sat, 5 Nov 2022 02:01:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB1C330F5F; Fri, 4 Nov 2022 23:01:30 -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 8683460A47; Sat, 5 Nov 2022 06:01:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61DE5C43148; Sat, 5 Nov 2022 06:01:29 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFh-007Omi-1s; Sat, 05 Nov 2022 02:01:57 -0400 Message-ID: <20221105060157.411823877@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:38 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Karsten Keil , netdev@vger.kernel.org Subject: [PATCH v4a 14/38] timers: mISDN: Use timer_shutdown_sync() before freeing timer References: <20221105060024.598488967@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?1748634926509234648?= X-GMAIL-MSGID: =?utf-8?q?1748634926509234648?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called, or at least timer_shutdown() (where sync is not possible in the context). Also remove the open coded "shutting down", and remove the unnecessary if statement of timer->function existing before calling timer_shutdown(). Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ Cc: Karsten Keil Cc: netdev@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- drivers/isdn/hardware/mISDN/hfcmulti.c | 5 +---- drivers/isdn/mISDN/l1oip_core.c | 4 ++-- drivers/isdn/mISDN/timerdev.c | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c index 4f7eaa17fb27..c7bb39c6b826 100644 --- a/drivers/isdn/hardware/mISDN/hfcmulti.c +++ b/drivers/isdn/hardware/mISDN/hfcmulti.c @@ -4543,10 +4543,7 @@ release_port(struct hfc_multi *hc, struct dchannel *dch) spin_lock_irqsave(&hc->lock, flags); - if (dch->timer.function) { - del_timer(&dch->timer); - dch->timer.function = NULL; - } + timer_shutdown(&dch->timer); if (hc->ctype == HFC_TYPE_E1) { /* E1 */ /* remove sync */ diff --git a/drivers/isdn/mISDN/l1oip_core.c b/drivers/isdn/mISDN/l1oip_core.c index a77195e378b7..182e3f489c60 100644 --- a/drivers/isdn/mISDN/l1oip_core.c +++ b/drivers/isdn/mISDN/l1oip_core.c @@ -1236,8 +1236,8 @@ release_card(struct l1oip *hc) hc->shutdown = true; - del_timer_sync(&hc->keep_tl); - del_timer_sync(&hc->timeout_tl); + timer_shutdown_sync(&hc->keep_tl); + timer_shutdown_sync(&hc->timeout_tl); cancel_work_sync(&hc->workq); diff --git a/drivers/isdn/mISDN/timerdev.c b/drivers/isdn/mISDN/timerdev.c index abdf36ac3bee..83d6b484d3c6 100644 --- a/drivers/isdn/mISDN/timerdev.c +++ b/drivers/isdn/mISDN/timerdev.c @@ -74,7 +74,7 @@ mISDN_close(struct inode *ino, struct file *filep) while (!list_empty(list)) { timer = list_first_entry(list, struct mISDNtimer, list); spin_unlock_irq(&dev->lock); - del_timer_sync(&timer->tl); + timer_shutdown_sync(&timer->tl); spin_lock_irq(&dev->lock); /* it might have been moved to ->expired */ list_del(&timer->list); @@ -204,7 +204,7 @@ misdn_del_timer(struct mISDNtimerdev *dev, int id) list_del_init(&timer->list); timer->id = -1; spin_unlock_irq(&dev->lock); - del_timer_sync(&timer->tl); + timer_shutdown_sync(&timer->tl); kfree(timer); return id; } From patchwork Sat Nov 5 06:00: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: 15906 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp829447wru; Fri, 4 Nov 2022 23:03:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM56ZpBtWFFRMpXCl///OJml3QglDWmBdAa0WIMyM84yE8qZH/zFTXHcNcMhTOVxJDmvQBX5 X-Received: by 2002:a17:902:ec81:b0:187:226d:7f9a with SMTP id x1-20020a170902ec8100b00187226d7f9amr30102368plg.164.1667628222429; Fri, 04 Nov 2022 23:03:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628222; cv=none; d=google.com; s=arc-20160816; b=BLvn5PzZLx1KtTxv+DnmDNLK2pGkT/3RpF7Ce/rLeN1+p7lFJ3ilzcs2BDziXwHkw8 JdzQH0roFHiX1JcFLA9706R68BXjgUl8hwYgSw8YtoTYu5JUA1PXEazsljXHulW9u9Xo WPXJap66z4gpCu9dDLX+bWg/bz6zoSRjtitFQskG3vk1NMcPGlWMTlM5t4CDxUkRuPXz YqEno59fJH/Abn73IZD2vmuzosj8kZv6ORGWZmAtHRrKKzYdbrc40JNerJ6suhYlY8DF lS8xzRK+XyHUkTy8h2TADfvOuwbzBvuF/AkZqIuflrnGOU9oulMDTVdTq5I8ujfWrrnM 3mfQ== 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=h3EvqLoy6pfqFb5s8t0W3WRphuqrx+hdmxxXiIUMaQk=; b=FgI1gPwJRcK47i64CvwOBFshVHJJupK3/Q4D8Beu6sky4OCqS1d4Md2BkcOzxOnmp0 t1ef5yFDU12en5+X+HYEH16hhqLx+EUmDf2NKVBXIEOM3pICtlPw39xxpnWquJLjBvjl mSLrDeQj0XQ28P+/Km7fJSK+YIQNsIbDaRLQLclwa6gYqaXcdgkjVQhc4mouUNrniTzc cuX4xrXWj4pD/V5NuN+0BckFbp53gYKWstgPLYsZsm3s9VkEzcmaVsbb3fg59oC2zXr1 o5ciZswwCUYVj1GCH8pqz1FP8GiYhYZgHrC1Cul0eQGscHKsUIeD2Qms75TLWfDwE+Aq P5bQ== 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 c11-20020a65674b000000b0041b577f3356si2170758pgu.720.2022.11.04.23.03.29; Fri, 04 Nov 2022 23:03:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229934AbiKEGCt (ORCPT + 99 others); Sat, 5 Nov 2022 02:02:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229572AbiKEGBc (ORCPT ); Sat, 5 Nov 2022 02:01:32 -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 D14E030F46; Fri, 4 Nov 2022 23:01:30 -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 B5A0B60A25; Sat, 5 Nov 2022 06:01:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 900FAC43470; Sat, 5 Nov 2022 06:01:29 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFh-007OnI-2T; Sat, 05 Nov 2022 02:01:57 -0400 Message-ID: <20221105060157.600537824@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:39 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Pavel Machek , linux-leds@vger.kernel.org Subject: [PATCH v4a 15/38] timers: leds: Use timer_shutdown_sync() before freeing timer References: <20221105060024.598488967@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?1748634930574575327?= X-GMAIL-MSGID: =?utf-8?q?1748634930574575327?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ Cc: Pavel Machek Cc: linux-leds@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- drivers/leds/trigger/ledtrig-pattern.c | 2 +- drivers/leds/trigger/ledtrig-transient.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/leds/trigger/ledtrig-pattern.c b/drivers/leds/trigger/ledtrig-pattern.c index 43a265dc4696..e996d61e3bd6 100644 --- a/drivers/leds/trigger/ledtrig-pattern.c +++ b/drivers/leds/trigger/ledtrig-pattern.c @@ -430,7 +430,7 @@ static void pattern_trig_deactivate(struct led_classdev *led_cdev) if (led_cdev->pattern_clear) led_cdev->pattern_clear(led_cdev); - del_timer_sync(&data->timer); + timer_shutdown_sync(&data->timer); led_set_brightness(led_cdev, LED_OFF); kfree(data); diff --git a/drivers/leds/trigger/ledtrig-transient.c b/drivers/leds/trigger/ledtrig-transient.c index 80635183fac8..f111fa7635e5 100644 --- a/drivers/leds/trigger/ledtrig-transient.c +++ b/drivers/leds/trigger/ledtrig-transient.c @@ -180,7 +180,7 @@ static void transient_trig_deactivate(struct led_classdev *led_cdev) { struct transient_trig_data *transient_data = led_get_trigger_data(led_cdev); - del_timer_sync(&transient_data->timer); + timer_shutdown_sync(&transient_data->timer); led_set_brightness_nosleep(led_cdev, transient_data->restore_state); kfree(transient_data); } From patchwork Sat Nov 5 06:00: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: 15892 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp829099wru; Fri, 4 Nov 2022 23:02:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM73lu0eiKLmBck+I4IZzh2ajKXZJGa3GkK1FU/CGkQmXF/VZQbDZv3YcOcyjcM3aGib7PR+ X-Received: by 2002:a17:902:d2c3:b0:17e:6852:1191 with SMTP id n3-20020a170902d2c300b0017e68521191mr443604plc.159.1667628179624; Fri, 04 Nov 2022 23:02:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628179; cv=none; d=google.com; s=arc-20160816; b=T6PRi0LJ6ySdzE4LsNB1h7utSH2Jy3Zib35fQIpYaYFj19GACSXqFwbGNmRr076pCD AWhIZlzm251R08QruwiZ8/33A5FPCL/EKNift20LdQIu3INTCFDJ2/DL6nxZImCbcf6o NA01mHYZ4i6KYbaRLuMs2R10FAoUlKImmCXFvLJqdEnK8oJClae/9rhdc7R+No9DOHJG 5uUh7eLaUKuIyFT2j7wFnXqc2N4qI8+AkY63hEh4hKNMWU7tRJwCzxdFriiPjFIXj6d2 6gUrrUJZbt9nRGipjyVVA4Wfv8QuFXMxQLKP0c+4x1rduI1DKPpdhgdF879GpIolOrYF TjOQ== 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=5N43WZteTOOF4IqS74jTjq8ZbOOkWAAdq71Ila3w/nM=; b=JymEKIibt5xMcyEtPHuAdxel2GLRVhfi1ApDc8RmF9ru6BOMITkEy/wIngSIS25ItO Kh/CXx8CMJQj0HK/VBtot3XGFu1/SVaVdpUrO5u+w8kFB5HH681APhwPiUnOA4zmDUM6 /y9i9+qZ4z5LtmY0qxzKKD0Oszq8Zfidl8Bt9xKz2jF/QBjdMz4vwfMFWlmo8S8AQ6s5 tbMtVuJz6J3+M0DUEIppZAA0hr+RhMsT9q37cCfeEUCIB4cLt0lpTFORNATwO883YNtC YoxCESjw522fLzE6Hd8/9B4+US64E0THcg5yu5W04EQKlZt93gVzXN0yEp2CdW8MWL4E u9Uw== 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 t2-20020a170902bc4200b001873fc89846si1722488plz.345.2022.11.04.23.02.44; Fri, 04 Nov 2022 23:02:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229767AbiKEGCD (ORCPT + 99 others); Sat, 5 Nov 2022 02:02:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229635AbiKEGBe (ORCPT ); Sat, 5 Nov 2022 02:01:34 -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 DDF5930F77; Fri, 4 Nov 2022 23:01:31 -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 430636098A; Sat, 5 Nov 2022 06:01:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E891EC43470; Sat, 5 Nov 2022 06:01:29 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFi-007OoQ-0O; Sat, 05 Nov 2022 02:01:58 -0400 Message-ID: <20221105060157.958177534@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:41 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Mirko Lindner , Stephen Hemminger , Martin KaFai Lau , Alexei Starovoitov , Kuniyuki Iwashima , Pavel Begunkov , Menglong Dong , linux-usb@vger.kernel.org, linux-wireless@vger.kernel.org, bridge@lists.linux-foundation.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, lvs-devel@vger.kernel.org, linux-afs@lists.infradead.org, linux-nfs@vger.kernel.org, tipc-discussion@lists.sourceforge.net Subject: [PATCH v4a 17/38] timers: net: Use timer_shutdown_sync() before freeing timer References: <20221105060024.598488967@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?1748634885947682985?= X-GMAIL-MSGID: =?utf-8?q?1748634885947682985?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. And if synchronization is already done, then at least timer_shutdown() needs to be called. Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ 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 | 7 +++---- 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 | 6 +++--- net/802/garp.c | 2 +- net/802/mrp.c | 2 +- net/bridge/br_multicast.c | 6 +++--- net/bridge/br_multicast_eht.c | 4 ++-- net/core/gen_estimator.c | 2 +- net/core/neighbour.c | 2 ++ net/ipv4/inet_timewait_sock.c | 1 + 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(+), 33 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index b5dcd15ced36..0b534d3ef3bd 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -15530,7 +15530,7 @@ static int i40e_init_recovery_mode(struct i40e_pf *pf, struct i40e_hw *hw) err_switch_setup: i40e_reset_interrupt_capability(pf); - del_timer_sync(&pf->service_timer); + timer_shutdown_sync(&pf->service_timer); i40e_shutdown_adminq(hw); iounmap(hw->hw_addr); pci_disable_pcie_error_reporting(pf->pdev); @@ -16149,7 +16149,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) kfree(pf->vsi); err_switch_setup: i40e_reset_interrupt_capability(pf); - del_timer_sync(&pf->service_timer); + timer_shutdown_sync(&pf->service_timer); err_mac_addr: err_configure_lan_hmc: (void)i40e_shutdown_lan_hmc(hw); @@ -16210,8 +16210,7 @@ static void i40e_remove(struct pci_dev *pdev) /* no more scheduling of any task */ set_bit(__I40E_SUSPENDED, pf->state); set_bit(__I40E_DOWN, pf->state); - if (pf->service_timer.function) - del_timer_sync(&pf->service_timer); + timer_shutdown_sync(&pf->service_timer); if (pf->service_task.func) cancel_work_sync(&pf->service_task); diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c index ab33ba1c3023..dc571e076180 100644 --- a/drivers/net/ethernet/marvell/sky2.c +++ b/drivers/net/ethernet/marvell/sky2.c @@ -5013,7 +5013,7 @@ static void sky2_remove(struct pci_dev *pdev) if (!hw) return; - del_timer_sync(&hw->watchdog_timer); + timer_shutdown_sync(&hw->watchdog_timer); cancel_work_sync(&hw->restart_work); for (i = hw->ports-1; i >= 0; --i) diff --git a/drivers/net/ethernet/sun/sunvnet.c b/drivers/net/ethernet/sun/sunvnet.c index acda6cbd0238..fe86fbd58586 100644 --- a/drivers/net/ethernet/sun/sunvnet.c +++ b/drivers/net/ethernet/sun/sunvnet.c @@ -524,7 +524,7 @@ static void vnet_port_remove(struct vio_dev *vdev) hlist_del_rcu(&port->hash); synchronize_rcu(); - del_timer_sync(&port->clean_timer); + timer_shutdown_sync(&port->clean_timer); sunvnet_port_rm_txq_common(port); netif_napi_del(&port->napi); sunvnet_port_free_tx_bufs_common(port); diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c index b3ae949e6f1c..673d3aa83792 100644 --- a/drivers/net/usb/sierra_net.c +++ b/drivers/net/usb/sierra_net.c @@ -759,7 +759,7 @@ static void sierra_net_unbind(struct usbnet *dev, struct usb_interface *intf) dev_dbg(&dev->udev->dev, "%s", __func__); /* kill the timer and work */ - del_timer_sync(&priv->sync_timer); + timer_shutdown_sync(&priv->sync_timer); cancel_work_sync(&priv->sierra_net_kevent); /* tell modem we are going away */ diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c index 3237d4b528b5..119d83acafd1 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c @@ -371,7 +371,7 @@ void iwl_dbg_tlv_del_timers(struct iwl_trans *trans) struct iwl_dbg_tlv_timer_node *node, *tmp; list_for_each_entry_safe(node, tmp, timer_list, list) { - del_timer_sync(&node->timer); + timer_shutdown_sync(&node->timer); list_del(&node->list); kfree(node); } diff --git a/drivers/net/wireless/intersil/hostap/hostap_ap.c b/drivers/net/wireless/intersil/hostap/hostap_ap.c index 462ccc7d7d1a..9b546a71e7a2 100644 --- a/drivers/net/wireless/intersil/hostap/hostap_ap.c +++ b/drivers/net/wireless/intersil/hostap/hostap_ap.c @@ -135,7 +135,7 @@ static void ap_free_sta(struct ap_data *ap, struct sta_info *sta) if (!sta->ap) kfree(sta->u.sta.challenge); - del_timer_sync(&sta->timer); + timer_shutdown_sync(&sta->timer); #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ kfree(sta); diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c index da2e6557e684..ea22a08e6c08 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.c +++ b/drivers/net/wireless/marvell/mwifiex/main.c @@ -123,7 +123,7 @@ static int mwifiex_unregister(struct mwifiex_adapter *adapter) if (adapter->if_ops.cleanup_if) adapter->if_ops.cleanup_if(adapter); - del_timer_sync(&adapter->cmd_timer); + timer_shutdown_sync(&adapter->cmd_timer); /* Free private structures */ for (i = 0; i < adapter->priv_num; i++) { diff --git a/drivers/net/wireless/microchip/wilc1000/hif.c b/drivers/net/wireless/microchip/wilc1000/hif.c index eb1d1ba3a443..131f9fd97c37 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); + timer_shutdown_sync(&hif_drv->scan_timer); + timer_shutdown_sync(&hif_drv->connect_timer); del_timer_sync(&vif->periodic_rssi); - del_timer_sync(&hif_drv->remain_on_ch_timer); + timer_shutdown_sync(&hif_drv->remain_on_ch_timer); if (hif_drv->usr_scan_req.scan_result) { hif_drv->usr_scan_req.scan_result(SCAN_EVENT_ABORTED, NULL, diff --git a/net/802/garp.c b/net/802/garp.c index fc9eb02a912f..87b2ddfe86ac 100644 --- a/net/802/garp.c +++ b/net/802/garp.c @@ -618,7 +618,7 @@ void garp_uninit_applicant(struct net_device *dev, struct garp_application *appl /* Delete timer and generate a final TRANSMIT_PDU event to flush out * all pending messages before the applicant is gone. */ - del_timer_sync(&app->join_timer); + timer_shutdown_sync(&app->join_timer); spin_lock_bh(&app->lock); garp_gid_event(app, GARP_EVENT_TRANSMIT_PDU); diff --git a/net/802/mrp.c b/net/802/mrp.c index 155f74d8b14f..a744a28477dd 100644 --- a/net/802/mrp.c +++ b/net/802/mrp.c @@ -904,7 +904,7 @@ void mrp_uninit_applicant(struct net_device *dev, struct mrp_application *appl) * all pending messages before the applicant is gone. */ del_timer_sync(&app->join_timer); - del_timer_sync(&app->periodic_timer); + timer_shutdown_sync(&app->periodic_timer); spin_lock_bh(&app->lock); mrp_mad_event(app, MRP_EVENT_TX); diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index db4f2641d1cd..16d2a7064e44 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c @@ -605,7 +605,7 @@ static void br_multicast_destroy_mdb_entry(struct net_bridge_mcast_gc *gc) WARN_ON(!hlist_unhashed(&mp->mdb_node)); WARN_ON(mp->ports); - del_timer_sync(&mp->timer); + timer_shutdown_sync(&mp->timer); kfree_rcu(mp, rcu); } @@ -646,7 +646,7 @@ static void br_multicast_destroy_group_src(struct net_bridge_mcast_gc *gc) src = container_of(gc, struct net_bridge_group_src, mcast_gc); WARN_ON(!hlist_unhashed(&src->node)); - del_timer_sync(&src->timer); + timer_shutdown_sync(&src->timer); kfree_rcu(src, rcu); } @@ -671,7 +671,7 @@ static void br_multicast_destroy_port_group(struct net_bridge_mcast_gc *gc) WARN_ON(!hlist_empty(&pg->src_list)); del_timer_sync(&pg->rexmit_timer); - del_timer_sync(&pg->timer); + timer_shutdown_sync(&pg->timer); kfree_rcu(pg, rcu); } diff --git a/net/bridge/br_multicast_eht.c b/net/bridge/br_multicast_eht.c index f91c071d1608..c126aa4e7551 100644 --- a/net/bridge/br_multicast_eht.c +++ b/net/bridge/br_multicast_eht.c @@ -142,7 +142,7 @@ static void br_multicast_destroy_eht_set_entry(struct net_bridge_mcast_gc *gc) set_h = container_of(gc, struct net_bridge_group_eht_set_entry, mcast_gc); WARN_ON(!RB_EMPTY_NODE(&set_h->rb_node)); - del_timer_sync(&set_h->timer); + timer_shutdown_sync(&set_h->timer); kfree(set_h); } @@ -154,7 +154,7 @@ static void br_multicast_destroy_eht_set(struct net_bridge_mcast_gc *gc) WARN_ON(!RB_EMPTY_NODE(&eht_set->rb_node)); WARN_ON(!RB_EMPTY_ROOT(&eht_set->entry_tree)); - del_timer_sync(&eht_set->timer); + timer_shutdown_sync(&eht_set->timer); kfree(eht_set); } diff --git a/net/core/gen_estimator.c b/net/core/gen_estimator.c index 4fcbdd71c59f..fae9c4694186 100644 --- a/net/core/gen_estimator.c +++ b/net/core/gen_estimator.c @@ -208,7 +208,7 @@ void gen_kill_estimator(struct net_rate_estimator __rcu **rate_est) est = xchg((__force struct net_rate_estimator **)rate_est, NULL); if (est) { - del_timer_sync(&est->timer); + timer_shutdown_sync(&est->timer); kfree_rcu(est, rcu); } } diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 3c4786b99907..68edfd46781c 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -895,6 +895,8 @@ void neigh_destroy(struct neighbour *neigh) if (neigh_del_timer(neigh)) pr_warn("Impossible event\n"); + timer_shutdown(&neigh->timer); + write_lock_bh(&neigh->lock); __skb_queue_purge(&neigh->arp_queue); write_unlock_bh(&neigh->lock); diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c index 66fc940f9521..ee3942af9950 100644 --- a/net/ipv4/inet_timewait_sock.c +++ b/net/ipv4/inet_timewait_sock.c @@ -66,6 +66,7 @@ static void inet_twsk_kill(struct inet_timewait_sock *tw) void inet_twsk_free(struct inet_timewait_sock *tw) { struct module *owner = tw->tw_prot->owner; + timer_shutdown(&tw->tw_timer); twsk_destructor((struct sock *)tw); #ifdef SOCK_REFCNT_DEBUG pr_debug("%s timewait_sock %p released\n", tw->tw_prot->name, tw); diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index e04544ac4b45..dbaf4c33b155 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c @@ -412,7 +412,7 @@ static struct mr_table *ipmr_new_table(struct net *net, u32 id) static void ipmr_free_table(struct mr_table *mrt) { - del_timer_sync(&mrt->ipmr_expire_timer); + timer_shutdown_sync(&mrt->ipmr_expire_timer); mroute_clean_tables(mrt, MRT_FLUSH_VIFS | MRT_FLUSH_VIFS_STATIC | MRT_FLUSH_MFC | MRT_FLUSH_MFC_STATIC); rhltable_destroy(&mrt->mfc_hash); diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index facdc78a43e5..474b862039e0 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c @@ -392,7 +392,7 @@ static struct mr_table *ip6mr_new_table(struct net *net, u32 id) static void ip6mr_free_table(struct mr_table *mrt) { - del_timer_sync(&mrt->ipmr_expire_timer); + timer_shutdown_sync(&mrt->ipmr_expire_timer); mroute_clean_tables(mrt, MRT6_FLUSH_MIFS | MRT6_FLUSH_MIFS_STATIC | MRT6_FLUSH_MFC | MRT6_FLUSH_MFC_STATIC); rhltable_destroy(&mrt->mfc_hash); diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index acc1c299f1ae..ec72756075f5 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c @@ -512,7 +512,7 @@ static void mesh_path_free_rcu(struct mesh_table *tbl, mpath->flags |= MESH_PATH_RESOLVING | MESH_PATH_DELETED; mesh_gate_del(tbl, mpath); spin_unlock_bh(&mpath->state_lock); - del_timer_sync(&mpath->timer); + timer_shutdown_sync(&mpath->timer); atomic_dec(&sdata->u.mesh.mpaths); atomic_dec(&tbl->entries); mesh_path_flush_pending(mpath); diff --git a/net/netfilter/ipset/ip_set_list_set.c b/net/netfilter/ipset/ip_set_list_set.c index 5a67f7966574..e162636525cf 100644 --- a/net/netfilter/ipset/ip_set_list_set.c +++ b/net/netfilter/ipset/ip_set_list_set.c @@ -427,7 +427,7 @@ list_set_destroy(struct ip_set *set) struct set_elem *e, *n; if (SET_WITH_TIMEOUT(set)) - del_timer_sync(&map->gc); + timer_shutdown_sync(&map->gc); list_for_each_entry_safe(e, n, &map->members, list) { list_del(&e->list); diff --git a/net/netfilter/ipvs/ip_vs_lblc.c b/net/netfilter/ipvs/ip_vs_lblc.c index 7ac7473e3804..1b87214d385e 100644 --- a/net/netfilter/ipvs/ip_vs_lblc.c +++ b/net/netfilter/ipvs/ip_vs_lblc.c @@ -384,7 +384,7 @@ static void ip_vs_lblc_done_svc(struct ip_vs_service *svc) struct ip_vs_lblc_table *tbl = svc->sched_data; /* remove periodic timer */ - del_timer_sync(&tbl->periodic_timer); + timer_shutdown_sync(&tbl->periodic_timer); /* got to clean up table entries here */ ip_vs_lblc_flush(svc); diff --git a/net/netfilter/ipvs/ip_vs_lblcr.c b/net/netfilter/ipvs/ip_vs_lblcr.c index 77c323c36a88..ad8f5fea6d3a 100644 --- a/net/netfilter/ipvs/ip_vs_lblcr.c +++ b/net/netfilter/ipvs/ip_vs_lblcr.c @@ -547,7 +547,7 @@ static void ip_vs_lblcr_done_svc(struct ip_vs_service *svc) struct ip_vs_lblcr_table *tbl = svc->sched_data; /* remove periodic timer */ - del_timer_sync(&tbl->periodic_timer); + timer_shutdown_sync(&tbl->periodic_timer); /* got to clean up table entries here */ ip_vs_lblcr_flush(svc); diff --git a/net/netfilter/xt_LED.c b/net/netfilter/xt_LED.c index 0371c387b0d1..66b0f941d8fb 100644 --- a/net/netfilter/xt_LED.c +++ b/net/netfilter/xt_LED.c @@ -166,7 +166,7 @@ static void led_tg_destroy(const struct xt_tgdtor_param *par) list_del(&ledinternal->list); - del_timer_sync(&ledinternal->timer); + timer_shutdown_sync(&ledinternal->timer); led_trigger_unregister(&ledinternal->netfilter_led_trigger); diff --git a/net/rxrpc/conn_object.c b/net/rxrpc/conn_object.c index 22089e37e97f..307d6d480e78 100644 --- a/net/rxrpc/conn_object.c +++ b/net/rxrpc/conn_object.c @@ -358,7 +358,7 @@ static void rxrpc_destroy_connection(struct rcu_head *rcu) _net("DESTROY CONN %d", conn->debug_id); - del_timer_sync(&conn->timer); + timer_shutdown_sync(&conn->timer); rxrpc_purge_queue(&conn->rx_queue); conn->security->clear(conn); diff --git a/net/sched/cls_flow.c b/net/sched/cls_flow.c index 014cd3de7b5d..cd90a3083b9f 100644 --- a/net/sched/cls_flow.c +++ b/net/sched/cls_flow.c @@ -367,7 +367,7 @@ static const struct nla_policy flow_policy[TCA_FLOW_MAX + 1] = { static void __flow_destroy_filter(struct flow_filter *f) { - del_timer_sync(&f->perturb_timer); + timer_shutdown_sync(&f->perturb_timer); tcf_exts_destroy(&f->exts); tcf_em_tree_destroy(&f->ematches); tcf_exts_put_net(&f->exts); diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index 149171774bc6..42663e240ec5 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c @@ -567,7 +567,7 @@ svc_destroy(struct kref *ref) struct svc_serv *serv = container_of(ref, struct svc_serv, sv_refcnt); dprintk("svc: svc_destroy(%s)\n", serv->sv_program->pg_name); - del_timer_sync(&serv->sv_temptimer); + timer_shutdown_sync(&serv->sv_temptimer); /* * The last user is gone and thus all sockets have to be destroyed to diff --git a/net/tipc/discover.c b/net/tipc/discover.c index e8630707901e..d9efbee90fb4 100644 --- a/net/tipc/discover.c +++ b/net/tipc/discover.c @@ -385,7 +385,7 @@ int tipc_disc_create(struct net *net, struct tipc_bearer *b, */ void tipc_disc_delete(struct tipc_discoverer *d) { - del_timer_sync(&d->timer); + timer_shutdown_sync(&d->timer); kfree_skb(d->skb); kfree(d); } diff --git a/net/tipc/monitor.c b/net/tipc/monitor.c index 9618e4429f0f..77a3d016cade 100644 --- a/net/tipc/monitor.c +++ b/net/tipc/monitor.c @@ -700,7 +700,7 @@ void tipc_mon_delete(struct net *net, int bearer_id) } mon->self = NULL; write_unlock_bh(&mon->lock); - del_timer_sync(&mon->timer); + timer_shutdown_sync(&mon->timer); kfree(self->domain); kfree(self); kfree(mon); From patchwork Sat Nov 5 06:00: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: 15902 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp829350wru; Fri, 4 Nov 2022 23:03:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7LSVoi9ku8++qumDGvzMPbXTlOM1+1KDKzYpBRV5h4xeDbaresSsDZqay4mXwySrX6W0zz X-Received: by 2002:a17:90b:1097:b0:213:9716:20b3 with SMTP id gj23-20020a17090b109700b00213971620b3mr44600259pjb.72.1667628209177; Fri, 04 Nov 2022 23:03:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628209; cv=none; d=google.com; s=arc-20160816; b=xs4JVv81W26zuy2q8CnoZ0IOCTXfD/tmj5SP47mJLYiOl/kPREjmCA2+FJejvn4Rwb ank2aRqJRQ7xVw9PjVia4Ps+GLLfBbNiJQofgKt7s9XVhuBcjd0V1yZ2JGLQFfk3PGBY +IvWaVpdfMvwo7W6evKv/OPgzD7gTwSU+PBPCFpINHxf1s8Eo0jp0t5Vk+U7sAVJhqo1 sSSHQGpSV2C+tHVigUTQdzhBcByOaEXhn8DVLVlM7Eg3qQT/vpn5/riTe0DIdj9njUyC Bh07PLvKZ7T1r+gkcGZ2rVR3MXuR5qp9/OWKUk4VXQzjvKGfndHtT/mLq9x5PAzM9v1u x7EQ== 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=Dkw4U2WlPh4H2i2a740/OSbczXTg1iDLvsKqbj+v9OU=; b=tRkke58FanzC47m9wKZmdwFr+c1h2Mtt9WBaZNfr5Ynevfpovq+UQE6MSaA5gQd4SG X3fWXJyJgXmf+lY28I2eU40tGY6vq8Uq+roRTDt1r3aPlBL05Ne3mZdQqe+YjZADKf+E I4l7VVYrR6zRuQ6B8VukJ+eh5fSqG3+rRjXArN7v210xiQWcdu9XqEEOon6C/FjI/Sn/ 2ZEtfEGVWVyAAut24GiY1hQjw/KikAjStwIuRlKpxnU1ZW2QJV/R/QnNgGUFSzI6hWt5 FtHrY9kMvAsfFC2JInkyD1KYhVraQedlJo9ZmXkJGwc67gEJXUGpu4W2vrLbynIavLAx fHLA== 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 j65-20020a62c544000000b0056c37608f45si1327892pfg.348.2022.11.04.23.03.16; Fri, 04 Nov 2022 23:03:29 -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 S229809AbiKEGCP (ORCPT + 99 others); Sat, 5 Nov 2022 02:02:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229624AbiKEGBe (ORCPT ); Sat, 5 Nov 2022 02:01:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E819331207; Fri, 4 Nov 2022 23:01:31 -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 534AA60A67; Sat, 5 Nov 2022 06:01:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2978BC4347C; Sat, 5 Nov 2022 06:01:30 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFi-007Ooz-0y; Sat, 05 Nov 2022 02:01:58 -0400 Message-ID: <20221105060158.138331694@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:42 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Greg Kroah-Hartman , Felipe Balbi , Johan Hovold , Alan Stern , Mathias Nyman , Kai-Heng Feng , Matthias Kaehlcke , Michael Grzeschik , Bhuvanesh Surachari , Dan Carpenter , linux-usb@vger.kernel.org Subject: [PATCH v4a 18/38] timers: usb: Use timer_shutdown_sync() before freeing timer References: <20221105060024.598488967@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?1748634917267455176?= X-GMAIL-MSGID: =?utf-8?q?1748634917267455176?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ Cc: Greg Kroah-Hartman Cc: Felipe Balbi Cc: Johan Hovold Cc: Alan Stern Cc: Mathias Nyman Cc: Kai-Heng Feng Cc: Matthias Kaehlcke Cc: Michael Grzeschik Cc: Bhuvanesh Surachari Cc: Dan Carpenter Cc: linux-usb@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- drivers/usb/gadget/udc/m66592-udc.c | 2 +- drivers/usb/serial/garmin_gps.c | 2 +- drivers/usb/serial/mos7840.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/udc/m66592-udc.c b/drivers/usb/gadget/udc/m66592-udc.c index 931e6362a13d..c7e421b449f3 100644 --- a/drivers/usb/gadget/udc/m66592-udc.c +++ b/drivers/usb/gadget/udc/m66592-udc.c @@ -1519,7 +1519,7 @@ static int m66592_remove(struct platform_device *pdev) usb_del_gadget_udc(&m66592->gadget); - del_timer_sync(&m66592->timer); + timer_shutdown_sync(&m66592->timer); iounmap(m66592->reg); free_irq(platform_get_irq(pdev, 0), m66592); m66592_free_request(&m66592->ep[0].ep, m66592->ep0_req); diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c index f1a8d8343623..670e942fdaaa 100644 --- a/drivers/usb/serial/garmin_gps.c +++ b/drivers/usb/serial/garmin_gps.c @@ -1405,7 +1405,7 @@ static void garmin_port_remove(struct usb_serial_port *port) usb_kill_anchored_urbs(&garmin_data_p->write_urbs); usb_kill_urb(port->interrupt_in_urb); - del_timer_sync(&garmin_data_p->timer); + timer_shutdown_sync(&garmin_data_p->timer); kfree(garmin_data_p); } diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 6b12bb4648b8..8a2d902a1c12 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c @@ -1726,7 +1726,7 @@ static void mos7840_port_remove(struct usb_serial_port *port) mos7840_set_led_sync(port, MODEM_CONTROL_REGISTER, 0x0300); del_timer_sync(&mos7840_port->led_timer1); - del_timer_sync(&mos7840_port->led_timer2); + timer_shutdown_sync(&mos7840_port->led_timer2); usb_kill_urb(mos7840_port->led_urb); usb_free_urb(mos7840_port->led_urb); From patchwork Sat Nov 5 06:00:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15889 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp828998wru; Fri, 4 Nov 2022 23:02:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6BxYttaM8tDqYadYKDrusN3mAhlacl7E+8lsboMwtWUWJyxMK2dbAtz1tGiJ/XpN08DP0X X-Received: by 2002:a17:90b:24f:b0:216:7247:4b9a with SMTP id fz15-20020a17090b024f00b0021672474b9amr10151017pjb.163.1667628167950; Fri, 04 Nov 2022 23:02:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628167; cv=none; d=google.com; s=arc-20160816; b=k5xJugqmR1cLFi+RGFmGgI4SWTTLX8NBjRuwCeeo4Ae6aOgSGUmkS5Ig6N3mq4jOjY 2/KEzaHflgNVmEQt4TRWr/WTJalM8NovKe5ZtXbAmA5CKYQh0V91dnYnHT9jj6meQHJo TZMdblv9klLpcWBLiHehVR3nGsycd1cM8TxxbzdjMl+Agq0Ms9qaDHL07sAWAeo+SMO2 iTDYktDYs5rMtWHpOytcPJNNmPy1Du0tjIK5FaMVuWrPkm5Tzdcd6Ga4Pu4pSzk/umZY MbL7nmfW800VmaYhvfbBeQvEyEJzADH7SgICowpeQZs7bX/+2uNqFkCZLUaz3LpSc0VZ oDEg== 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=wVxBtLwKv86dTAGFz9Dw8ydg7lI1BQF1eFElfRyc6N4=; b=NwAfVscpgbGqnEdc7AvsbLBmCGK1BEu/KiNgOnCgid1pUxuij2HdmiJuSX62z+AJg6 l/9GY9/kMhoqk3d3COU3r1K4f4WvsqPZnmLFa7YgCtR0FPsR7Y4LV5M/m8whc9g2E8eE JZrxxFxGx6s/SWibrgn7ZR++2YnwMrnJeCyw6ZIa7eXTf1CqJfBeMhMIBkSALM/fRh+o a+RJH/EfMbKKxb8Ho9Hh7pBxLrqox8O7FWfsVEEw3sYjnoPVc0qp+MYrpZ+ea0UEDFCZ Tgb3Yf6eVRAgqS3Wo8o1tEmhMwWbpWrG2cBQBiozjXNN2p//UJQPTTrKDqXPB8jFOSek V77w== 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 a11-20020a170902ee8b00b001781f860a6dsi1777698pld.228.2022.11.04.23.02.34; Fri, 04 Nov 2022 23:02:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229779AbiKEGBv (ORCPT + 99 others); Sat, 5 Nov 2022 02:01:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229615AbiKEGBe (ORCPT ); Sat, 5 Nov 2022 02:01:34 -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 DE2FC30F7A; Fri, 4 Nov 2022 23:01:31 -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 6CD3660A55; Sat, 5 Nov 2022 06:01:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47C30C43143; Sat, 5 Nov 2022 06:01:30 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFi-007OpY-1Y; Sat, 05 Nov 2022 02:01:58 -0400 Message-ID: <20221105060158.322031906@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:43 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Krzysztof Kozlowski , "David S. Miller" , Dan Carpenter , Chengfeng Ye , Lin Ma , Duoming Zhou , netdev@vger.kernel.org Subject: [PATCH v4a 19/38] timers: nfc: pn533: Use timer_shutdown_sync() before freeing timer References: <20221105060024.598488967@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?1748634873658952687?= X-GMAIL-MSGID: =?utf-8?q?1748634873658952687?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ 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) Reviewed-by: Krzysztof Kozlowski --- drivers/nfc/pn533/pn533.c | 2 +- drivers/nfc/pn533/uart.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nfc/pn533/pn533.c b/drivers/nfc/pn533/pn533.c index d9f6367b9993..0a1d0b4e3bb8 100644 --- a/drivers/nfc/pn533/pn533.c +++ b/drivers/nfc/pn533/pn533.c @@ -2788,7 +2788,7 @@ void pn53x_common_clean(struct pn533 *priv) struct pn533_cmd *cmd, *n; /* delete the timer before cleanup the worker */ - del_timer_sync(&priv->listen_timer); + timer_shutdown_sync(&priv->listen_timer); flush_delayed_work(&priv->poll_work); destroy_workqueue(priv->wq); diff --git a/drivers/nfc/pn533/uart.c b/drivers/nfc/pn533/uart.c index 07596bf5f7d6..a556acdb947b 100644 --- a/drivers/nfc/pn533/uart.c +++ b/drivers/nfc/pn533/uart.c @@ -310,7 +310,7 @@ static void pn532_uart_remove(struct serdev_device *serdev) pn53x_unregister_nfc(pn532->priv); serdev_device_close(serdev); pn53x_common_clean(pn532->priv); - del_timer_sync(&pn532->cmd_timeout); + timer_shutdown_sync(&pn532->cmd_timeout); kfree_skb(pn532->recv_skb); kfree(pn532); } From patchwork Sat Nov 5 06:00: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: 15899 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp829318wru; Fri, 4 Nov 2022 23:03:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7hSSpjRy/kOOK4X287Z0j+FyrR78Bg/ZWngGykJKQlp6s7LUldMkaImjKEAQ3uC1I0j7VV X-Received: by 2002:a05:6a00:1889:b0:56c:3d4f:ae14 with SMTP id x9-20020a056a00188900b0056c3d4fae14mr38854815pfh.49.1667628204733; Fri, 04 Nov 2022 23:03:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628204; cv=none; d=google.com; s=arc-20160816; b=eLaj2wYK4ors9mhZ2cGKKVQOri80okhnhNJvKFoKyjMo3nuvTErvGe+o43BH+dGVsM ETDkGjn/r1w4TVr9kidi48c3t1KnC6C4RFJ86KTqs/8AF3qo17mjumN9Bw3C8VlTWQYx iNqAX0TreJZ/DDB5juSkWj4FxoR2RbzagmkCr1b8VMkWl3Zi1WBmmW64gUUNRA+ml6IY QvLcW1c26qSZYb4KUmR15u5vtfF5wt6xY7kpY+UW8QpuS01gCKUwqKGKbtHPH69Z7jOZ N8qDo8J12NPA2MZLj/dS+MxXvVRve5nDFcZung+v23IjOSqcXNyox7H1bu7eI0pS1n0f wJ+Q== 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=X/WBQT8M6H7fQ5ihdLeQjDaM7jxxGc7l0AlGUkSuRJk=; b=0sjF3eeGs3u2X+Fhf9uQEBy8kEnZr5dwCLetXvUh0jcERCdkamLKN2gtmxriygbgLh d4Uwo1bFlJHM8H1ruI9BJOur9IxN7uMOQUKU/KtjOJFoTQkNl5EKXWY/hvphRtiT/hVU 8mv3Y99S4OTFDqIJZoyLhTMxGK3nbf3SfMNA0RQtVdCi62dyO5yuiGvf2HSzdGCyT6qL Oy9z+TU5KwF2K2//QXOBkTvxl7/Z7tAZXq7YhjgcLj/hkGPDdA0RXaPADcEuTOWYChPE QeTuwaKv2HCe+kyySxsA+PJN+IqjhQayFvNC4OONi0VAo4Bf8GQ6RdWoDxsMbt5133FT bruQ== 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 d2-20020a056a00244200b0056bf15d0cbfsi1980686pfj.308.2022.11.04.23.03.11; Fri, 04 Nov 2022 23:03:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229880AbiKEGC3 (ORCPT + 99 others); Sat, 5 Nov 2022 02:02:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229617AbiKEGBe (ORCPT ); Sat, 5 Nov 2022 02:01:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE43030F7B for ; Fri, 4 Nov 2022 23:01:31 -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 9B13B609D0 for ; Sat, 5 Nov 2022 06:01:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74201C433D6; Sat, 5 Nov 2022 06:01:30 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFi-007Oq7-29; Sat, 05 Nov 2022 02:01:58 -0400 Message-ID: <20221105060158.502395021@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:44 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Minghao Chi , Tony Lindgren , Arnd Bergmann , Cai Huoqing , "Paul E. McKenney" , Dominik Brodowski Subject: [PATCH v4a 20/38] timers: pcmcia: Use timer_shutdown_sync() before freeing timer References: <20221105060024.598488967@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?1748634912572542165?= X-GMAIL-MSGID: =?utf-8?q?1748634912572542165?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ Cc: Minghao Chi Cc: Tony Lindgren Cc: Arnd Bergmann Cc: "Souptick Joarder Cc: Cai Huoqing Cc: "Paul E. McKenney" Acked-by: Dominik Brodowski Signed-off-by: Steven Rostedt (Google) --- drivers/pcmcia/bcm63xx_pcmcia.c | 2 +- drivers/pcmcia/electra_cf.c | 2 +- drivers/pcmcia/omap_cf.c | 2 +- drivers/pcmcia/pd6729.c | 4 ++-- drivers/pcmcia/yenta_socket.c | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/pcmcia/bcm63xx_pcmcia.c b/drivers/pcmcia/bcm63xx_pcmcia.c index bb06311d0b5f..dd3c26099048 100644 --- a/drivers/pcmcia/bcm63xx_pcmcia.c +++ b/drivers/pcmcia/bcm63xx_pcmcia.c @@ -443,7 +443,7 @@ static int bcm63xx_drv_pcmcia_remove(struct platform_device *pdev) struct resource *res; skt = platform_get_drvdata(pdev); - del_timer_sync(&skt->timer); + timer_shutdown_sync(&skt->timer); iounmap(skt->base); iounmap(skt->io_base); res = skt->reg_res; diff --git a/drivers/pcmcia/electra_cf.c b/drivers/pcmcia/electra_cf.c index 40a5cffe24a4..efc27bc15152 100644 --- a/drivers/pcmcia/electra_cf.c +++ b/drivers/pcmcia/electra_cf.c @@ -317,7 +317,7 @@ static int electra_cf_remove(struct platform_device *ofdev) cf->active = 0; pcmcia_unregister_socket(&cf->socket); free_irq(cf->irq, cf); - del_timer_sync(&cf->timer); + timer_shutdown_sync(&cf->timer); iounmap(cf->io_virt); iounmap(cf->mem_base); diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c index d3f827d4224a..e613818dc0bc 100644 --- a/drivers/pcmcia/omap_cf.c +++ b/drivers/pcmcia/omap_cf.c @@ -296,7 +296,7 @@ static int __exit omap_cf_remove(struct platform_device *pdev) cf->active = 0; pcmcia_unregister_socket(&cf->socket); - del_timer_sync(&cf->timer); + timer_shutdown_sync(&cf->timer); release_mem_region(cf->phys_cf, SZ_8K); free_irq(cf->irq, cf); kfree(cf); diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c index f0af9985ca09..a0a2e7f18356 100644 --- a/drivers/pcmcia/pd6729.c +++ b/drivers/pcmcia/pd6729.c @@ -727,7 +727,7 @@ static int pd6729_pci_probe(struct pci_dev *dev, if (irq_mode == 1) free_irq(dev->irq, socket); else - del_timer_sync(&socket->poll_timer); + timer_shutdown_sync(&socket->poll_timer); err_out_free_res: pci_release_regions(dev); err_out_disable: @@ -754,7 +754,7 @@ static void pd6729_pci_remove(struct pci_dev *dev) if (irq_mode == 1) free_irq(dev->irq, socket); else - del_timer_sync(&socket->poll_timer); + timer_shutdown_sync(&socket->poll_timer); pci_release_regions(dev); pci_disable_device(dev); diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index 3966a6ceb1ac..1365eaa20ff4 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c @@ -814,7 +814,7 @@ static void yenta_close(struct pci_dev *dev) if (sock->cb_irq) free_irq(sock->cb_irq, sock); else - del_timer_sync(&sock->poll_timer); + timer_shutdown_sync(&sock->poll_timer); iounmap(sock->base); yenta_free_resources(sock); @@ -1285,7 +1285,7 @@ static int yenta_probe(struct pci_dev *dev, const struct pci_device_id *id) if (socket->cb_irq) free_irq(socket->cb_irq, socket); else - del_timer_sync(&socket->poll_timer); + timer_shutdown_sync(&socket->poll_timer); unmap: iounmap(socket->base); yenta_free_resources(socket); From patchwork Sat Nov 5 06:00: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: 15900 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp829343wru; Fri, 4 Nov 2022 23:03:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4le2AQ4TJnvecpxUAVHrnX4qde2GZ4+qzfvq1KrBFCZonyzyWk6UXH91SQEjeUPosziOAT X-Received: by 2002:a17:90b:128a:b0:213:26c2:2c06 with SMTP id fw10-20020a17090b128a00b0021326c22c06mr56136958pjb.26.1667628208313; Fri, 04 Nov 2022 23:03:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628208; cv=none; d=google.com; s=arc-20160816; b=vtQzE/Hf4BWQqL8HmiBnCH7jDvy4J/1qQCVhvRHVpHyUrorLuOFXn401xY3vtDzbfY NSgCfVdVpsygohyGzCgGMRhqJDCYjYTljMzYLUwg1UkGx/17GVQztlF6X42Fb9lBbXJ3 2HuzpqfVB/y2jLO40dLjw7fUtL/qFdcGIaeT3SaGSiF4cd/tGdrVQYxDVJsagw5Pk1wP 908Y74iS9pVTvNDiMYJKm45sMRoonuJ/l87Yl/ha+MiiEV+xYx8FA8As/xPhHgy1yFwR dp+kaEl/bHmFEarRPLexojxh77SIJrIk/vvgyCZtbSaLtLQAMgKTEUaPtgiTzdRwodzf dSyA== 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=au/n49Q8tQrqMo441qcmAIzJYGvrLwmLpcOThtIFNYI=; b=j/ofKrOIPRQHnd4lk4ZoD9mWU5NGlLnW//pCQD4lPqqbvwl5D9pjPt2SdYixRe/pT+ k+HndXKGTy/g+O4tW8fE/TwEHZGNHodeK9WrcHgPOeGeNd0i9qovlxuP+7KG9Ph/AuZv 4p4I7gaGb062//966jXA5TyIut5X7dPHl9EpX/E7400GhQDVZLVowbcb+ONRTB+R7Gom S+LF7e/YSxXDkU1p+EmH4lq+KMSast/DkV3rtLFlVz6CKKSPTd2rToz/pSjSSPRfywGc 51KQoWl/ZcTjH+C0QfPPHUgTbgmljxrTkh0w27edkDR67P0enoxWS9ufo6C7wrz42JDU SYTA== 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 f2-20020a63de02000000b0046271a622cfsi2159378pgg.550.2022.11.04.23.03.15; Fri, 04 Nov 2022 23:03: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 S229883AbiKEGCc (ORCPT + 99 others); Sat, 5 Nov 2022 02:02:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229608AbiKEGBe (ORCPT ); Sat, 5 Nov 2022 02:01:34 -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 B416A2D1F7; Fri, 4 Nov 2022 23:01:31 -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 C756160A48; Sat, 5 Nov 2022 06:01:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A268CC43141; Sat, 5 Nov 2022 06:01:30 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFi-007Oqg-2k; Sat, 05 Nov 2022 02:01:58 -0400 Message-ID: <20221105060158.686330249@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:45 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Nilesh Javali , GR-QLogic-Storage-Upstream@marvell.com, "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org Subject: [PATCH v4a 21/38] timers: scsi: Use timer_shutdown_sync() and timer_shutdown() before freeing timer References: <20221105060024.598488967@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?1748634916313976896?= X-GMAIL-MSGID: =?utf-8?q?1748634916313976896?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called, or timer_shutdown() if it's already known that the timer is disabled. Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ 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..7f3a3c8673b5 100644 --- a/drivers/scsi/qla2xxx/qla_edif.c +++ b/drivers/scsi/qla2xxx/qla_edif.c @@ -416,7 +416,7 @@ static void __qla2x00_release_all_sadb(struct scsi_qla_host *vha, */ if (edif_entry->delete_sa_index != INVALID_EDIF_SA_INDEX) { - del_timer(&edif_entry->timer); + timer_shutdown_sync(&edif_entry->timer); /* build and send the aen */ fcport->edif.rx_sa_set = 1; @@ -2799,7 +2799,7 @@ qla28xx_sa_update_iocb_entry(scsi_qla_host_t *v, struct req_que *req, "%s: removing edif_entry %p, new sa_index: 0x%x\n", __func__, edif_entry, pkt->sa_index); qla_edif_list_delete_sa_index(sp->fcport, edif_entry); - del_timer(&edif_entry->timer); + timer_shutdown_sync(&edif_entry->timer); ql_dbg(ql_dbg_edif, vha, 0x5033, "%s: releasing edif_entry %p, new sa_index: 0x%x\n", From patchwork Sat Nov 5 06:00: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: 15897 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp829300wru; Fri, 4 Nov 2022 23:03:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5j90h8gZkIhdWciYDKFQXw45hQM0p1uRJ/LPijBmkZWYONvZneH4U+S1fVKeQiv4uGJxIM X-Received: by 2002:a17:902:e801:b0:187:3a52:d24f with SMTP id u1-20020a170902e80100b001873a52d24fmr22348771plg.127.1667628201807; Fri, 04 Nov 2022 23:03:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628201; cv=none; d=google.com; s=arc-20160816; b=D1nH69p9tVk8swXQrkT25cwNgYbB93VbtsUA3dqIkMlz1b5tY0l9lL7DT6T9R0YC/m xVs50rIiMoUHzBQyvXMnz+j/4vHWyamT1H/vs6J56owsvf/eYl19jSKHaTs963dRriNr jz2LG0Rbzr6FNAVS2a1j9h5EKIVphOJCxLGwApJhTZlmCrC7NUOixa1d4mRe60bkrUuR hRNBPZ4g7KRmgRkomXeECTqOuloGvKv2qURMdaV6nzYYXNeQxRw7w+Pc95+GF37mo54Q zRrHiNUdFGiPb+gDbvgd7SftrYfo8LY0iXwq3Y++hUi5ERQIGu0wIQuEyJMm6hhD3mKH IPqg== 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=pTpzDqYxacP8Wvh//SjtjgikmkifjC22iZtfg2dOxQI=; b=idKBMtyH9cMNBH7ltkcGkgxgiBkWdsDWfI7jMaslk1sPaatn2IyZTCoq4BrqJ2HTV5 v+NQ5ia4APD9boQexnmTdTggt18mwqSbaL0cSGivg4JoxRL/M+D7a3BaFRmLWbdxJt4G amDAN6Fj0+k6aY99VRWJt7KfwsQJJN/flVwd6MmpHu307ETZlEQB9VXfZwLF1GV2b67w 4LJ58+h2zPTFMdqyVX2TT+9qr67O9nEAZsrK7eowbdkogzz1wNnra1IlElMFQcWyK38e ejx3uhWTlLliP8hiYbn7GrqKsDMsmYSUFe5vzJgpqT1oFyB2BFT4iZTHBqMZarY5ZEau wZ9g== 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 5-20020a630805000000b0046f3dfb9789si2202661pgi.477.2022.11.04.23.03.09; Fri, 04 Nov 2022 23:03:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229871AbiKEGCZ (ORCPT + 99 others); Sat, 5 Nov 2022 02:02:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229610AbiKEGBe (ORCPT ); Sat, 5 Nov 2022 02:01:34 -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 B454E2D764 for ; Fri, 4 Nov 2022 23:01:31 -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 00A0960A7C for ; Sat, 5 Nov 2022 06:01:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF630C433D6; Sat, 5 Nov 2022 06:01:30 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFj-007OrF-07; Sat, 05 Nov 2022 02:01:59 -0400 Message-ID: <20221105060158.872068667@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:46 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Greg Kroah-Hartman , Jiri Slaby Subject: [PATCH v4a 22/38] timers: tty: Use timer_shutdown_sync() before freeing timer References: <20221105060024.598488967@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?1748634909479949754?= X-GMAIL-MSGID: =?utf-8?q?1748634909479949754?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ Cc: Greg Kroah-Hartman Cc: Jiri Slaby Signed-off-by: Steven Rostedt (Google) --- drivers/tty/n_gsm.c | 2 +- drivers/tty/sysrq.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 5e516f5cac5a..6f48adecd1d4 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -2098,7 +2098,7 @@ static void gsm_dlci_free(struct tty_port *port) { struct gsm_dlci *dlci = container_of(port, struct gsm_dlci, port); - del_timer_sync(&dlci->t1); + timer_shutdown_sync(&dlci->t1); dlci->gsm->dlci[dlci->addr] = NULL; kfifo_free(&dlci->fifo); while ((dlci->skb = skb_dequeue(&dlci->skb_list))) diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c index d2b2720db6ca..b6e70c5cfa17 100644 --- a/drivers/tty/sysrq.c +++ b/drivers/tty/sysrq.c @@ -1003,7 +1003,7 @@ static void sysrq_disconnect(struct input_handle *handle) input_close_device(handle); cancel_work_sync(&sysrq->reinject_work); - del_timer_sync(&sysrq->keyreset_timer); + timer_shutdown_sync(&sysrq->keyreset_timer); input_unregister_handle(handle); kfree(sysrq); } From patchwork Sat Nov 5 06:00: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: 15898 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp829315wru; Fri, 4 Nov 2022 23:03:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4fLB8zzj1dMsvssS5uQQjZO3iN8pS0FqCLzZYXKs8tsMgaCdrpjfwwverPJj9TjCjrle0O X-Received: by 2002:a05:6a02:192:b0:43c:a0cb:44d3 with SMTP id bj18-20020a056a02019200b0043ca0cb44d3mr34639389pgb.139.1667628204540; Fri, 04 Nov 2022 23:03:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628204; cv=none; d=google.com; s=arc-20160816; b=HUwfUcxELO+tUnS2jqbqDX1G6fbTvyG25NsFrMDqdjQz7ve5zNrPjujy9e5oPbpGsL A77jhjvs4ot6L1hUKzV4I79bvMUBk6x84qGfJBEBZLYWGEoVp7zOlxaA5vNbPqoJgk32 fO/Yn2gs0J57LKbYbE70+YrFA34+8oMUQOsGtLwoqY/2Y6SAs99dGG4qKHjDqPMV6NSR 8uHGMfr8l+COo0Q+CdbvA0FaDMIH+h/9wE9gCcmsDVNkr7EGKeJZ5Js0bXfinOvL2KvG ApZUrKbQs9djuHJrAEcYBzisqBvovkgqMBkjkucJUUnK2TQ9YrdutDmQomH1UDPra4+A nBdA== 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=UtwdN/2ce11CHhCdK/ZVgvt5gRvffYj5ZcYkrq4yEwQ=; b=bOFxK5uvb3NJZ5CoGmj1+9grHXajmQAuOPS721/jFAzH4qjUU+PNBD8zwi0hp/nOqx yYf2eqKtPLbQJ2yed/7kX+eU29XoqUSRVBA9jLP6nLAb/9odzWBMnEUNPDCk99KZLGtE o3D5QoWHakE4zlc9EA8/vN/DrXt6qSWWcKxrEmuyxIcWcG6n+ep/NXz6g10nLfrg61tN X+0OPdXnFkiPC9wb9ImKnJ98+KSIomvnhWsTjSIJzZS9jBUI+1Z+GtUW2T1sIjtrB7bE tczWUKLGCOfwkR5Jb+kgAyr9Q29tQ1CIVdf8ut5pIi8XmqaGjeTq2Tf0QNrLrHB5OmWO nl6Q== 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 ds3-20020a056a004ac300b00557e3e7c420si1575616pfb.213.2022.11.04.23.03.11; Fri, 04 Nov 2022 23:03:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229818AbiKEGCS (ORCPT + 99 others); Sat, 5 Nov 2022 02:02:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229626AbiKEGBe (ORCPT ); Sat, 5 Nov 2022 02:01:34 -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 125E73121D; Fri, 4 Nov 2022 23:01:32 -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 2D40F609EB; Sat, 5 Nov 2022 06:01:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08763C433D7; Sat, 5 Nov 2022 06:01:31 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFj-007Orn-0j; Sat, 05 Nov 2022 02:01:59 -0400 Message-ID: <20221105060159.054190416@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:47 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , linux-ext4@vger.kernel.org Subject: [PATCH v4a 23/38] timers: ext4: Use timer_shutdown_sync() before freeing timer References: <20221105060024.598488967@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?1748634911721838620?= X-GMAIL-MSGID: =?utf-8?q?1748634911721838620?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ Cc :"Theodore Ts'o" Cc :Andreas Dilger Cc: linux-ext4@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- fs/ext4/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 7950904fbf04..f54ed936d800 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -1225,7 +1225,7 @@ static void ext4_put_super(struct super_block *sb) } ext4_es_unregister_shrinker(sbi); - del_timer_sync(&sbi->s_err_report); + timer_shutdown_sync(&sbi->s_err_report); ext4_release_system_zone(sb); ext4_mb_release(sb); ext4_ext_release(sb); From patchwork Sat Nov 5 06:00: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: 15913 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp830266wru; Fri, 4 Nov 2022 23:05:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Ukta/gDIggGaEj5SVSdEj2kFpTrY6z1G6bQJ6rKVFelA5YT7qgySipyGMPnZuaoHWVbT/ X-Received: by 2002:a17:903:185:b0:187:25bf:dbe with SMTP id z5-20020a170903018500b0018725bf0dbemr29030824plg.74.1667628351617; Fri, 04 Nov 2022 23:05:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628351; cv=none; d=google.com; s=arc-20160816; b=AijBHOrXd8AJm56rqznCP/QPDNCQgPTZTJ76rXjQ3osURC8kuo8HBJ4vTXFfZxfr+z 4X1e9Y3aOEi5PwBZKAnAAsM7t1fx9ZSzTKm9COImIrodg/PQM2UWiTElQ2XM7ZHkerne bVvL+MUuU6V0rPH81KtnYS6+y8W4IZ4Aa53YG4NdH/lD6OrHyV8VjpjXU8tUDsEAtUFo 19HIrzeIaO7PqWsxu8QOqTjK+5fVOJgPF8xneL5BCWar5Lpo7T7h22kpsD7n8di90nCA QWeOaiQlUOIWWNk+t6Q06rqxDsHi/WMtnj8m33hdDuQbzrNd9k6GHHOuMe//R1PPy/B/ iIBA== 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=rKRgabPUzdzxcP7UOtF7v7tqjQQ/rJ9+O64CMZEKYtU=; b=ixBW3WDYX+/1PIGqLXTC7QWHvHTem+3ezcADv/bzjtSGb7yxo7s5gWXWzVDE2NTNOh 1RGzksX1hjn6mqwdLCmHvHEnT/Rce7XTUZQFV7/MVmjh/KKz0F6hGfLW36FacfrShjy+ /FMUe6AV7V/VvBkccm0X9yGcQqh3QYYJ4A85GHQcBXEIfV49qR0+ROlrq2RjLb1kF5P7 RygY6Ey+OunouURTJ/2j8U/ewLEjD5ZUeuI/bxkzvUr2A5N/7SdLZph6svgi/nTFKFeU q8lxejLPoyDIK4EOodvYjyO5eBtdOv6jqr7+hjEc9QGAibs5/0ASmSiaIeJTcgGWNfQo HGiw== 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 mg16-20020a17090b371000b0020af39f326fsi5047501pjb.133.2022.11.04.23.05.39; Fri, 04 Nov 2022 23:05: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 S229870AbiKEGDV (ORCPT + 99 others); Sat, 5 Nov 2022 02:03:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229557AbiKEGBf (ORCPT ); Sat, 5 Nov 2022 02:01:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D455531340; Fri, 4 Nov 2022 23:01:33 -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 871CFB830BB; Sat, 5 Nov 2022 06:01:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40710C433D6; Sat, 5 Nov 2022 06:01:31 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFj-007OsN-1L; Sat, 05 Nov 2022 02:01:59 -0400 Message-ID: <20221105060159.247328506@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:48 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , linux-nilfs@vger.kernel.org, Ryusuke Konishi Subject: [PATCH v4a 24/38] timers: fs/nilfs2: Use timer_shutdown_sync() before freeing timer References: <20221105060024.598488967@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?1748635066612506435?= X-GMAIL-MSGID: =?utf-8?q?1748635066612506435?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ Cc: linux-nilfs@vger.kernel.org Acked-by: Ryusuke Konishi Signed-off-by: Steven Rostedt (Google) --- fs/nilfs2/segment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index b4cebad21b48..c50dc377da26 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c @@ -2752,7 +2752,7 @@ static void nilfs_segctor_destroy(struct nilfs_sc_info *sci) down_write(&nilfs->ns_segctor_sem); - del_timer_sync(&sci->sc_timer); + timer_shutdown_sync(&sci->sc_timer); kfree(sci); } From patchwork Sat Nov 5 06:00: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: 15895 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp829266wru; Fri, 4 Nov 2022 23:03:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM519RM84FdySWVaFMarIf0CCEHKIcz4FxEPk6xdepY9gnn+os6CMZCUsX9YcNZ7rs8Cm587 X-Received: by 2002:a17:902:d1d3:b0:187:3d23:3490 with SMTP id g19-20020a170902d1d300b001873d233490mr21008064plb.149.1667628198248; Fri, 04 Nov 2022 23:03:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628198; cv=none; d=google.com; s=arc-20160816; b=yHoyCvQDEm/XOqhjpNkvHD+9QEev0XTVMTCP5IWYllMFxUnG0Xx1x9Xit4XLStKb0N nTfkROxRJXVAygqfL+tYfL0RpZoVV6xT4WN5V8f9OwrU7A0eXDBzpDzzyPsLizSAyWgv OiatU0w8UcZzd+LWlbvP/VITZGoN5K8z1ltoZ7Zb6LiFprWUPIH3+UoI2AwTQjqYLkIM cy8W64DaNhhd60+A50bl3SPqgheJYJF3FO1OO9blWj4uZg18piFt8sDddpx6Y9ZXFmCp 00DgAv5dtBtxwANcr9dMMHmvHry2P5baf+fFNTduurvbkj2Dip6wGkhDkP49KdITmu/D kimg== 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=Axm+5dzR0kf7WsruM1SV3u2EM8oQp0lKkRwYE8wIbvs=; b=zTn3jh9aqs/RBqFCnV7ckkfkp3S6OF91un+pKUoo7TyJNo3MTdC/LE7zvogxuyZ3/+ C6ayjKhCGYN6g5d206/vp83M2lU5ICjSWhufxGIg5ifwxLlA7FXyWdwm/pPzzmwdCkUM xXeaGp7i7XiKSKqZs/+Ly/Zf2FxAp6EMK/x5TEyQthqVWAOoS5ed5F923IUhFCMS7I/H WJj3bSl5mr9dZ9FbeeyZs7dzb5I5TY5QctQN1wGY6QBnnavDZyCTAW/Di8gkRFMa06cr OPal+B3tTLWn1v3a4db0Fqak/HBBshAXWIDWE9W5JXgwIUGzfJwQ1/amQsnaIJvIDxXF WG1Q== 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 w6-20020a17090a8a0600b0021406fde039si1675324pjn.156.2022.11.04.23.03.05; Fri, 04 Nov 2022 23:03:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229830AbiKEGCV (ORCPT + 99 others); Sat, 5 Nov 2022 02:02:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229632AbiKEGBe (ORCPT ); Sat, 5 Nov 2022 02:01:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 252CD3121F for ; Fri, 4 Nov 2022 23:01:32 -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 0636760A2C for ; Sat, 5 Nov 2022 06:01:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72D65C43470; Sat, 5 Nov 2022 06:01:31 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFj-007Osw-1v; Sat, 05 Nov 2022 02:01:59 -0400 Message-ID: <20221105060159.433729602@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:49 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Jaroslav Kysela , Austin Kim , alsa-devel@alsa-project.org, Takashi Iwai Subject: [PATCH v4a 25/38] timers: ALSA: Use timer_shutdown_sync() before freeing timer References: <20221105060024.598488967@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?1748634905256798028?= X-GMAIL-MSGID: =?utf-8?q?1748634905256798028?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ Cc: Jaroslav Kysela Cc: Austin Kim Cc: alsa-devel@alsa-project.org Reviewed-by: Takashi Iwai Signed-off-by: Steven Rostedt (Google) --- sound/i2c/other/ak4117.c | 2 +- sound/synth/emux/emux.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/i2c/other/ak4117.c b/sound/i2c/other/ak4117.c index 1bc43e927d82..640501bb3ca6 100644 --- a/sound/i2c/other/ak4117.c +++ b/sound/i2c/other/ak4117.c @@ -47,7 +47,7 @@ static void reg_dump(struct ak4117 *ak4117) static void snd_ak4117_free(struct ak4117 *chip) { - del_timer_sync(&chip->timer); + timer_shutdown_sync(&chip->timer); kfree(chip); } diff --git a/sound/synth/emux/emux.c b/sound/synth/emux/emux.c index a870759d179e..0006c3ddb51d 100644 --- a/sound/synth/emux/emux.c +++ b/sound/synth/emux/emux.c @@ -129,7 +129,7 @@ int snd_emux_free(struct snd_emux *emu) if (! emu) return -EINVAL; - del_timer_sync(&emu->tlist); + timer_shutdown_sync(&emu->tlist); snd_emux_proc_free(emu); snd_emux_delete_virmidi(emu); From patchwork Sat Nov 5 06:00: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: 15890 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp829016wru; Fri, 4 Nov 2022 23:02:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5zwZmjkKf+JILtckrB4WzKz3FBVpBon1BdhwA8rRMHhnPDP06jsVOfxnnhjFA9SB5UZMxK X-Received: by 2002:a17:902:be13:b0:188:5c4d:589d with SMTP id r19-20020a170902be1300b001885c4d589dmr10475290pls.114.1667628169724; Fri, 04 Nov 2022 23:02:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628169; cv=none; d=google.com; s=arc-20160816; b=HooMNOZw/QUZ8kMnZKJ1kYxV10FyD2JqtSsNGhhmVM+GvrhqtSWsSXMHfpXDUIzI4E A/d7u/G/HBw4SM3Qiw7XCpkUwjTQ35QtTzlFQDeAKjVoyGVAP7ik+9OyelnCMCwPGpWI 9RrH1mpM+5adac1q3fFBegd8DJmzLlSB2seJs124tQUUCGjLgPYGLTeNszgKpGF+Zvoq AwbetynJqrIlFpKDxFTNpWCQxjrfywZJTGxcImW+23L7PvBQ9gJZfCujavHRAj8yuI6F 3xWylozJAjkXKrMUZswbGJ1DmB/7rw/nBLP5ES/wGEmO3TaQTZLXgumn2MfeQi/1GWJo CeJA== 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=SU7+7a/wIwLKABvOHsgNpsUn/a9DDqd/g8Af6t4M+90=; b=pd5o2Z5wmwvb6+8yxa9al71/lNJ4MjnpIJrZzttYujlWeKFqH2IeVdMw8/TwsT1NQr Lat08emkDy4MrcSl06t8cMrVWpAlbGATmimJrWEZf+xg5kSsg7AGUqG8SC/1sSEgmFbU ltRSg2UbeHmiuHL6jDriRGqYevRrEwnEhkw/6mmP3VDfWUi0rxeqkuz8jWEJApHzaJxx xvw/UJTmmYlqN91trQQq7m0dyai/kCb7pIGxnqiWhFiQF0RIznnNiU18/cf7ZAchsuWE Kg1ICh/w8frqGrR/1wlDM4bUXRF1COtUwYMJQGHObnz7GCp0JPA9XwXSphe3K/dtBqWh NH1A== 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 ji22-20020a170903325600b00174418919a6si1699116plb.513.2022.11.04.23.02.36; Fri, 04 Nov 2022 23:02:49 -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 S229489AbiKEGB4 (ORCPT + 99 others); Sat, 5 Nov 2022 02:01:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229663AbiKEGBf (ORCPT ); Sat, 5 Nov 2022 02:01:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CB463055C; Fri, 4 Nov 2022 23:01:33 -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 DCD35B830C2; Sat, 5 Nov 2022 06:01:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91D10C433D7; Sat, 5 Nov 2022 06:01:31 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFj-007OtV-2V; Sat, 05 Nov 2022 02:01:59 -0400 Message-ID: <20221105060159.614390819@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:50 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , "Theodore Tso" , Jan Kara , linux-ext4@vger.kernel.org Subject: [PATCH v4a 26/38] timers: jbd2: Use timer_shutdown() before freeing timer References: <20221105060024.598488967@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?1748634875298987302?= X-GMAIL-MSGID: =?utf-8?q?1748634875298987302?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown() must be called. Note that it is assumed that the timer is not running while being freed, so only timer_shutdown() is used, and not timer_shutdown_sync(). Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ Cc: "Theodore Ts'o" Cc: Jan Kara Cc: linux-ext4@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- fs/jbd2/journal.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 2696f43e7239..57d2445d8c8b 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -2157,6 +2157,8 @@ int jbd2_journal_destroy(journal_t *journal) J_ASSERT(journal->j_checkpoint_transactions == NULL); spin_unlock(&journal->j_list_lock); + timer_shutdown(&journal->j_commit_timer); + /* * OK, all checkpoint transactions have been checked, now check the * write out io error flag and abort the journal if some buffer failed From patchwork Sat Nov 5 06:00: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: 15915 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp830506wru; Fri, 4 Nov 2022 23:06:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5dry6402AAvxFfZyr4OyLPb2UUQuYgnMNUdEXGEItFaY08YI/JB/eoNlp1ph4OM0jXKJL5 X-Received: by 2002:a63:3182:0:b0:46f:ed32:54a6 with SMTP id x124-20020a633182000000b0046fed3254a6mr19006345pgx.69.1667628404389; Fri, 04 Nov 2022 23:06:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628404; cv=none; d=google.com; s=arc-20160816; b=HXOk+cbdjkmHh6+5ZomF9YbzeITd8HXR1lY/toQ4hXfXbQsO+h40FiLd6TTdfBUKJA d6RlZcIqbZZzw1lSAPbVwZVVgc5EpSdEcdguHyHi7ndypyL1R0OscbZ4uD5uABNRxvmh NkEWC7NJMx5kPKYadrmGHaaYftwr42EdJ+uYykogZtxZPDXmQICZWz8emALRa7Pq9X5i 5t5XQwBztydqsu59oDy5+D+FXfH0td9WuVmi59fGtWa6OAbmKdbwbDNnau0VSozp7Ism NOM+p6UY5nCf/z7tmpinWAEGEw3Wxk1eAkr378x4b+r7zuXkOIChNMGy65e8SZcm4mGF SS5Q== 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=7vFJhrnylY1JvvO8pW+uN4POqaMSpNYfbRYWRXHFx3U=; b=EoEIv5elqla4GIYyCx7pBgsEGT4o0Z/UsHw+GC4UgugWnu47WaGaRunrKVQEs5MZ0g uGsx2W6HWcvlK7gunqWD98IymcRqDy5DzMsFs1mriT8WsirEDhsJnOUAUvUJ59bgAcrM yjN7plVVMK19g3EqgXp6z+4mFZMCxVxqDdcjD/Vz4I9py7DrjnqEEvFFX5BtxUiFbj0O ekEA4ATBN7Mfaaimz398Gl0a2c+H706GqGMTcj8g1Bdupfvv6KsmdLCCtAxLw5J8FPHV rYsCGV/HL6YF7247Qo86S6n5Aw1DwyU4mNFarGCivu18RMgG147q1l6FuiNViT19Xv+Y 5wGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q18-20020a17090311d200b001769fce8c2fsi2276726plh.485.2022.11.04.23.06.30; Fri, 04 Nov 2022 23:06:44 -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 S230014AbiKEGD2 (ORCPT + 99 others); Sat, 5 Nov 2022 02:03:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229587AbiKEGBf (ORCPT ); Sat, 5 Nov 2022 02:01:35 -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 5EB6D2D763 for ; Fri, 4 Nov 2022 23:01:34 -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 1F1BBB830BE for ; Sat, 5 Nov 2022 06:01:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C41B9C43143; Sat, 5 Nov 2022 06:01:31 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFj-007Ou4-34; Sat, 05 Nov 2022 02:01:59 -0400 Message-ID: <20221105060159.794397196@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:51 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Johannes Weiner , Suren Baghdasaryan Subject: [PATCH v4a 27/38] timers: sched/psi: Use timer_shutdown_sync() before freeing timer References: <20221105060024.598488967@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?1748635122090766953?= X-GMAIL-MSGID: =?utf-8?q?1748635122090766953?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Juri Lelli Cc: Vincent Guittot Cc: Dietmar Eggemann Cc: Ben Segall Cc: Mel Gorman Cc: Daniel Bristot de Oliveira Cc: Valentin Schneider Acked-by: Johannes Weiner Reviewed-by: Suren Baghdasaryan Signed-off-by: Steven Rostedt (Google) --- kernel/sched/psi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c index ee2ecc081422..f5f2613c4292 100644 --- a/kernel/sched/psi.c +++ b/kernel/sched/psi.c @@ -1033,6 +1033,7 @@ void psi_cgroup_free(struct cgroup *cgroup) cancel_delayed_work_sync(&cgroup->psi->avgs_work); free_percpu(cgroup->psi->pcpu); + timer_shutdown_sync(&cgroup->psi->poll_timer); /* All triggers must be removed by now */ WARN_ONCE(cgroup->psi->poll_states, "psi: trigger leak\n"); kfree(cgroup->psi); From patchwork Sat Nov 5 06:00: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: 15916 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp830802wru; Fri, 4 Nov 2022 23:07:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4/HJgEQLh4klfgkVOqLC31ghIDqrADmWoRBuyXoVHFQL+Z6YOuUSiRJaCXEI2E/FDyHQF1 X-Received: by 2002:aa7:8d17:0:b0:560:485a:e242 with SMTP id j23-20020aa78d17000000b00560485ae242mr39115597pfe.31.1667628463958; Fri, 04 Nov 2022 23:07:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628463; cv=none; d=google.com; s=arc-20160816; b=Zz7buLXqXcZqCpcg+aYRotDoZ9afN1oJwfUv8CSKpHEftIsrN5UDbuj+nA4gxZgoqM OxS37p4QhJGnyAJ460QQZBANadSZ9W+45vMxux6EQUPWeREl+w0qyLxVXLvx5m0iOoRJ 3UKW1c+ksjrYpU88fjG9uERFg0Hkod8o6JOAOnU6FV3UhA23ZLh2Dnz6JIFfr85Goxvb ayoDrSXNApMXY1CoI/LG1d91eTOdQHlARvP31Xhup8ytJZlnEW62VzxuvNFPnp+CB7TA JHsszMKlIk3qgLx09X46FY3wlZ3kI0TKWq6+2iq86n/4BKYAQZ+vCZNse269+sJvEcS4 F29g== 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=xf+1COUy22vuKe2EBC1hSgEKdt0sVUJK5Wk6pWpV/cU=; b=S1FP2kcQRi6+e4ZvQTpNuXYWDcJGIzcaob7cBwnWW6PwMg+FJJgD3Ynz9db4TAyPYJ bZAZHV0qXLqvwt3phPb6JYUhofA8PiNjp+nQpwBRkJU1JDElbPJfiS53vMOaAe8j1AxM 5rVxg9FWXieOD0ywOFIYYwDh0VPmW5ukVGQ/hUHzAZzjmFnNGNMGZfD1uihlVXlCQDHP 6yooC4V8uSNcemG4Bg+N5hiKvOt+keMIs300Nfl3pNz6B+YUX8sx5hiFMRY3lX4wtsyQ vtTJIpieV4hb8495BU1hdKk69OfNDXm/8En3DTWHbx60bZtA8rEsKqgTh5iPV/XLj3oi 4fNg== 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 26-20020a630c5a000000b0046ebe02836fsi2091923pgm.504.2022.11.04.23.07.29; Fri, 04 Nov 2022 23:07: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 S230020AbiKEGDd (ORCPT + 99 others); Sat, 5 Nov 2022 02:03:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229607AbiKEGBf (ORCPT ); Sat, 5 Nov 2022 02:01:35 -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 887C330562 for ; Fri, 4 Nov 2022 23:01:34 -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 45DA2B830BD for ; Sat, 5 Nov 2022 06:01:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 055FAC433B5; Sat, 5 Nov 2022 06:01:32 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFk-007Oud-0U; Sat, 05 Nov 2022 02:02:00 -0400 Message-ID: <20221105060159.989028673@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:52 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Tejun Heo , Lai Jiangshan Subject: [PATCH v4a 28/38] timers: workqueue: Use timer_shutdown_sync() before freeing timer References: <20221105060024.598488967@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?1748635184382647163?= X-GMAIL-MSGID: =?utf-8?q?1748635184382647163?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ Cc: Tejun Heo Cc: Lai Jiangshan Signed-off-by: Steven Rostedt (Google) --- kernel/workqueue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 7cd5f5e7e0a1..2bbea15be4c8 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -3608,8 +3608,8 @@ static void put_unbound_pool(struct worker_pool *pool) wait_for_completion(pool->detach_completion); /* shut down the timers */ - del_timer_sync(&pool->idle_timer); - del_timer_sync(&pool->mayday_timer); + timer_shutdown_sync(&pool->idle_timer); + timer_shutdown_sync(&pool->mayday_timer); /* RCU protected to allow dereferences from get_work_pool() */ call_rcu(&pool->rcu, rcu_free_pool); From patchwork Sat Nov 5 06:00: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: 15894 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp829231wru; Fri, 4 Nov 2022 23:03:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM73UE+u0iZT2P9xak36AZoSXuOauCBVHJPE9/fyVk0BgnaYGs0PGO24zMowK79or2C+rgRs X-Received: by 2002:a17:90b:30c1:b0:213:a155:949c with SMTP id hi1-20020a17090b30c100b00213a155949cmr40821140pjb.76.1667628194113; Fri, 04 Nov 2022 23:03:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628194; cv=none; d=google.com; s=arc-20160816; b=EvqlswqwPSlmAE3+z2Sz94dtO3B6ycX4M5cjIlIiNUXmdQxy/A4LsN/7gsLlFN97FU 1JetCWNCoTbtHF7MiYkNk0srPYJK4qW+GECNDCq1AJw/wyoZfVVCTJM23oCQqKWFJaKU B7Bke+2shy+2m2dOD3TCTmyDw9D/XL5Nfv3zX6QjRHWeQye597m7vtsQ7ost2qfqJpI8 YXvd8bCdNpbJpnuZlnyaCOzJds8xTw4oQQZ7FSPA7CQXx3W7DKu6i5tDJOImMhKiKj6z 2BB/LrVHuNYEppEg2tVBSHMYcwlvUVsSCbqoq90F5fCA29XMcv01cyD11PdKtXRDfYH3 uwCg== 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=16n1BYpYtSopzGMr7U/svmzw+5t5uvVZQr2/uUoaCCw=; b=TH4qnlsc9NvaTgkrRNCJvq+jFulE/Mt+YOBs2VYHJqcR+SIwGObrU3NZ5V8BixEFwO +fnpyWopPPi86W53gcIIECgxIAFZRyKUNO0kfsrAu5Wj5kpY8Q7nSj2EiiN4JOOSuA9F 9Z55tRvvISo3umyH29RIPHbnEX8lvaVyIkDpUBnGkzb53X6ca35wPXF9lovqZSFsYySk rd4LIq66aq2K0RFWD+sNoymTa7A00qsAvldWKp8vRVNnlpK2DYLyCIyXH4Y+hCcGknUQ XCMntSOLs+u/Oc1IRIEKPiLSMfjTxwrwu0ujg5cMq2uk0iyhiDQs3fcFh8d8tl2U3IhD kxcQ== 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 g13-20020a65580d000000b0046f580656c8si2170956pgr.351.2022.11.04.23.03.00; Fri, 04 Nov 2022 23:03: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 S229789AbiKEGCI (ORCPT + 99 others); Sat, 5 Nov 2022 02:02:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229636AbiKEGBe (ORCPT ); Sat, 5 Nov 2022 02:01:34 -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 6AEF330548 for ; Fri, 4 Nov 2022 23:01:32 -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 4CFB5609AD for ; Sat, 5 Nov 2022 06:01:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27DB0C43470; Sat, 5 Nov 2022 06:01:32 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFk-007OvC-15; Sat, 05 Nov 2022 02:02:00 -0400 Message-ID: <20221105060200.173378298@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:53 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , "Theodore Tso" , "Jason A. Donenfeld" Subject: [PATCH v4a 29/38] random: use timer_shutdown_sync() for on stack timers References: <20221105060024.598488967@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?1748634901141221443?= X-GMAIL-MSGID: =?utf-8?q?1748634901141221443?= From: "Steven Rostedt (Google)" Before a timer is released, timer_shutdown_sync() must be called. Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ Cc: "Theodore Ts'o" Acked-by: Jason A. Donenfeld Signed-off-by: Steven Rostedt (Google) --- drivers/char/random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/random.c b/drivers/char/random.c index 69754155300e..943b4b2712a5 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -1233,7 +1233,7 @@ static void __cold try_to_generate_entropy(void) stack.entropy = random_get_entropy(); } - del_timer_sync(&stack.timer); + timer_shutdown_sync(&stack.timer); destroy_timer_on_stack(&stack.timer); mix_pool_bytes(&stack.entropy, sizeof(stack.entropy)); } From patchwork Sat Nov 5 06:00:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15891 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp829059wru; Fri, 4 Nov 2022 23:02:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6CGH0DNh872C8QYHu6QmMgOrh/ptdyRk3T+/7HfnAGq/PIzEdgfTlfl3mpsfHDu1d916eT X-Received: by 2002:a17:902:d682:b0:186:9ecf:94c2 with SMTP id v2-20020a170902d68200b001869ecf94c2mr38888774ply.54.1667628175733; Fri, 04 Nov 2022 23:02:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628175; cv=none; d=google.com; s=arc-20160816; b=Tzdo+fUazAp+q9DkOQKVDGe84Lj/H9sK+XYJ+1UU0/VEE7DH7NeCw+Sk0qK/aXj2jz DXH7xloWM1eRFkf+jPlit8RDFejOP8aaxUlPnrdb7i6e4ru7HC3eehhm224RoysJ+wPW arRdrUYyNxKXAnZ9zoU8jlthL4IIKpd6vYawZnVxTVTnFg34BTudlKD2YpW9zjRWgekB 3bUuuJCQlcmxsZwTmCGmTW3ailc77XCfFoMUVoggEMrqV/ESvjlDyFccQsmS7IxAG1HD +s+4uOB+pQbAZtkWELxBdhVK/bMnP7e+qo+PLiyukJ20P0OPWeQfXE5SvHqbcfFRBCro TgJA== 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=gAKwCjheinwz8adnpJhxKuYk549Lly53nIF8TM+urEw=; b=vaT8vIIRRDU2vUtXYtQ3S+MPIrydMBam4pi6LmrEXb4Jd24jVi2zoBLY6ewL5e4eA1 44sEBU2PQGYUMNQXqY35DYFpicRZgC/Hp+Ixv7pDja4iotx7ooEeypQt2xpxuquxP2MR /tCFS5AZBWd467q1MbVbimLevpO6RlO1tnDVbqQpEZ6hPnjy5ui+swz+RrApj2EpJrj0 BhaW4F/jvk99FbWB2a/gbB5bvoklTN6kzFY6tpOiF+KGAQgn8ND/Cb+3ULn/rqyNnIl6 XodGCSb1mC1B/yErwb6qqQoYNrDRDf/1624w4K1zmftJ1VEI4zMyajW01rswl1GeeES1 OtUA== 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-20020a170902f54100b00186ef861484si2307881plf.500.2022.11.04.23.02.39; Fri, 04 Nov 2022 23:02:55 -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 S229567AbiKEGCA (ORCPT + 99 others); Sat, 5 Nov 2022 02:02:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229662AbiKEGBf (ORCPT ); Sat, 5 Nov 2022 02:01:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 299F531232; Fri, 4 Nov 2022 23:01:33 -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 0B29A609D0; Sat, 5 Nov 2022 06:01:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAD4EC433D6; Sat, 5 Nov 2022 06:01:32 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFl-007OxS-0D; Sat, 05 Nov 2022 02:02:01 -0400 Message-ID: <20221105060200.899233347@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:57 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , linux-s390@vger.kernel.org Subject: [PATCH v4a 33/38] timers: s390/cmm: Use timer_shutdown_sync() before a module is released References: <20221105060024.598488967@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?1748634881975609165?= X-GMAIL-MSGID: =?utf-8?q?1748634881975609165?= From: "Steven Rostedt (Google)" Before a module is released, timer_shutdown_sync() must be called on its timers. Also call it in the failure path of the module init function. Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Alexander Gordeev Cc: Christian Borntraeger Cc: Sven Schnelle Cc: linux-s390@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- arch/s390/mm/cmm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c index 9141ed4c52e9..1a0a8aa43ac6 100644 --- a/arch/s390/mm/cmm.c +++ b/arch/s390/mm/cmm.c @@ -419,7 +419,7 @@ static int __init cmm_init(void) #endif unregister_sysctl_table(cmm_sysctl_header); out_sysctl: - del_timer_sync(&cmm_timer); + timer_shutdown_sync(&cmm_timer); return rc; } module_init(cmm_init); @@ -432,7 +432,7 @@ static void __exit cmm_exit(void) #endif unregister_oom_notifier(&cmm_oom_nb); kthread_stop(cmm_thread_ptr); - del_timer_sync(&cmm_timer); + timer_shutdown_sync(&cmm_timer); cmm_free_pages(cmm_pages, &cmm_pages, &cmm_page_list); cmm_free_pages(cmm_timed_pages, &cmm_timed_pages, &cmm_timed_page_list); } From patchwork Sat Nov 5 06:00:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15910 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp830078wru; Fri, 4 Nov 2022 23:05:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5xgJ1XyBKtO7H1lsw85R9ChaZN9xdHFfdzoGSz/Qv+VJNYDs1MW3X69XnWD1tCS06c0e0v X-Received: by 2002:a17:902:b117:b0:186:a1fd:c3df with SMTP id q23-20020a170902b11700b00186a1fdc3dfmr38824575plr.23.1667628311055; Fri, 04 Nov 2022 23:05:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628311; cv=none; d=google.com; s=arc-20160816; b=iZyBz6u0B/JLOiJ74CY3M50GCtzu18ZxUs/Kb4UCSACc0E1ZnRKB+Ju6mXghHkwT2T lNK8rME5S67VvuGhDtWNPo1quqC4z2++0EizWQwHmfsj6WokYtkWyr4yu/GWOW0w0332 wRQrrwbgfMzNXY0D3NoE5dWCv/K9/y0stHZSTJXfdoF5XUcD6NZ2a88Ae/YALtD/WF4n 87Yyj3srQjVABjklfIRyUWK75TqZ8gyogaQ7a9YxvJn3q39J31+SoO7ugX8W7XCJ/jr4 gUlGr/By/4yLQ69ogTR8Hhp5ndFfh4GenGjfPDr8/P0wB07ZIxf7TuWz11Ldf6zd3F7t yzMQ== 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=JfGj1rAGiTgKeqaHA4ZUyTqSGOgMGU3pY0tJVSJH3NM=; b=0JXJPBV4JaBUpghg6/sfQb6TQTCyXYZpyNxuoKkgzm3L5C0qkevro1Bj5xrSsPg4Cd tJ4TbkY17I2a5PdOdSb4MzunXUn1e4yDvG26TwXdTUH3CgZ1O6hGEXL4x8MkvoepfYtj 3nvvkwDYKt0BXsna4cFe1TRD+7tF2nCjEPm3udB6SMsZY0UraFSaFvWjD7EUQ/FMnV57 13j58RLf11PowWKO3fxk00CclktwcePw+Wr4Us9SM4kq2y5w+xcGH2+/GLTjWvOunRS1 DzBKO0z6qDSpHKYFXqkRV4SwyhT4OowmgN4S3NGpiI/6/Yfj7MfzbVvQ/2/28oxeit46 gJTw== 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 b16-20020a170902d51000b001853ad3944dsi2402722plg.480.2022.11.04.23.04.58; Fri, 04 Nov 2022 23:05:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229956AbiKEGDL (ORCPT + 99 others); Sat, 5 Nov 2022 02:03:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229582AbiKEGBf (ORCPT ); Sat, 5 Nov 2022 02:01:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53AC631238; Fri, 4 Nov 2022 23:01:33 -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 3582960AB2; Sat, 5 Nov 2022 06:01:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10253C4347C; Sat, 5 Nov 2022 06:01:33 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFl-007Oy1-0o; Sat, 05 Nov 2022 02:02:01 -0400 Message-ID: <20221105060201.081948530@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:58 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Chas Williams <3chas3@gmail.com>, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org Subject: [PATCH v4a 34/38] timers: atm: Use timer_shutdown_sync() before a module is released References: <20221105060024.598488967@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?1748635024394989339?= X-GMAIL-MSGID: =?utf-8?q?1748635024394989339?= From: "Steven Rostedt (Google)" Before a module is released, timer_shutdown_sync() must be called on its timers. Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ 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/iphase.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/atm/idt77105.c b/drivers/atm/idt77105.c index bfca7b8a6f31..cc4a5449ca42 100644 --- a/drivers/atm/idt77105.c +++ b/drivers/atm/idt77105.c @@ -366,8 +366,8 @@ EXPORT_SYMBOL(idt77105_init); static void __exit idt77105_exit(void) { /* turn off timers */ - del_timer_sync(&stats_timer); - del_timer_sync(&restart_timer); + timer_shutdown_sync(&stats_timer); + timer_shutdown_sync(&restart_timer); } module_exit(idt77105_exit); diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index 324148686953..9be45d9d66b3 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c @@ -3280,7 +3280,7 @@ static void __exit ia_module_exit(void) { pci_unregister_driver(&ia_driver); - del_timer_sync(&ia_timer); + timer_shutdown_sync(&ia_timer); } module_init(ia_module_init); From patchwork Sat Nov 5 06:00:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15911 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp830181wru; Fri, 4 Nov 2022 23:05:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4ODXev0BZLw5pLW71JiJ32QlYSIosIa95Apc/LVejslRdyghHkjQF0Mjq8S+UQTxBfWlEw X-Received: by 2002:a17:90a:db93:b0:214:1671:a106 with SMTP id h19-20020a17090adb9300b002141671a106mr22027603pjv.4.1667628332670; Fri, 04 Nov 2022 23:05:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628332; cv=none; d=google.com; s=arc-20160816; b=bGMGBaRbQLSb325cIlJJZ/vTR+I43+8aNbWhn8vbp44O3iMj/rUVDgNBXSeDstjJ8m F4ZjJlKw24mDCryfpJOW20wSl73RwhcLUZSFBfO9/bTkM71kukAScMxELO6hYx/IhYbF OX2JNdyplCbjERhuS1SWqyAsRS5rs4kmFgopw/EKnCJp+G9ycwnW48tVrBhBRXPEiKi8 l2ZJFKL1OTbayPyzCDpYkPoLfHVHTUgigsMU9YTKLyrFrpZMQRQHiY17aXNipTzkQOs3 dCaNY1UZ57MJz2vYVvlyKlqFbgx18kUj8Usi5NUq4lOk0iuqiAcN2/p88m1abTqhY10+ TFxA== 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=641fSrXeKQzwCLK9CRNXhH5sQ3Ib+Z9TYyeZXKqnHvw=; b=0pybzSrAieZb/W8hac5HPoFd7B2hM6ITxtVk4dB70oVBd5NQn2Q8o84Q0IlYCoOZTk VkMjqUNmadvYvST5+zc0voIDrOrUo8G8MxxPInA9/L8KqSPQsxixp3rmZWg40BG59GIB cXtfLpmTsMLEIGZ74mP7m+q1qFKIJvC5yez5MrpHtzCYOofn6Cumyh16hCPXsObNELY9 hfyTMhQFWJ7+2X2IrSwYm0sjQNzw0Di0HOH2xD3saLIvI7HcAua6lxkMszOc7B5hf4YN ZlizlFWSY56PVxORyD0Tm2OCDZ/bdZ5wV0UK5HfH7SXsbxDU3krILbbRiqt54uwzjVmK XTxA== 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 d11-20020a170902cecb00b00180a7ff784csi2268374plg.360.2022.11.04.23.05.20; Fri, 04 Nov 2022 23:05:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229537AbiKEGDP (ORCPT + 99 others); Sat, 5 Nov 2022 02:03:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229665AbiKEGBf (ORCPT ); Sat, 5 Nov 2022 02:01:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DFDB3123B for ; Fri, 4 Nov 2022 23:01:33 -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 5FF0060A67 for ; Sat, 5 Nov 2022 06:01:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3AD9DC433D6; Sat, 5 Nov 2022 06:01:33 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFl-007Oya-1Q; Sat, 05 Nov 2022 02:02:01 -0400 Message-ID: <20221105060201.271193974@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:00:59 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Arnd Bergmann , Greg Kroah-Hartman Subject: [PATCH v4a 35/38] timers: hangcheck: Use timer_shutdown_sync() before a module is released References: <20221105060024.598488967@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?1748635046750166846?= X-GMAIL-MSGID: =?utf-8?q?1748635046750166846?= From: "Steven Rostedt (Google)" Before a module is released, timer_shutdown_sync() must be called on its timers. Also fixed some whitespace issues in the line after. Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Signed-off-by: Steven Rostedt (Google) --- drivers/char/hangcheck-timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/char/hangcheck-timer.c b/drivers/char/hangcheck-timer.c index 4181bcc1c796..783a86bfca69 100644 --- a/drivers/char/hangcheck-timer.c +++ b/drivers/char/hangcheck-timer.c @@ -167,8 +167,8 @@ static int __init hangcheck_init(void) static void __exit hangcheck_exit(void) { - del_timer_sync(&hangcheck_ticktock); - printk("Hangcheck: Stopped hangcheck timer.\n"); + timer_shutdown_sync(&hangcheck_ticktock); + printk("Hangcheck: Stopped hangcheck timer.\n"); } module_init(hangcheck_init); From patchwork Sat Nov 5 06:01:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15912 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp830218wru; Fri, 4 Nov 2022 23:05:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM65TdmQypcQXCtkBpeYzy8mLGyxHbIPDpSHxVvgv6UvFv5r+QFsEFtxc/fNDRbNis4/cjhe X-Received: by 2002:a17:90b:1d09:b0:213:773a:b4b2 with SMTP id on9-20020a17090b1d0900b00213773ab4b2mr49781299pjb.40.1667628342405; Fri, 04 Nov 2022 23:05:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628342; cv=none; d=google.com; s=arc-20160816; b=n1cnBZPOys2mmpe5fUMUsgsXsUvlMIqIoLRf5OJ8Zg5gvWpjcaNdMAxfoYhLiZ6LLo G0bFb54N0R37dAm7fWxVQTwlERAgRiJpvf4DhwxF+SMCTIwDeojY2U9tN3U+Fqphcn9d SfI0k5bYgC2vT7JgYMWWRUZK0iiTMDlrgxGZDQJAX48y5s8x6rzkBCHkZV8hw/k8fSXm R4+XsxSHhNM1KFljDxznpEyWUKfE5SsIcxPIVsu1zkNuJwNtGz8H1HzOkp2mmGQZ8eCF IeWy3OODmC2FGYfcsVYjg/Z3dqGWRbH2R6nOIKS4aVO6vtA9nrXxecKjAx2oXvC/MELw clEA== 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=RMykPRkJh8nqd/DCR/zs9jXXZ/X5utPEAbrRyFNANxA=; b=xDSAgSTdSFSC7jDvnCsnUcNI2DA2ZWqbKNewtjStKcYR4S6ci7MPYfHixltRp0l2m4 RJjyD/2iLL4LatIY+KLnyrO5++E4DjtqAJ5fpoL0y1/OGwE9alkFv/33adQDSFWQwABk R94MzcqfIb3zlf6/bBpYBOgFBZ+1d9QV917zXPeQ/w+kxWJ6cVylTfr1QXYu4eAEqCca U28HyBG3K+hj+rvqiuX8CrH7zlbk97Q7ASNIbYDW6vGyuVWDg3SBkQd17F+2YJjpCRdb Tt5k6hCRmkVBPflfc3wbvmpQ7jPs9VR7E7nVbUL8fTbOxRKIVGcJfImFwehQPDgsIBFP 9d6g== 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 c11-20020a170902d48b00b00186a2274386si2275830plg.469.2022.11.04.23.05.30; Fri, 04 Nov 2022 23:05:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229861AbiKEGDS (ORCPT + 99 others); Sat, 5 Nov 2022 02:03:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229666AbiKEGBf (ORCPT ); Sat, 5 Nov 2022 02:01:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B08EA3123E for ; Fri, 4 Nov 2022 23:01:33 -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 9115360AB6 for ; Sat, 5 Nov 2022 06:01:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C0B7C43470; Sat, 5 Nov 2022 06:01:33 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFl-007Oz9-20; Sat, 05 Nov 2022 02:02:01 -0400 Message-ID: <20221105060201.459104132@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:01:00 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , openipmi-developer@lists.sourceforge.net, Corey Minyard Subject: [PATCH v4a 36/38] timers: ipmi: Use timer_shutdown_sync() before a module is released References: <20221105060024.598488967@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?1748635056919971795?= X-GMAIL-MSGID: =?utf-8?q?1748635056919971795?= From: "Steven Rostedt (Google)" Before a module is released, timer_shutdown_sync() must be called on its timers. Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ Cc: openipmi-developer@lists.sourceforge.net Acked-by: Corey Minyard Signed-off-by: Steven Rostedt (Google) --- drivers/char/ipmi/ipmi_msghandler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index 49a1707693c9..5cfb85e22d65 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c @@ -5540,7 +5540,7 @@ static void __exit cleanup_ipmi(void) * here. */ atomic_set(&stop_operation, 1); - del_timer_sync(&ipmi_timer); + timer_shutdown_sync(&ipmi_timer); initialized = false; From patchwork Sat Nov 5 06:01:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15914 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp830396wru; Fri, 4 Nov 2022 23:06:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4RKAb7nsduB0KF/yJENI5uevDzX0ULVI8IVAYi+jERqpGJ+krn90HcEbtBooimemDgBm5I X-Received: by 2002:a05:6a00:4c93:b0:56e:55de:986e with SMTP id eb19-20020a056a004c9300b0056e55de986emr11319766pfb.42.1667628380007; Fri, 04 Nov 2022 23:06:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667628380; cv=none; d=google.com; s=arc-20160816; b=REkYHRNm5HYDygpT97xlZ5G5+chZ88FR1URrto/v2s60aEm0pY+o0c1/rDyQ3eCVu9 NYcrNsxObHpMqwVPjjH8jwqQeTsA0O4kI87X/UCtjlDpEcM3ErGdMDMGGqAiWdcG0DYc s4DFE7YjpLJ2JZVo04jcalFn1EnXCNWMz3XQINUz/6Kbxkc5KsQgI1voBJZqrhY3oN5D H9DCesTn7OWAvBqUb8e9aZsbrT0ZyyZ6EjMqpCc38sJLEKofnTCOBhCymX7W0PzZhW6k XFB4+qaO0VX5FKZnRoh/NWidCjprASUE9tHyspQs81LekkKv4fB4vUtDaoaC1Sw1m1FY +vNA== 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=JzESANma5z0W6PL59yuAxjlHJIxfurijGrr4aHVP3Q4=; b=tyQXL7g+34jrRYifslXX3+RSAbJe+Aea1cVz6r0cVeth8XUk8qFQftjDREt8dlCQBS eRx1iQj4Q/0uMgIeWtDLY7j8bdiO99aJCHIzVX1ogHz9ljnVFKIJz+CoMXedZyl7MbdQ qhB3uhkKi/3tGu7JbmCn6Ks6CrUMMk8CD5SwEvyb1eGetofhAgVR7SPN1JtM0XqUIFIQ BAntBbW8yNj58fLjzeDWA1527URQ0f5kMh0y+FBbSyfhu06Ir7iG2KKj13YSmGdn+I01 D1nXKenolgvR83rxB3fwhbx9A01ePlrRMlcqVrZNCHy0rF0MfHACSkvALUmevgUoi+3B KMrQ== 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 q12-20020a170902a3cc00b001837ff673d3si1732140plb.262.2022.11.04.23.06.07; Fri, 04 Nov 2022 23:06: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 S230013AbiKEGDZ (ORCPT + 99 others); Sat, 5 Nov 2022 02:03:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229668AbiKEGBf (ORCPT ); Sat, 5 Nov 2022 02:01:35 -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 7612230560; Fri, 4 Nov 2022 23:01:34 -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 58488609EB; Sat, 5 Nov 2022 06:01:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5D5EC433C1; Sat, 5 Nov 2022 06:01:33 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1orCFl-007P0H-3B; Sat, 05 Nov 2022 02:02:01 -0400 Message-ID: <20221105060201.829050575@goodmis.org> User-Agent: quilt/0.66 Date: Sat, 05 Nov 2022 02:01:02 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , linux-pm@vger.kernel.org Subject: [PATCH v4a 38/38] timers: PM: Use timer_shutdown_sync() References: <20221105060024.598488967@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?1748635095949037221?= X-GMAIL-MSGID: =?utf-8?q?1748635095949037221?= From: "Steven Rostedt (Google)" Instead of open coding making the timer look like it was not registered by setting the function pointer to NULL, call timer_shutdown_sync() that does the same thing. Link: https://lore.kernel.org/all/20221104054053.431922658@goodmis.org/ Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: Pavel Machek Cc: Greg Kroah-Hartman Cc: linux-pm@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- drivers/base/power/wakeup.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c index 7cc0c0cf8eaa..c6d68bdcac68 100644 --- a/drivers/base/power/wakeup.c +++ b/drivers/base/power/wakeup.c @@ -202,12 +202,7 @@ void wakeup_source_remove(struct wakeup_source *ws) raw_spin_unlock_irqrestore(&events_lock, flags); synchronize_srcu(&wakeup_srcu); - del_timer_sync(&ws->timer); - /* - * Clear timer.function to make wakeup_source_not_registered() treat - * this wakeup source as not registered. - */ - ws->timer.function = NULL; + timer_shutdown_sync(&ws->timer); } EXPORT_SYMBOL_GPL(wakeup_source_remove);