From patchwork Fri Nov 4 05:41:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15358 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp191003wru; Thu, 3 Nov 2022 22:51:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6NzxzXGg2kBJf0/RKPcNiOx2Bh1qe7Sk9j7hzj3V04r0TuqFnN7O/5lXx6cyhHxk24OGMH X-Received: by 2002:a05:6402:538a:b0:457:b602:d5a6 with SMTP id ew10-20020a056402538a00b00457b602d5a6mr34104591edb.371.1667541102915; Thu, 03 Nov 2022 22:51:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667541102; cv=none; d=google.com; s=arc-20160816; b=xu9784dyHqfHosOf+4xBx0zh8D51iRSmOW9XvPP4FyDImM4GPM1ULFNJiAynkM/56b xucZEHTAdzUIRLj7I4zr6RJ0Qj0FKhRS7h8SMHi+EamokCimMf97QuMocSC9au9cnc+y Hqg6Fb0QeGn5qkFFurXHIcNKeAfSSb0943Jj7y/5NHwzibireqVu8iTHstl8JImcE8un OLvOcnah18PdKdiY2pOI+M1+PXfGlcvrJxMF9yoGUCs4YFXaOuTqA5w/uo8FtIlOZ7ZZ qm7wH+ZZliRfOqkMtLmbk2fFzn4bxi/LyT0pP/suzK0n7s0WNPSrqoSYnYmlBtAjQJXx EWGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=y5hrpxydxaq7frZ5MPLWOI4xtqSeRCXbT7tKcuIKCjM=; b=ySJTlp5UnbszC28lwBjy7CfSwt4+F0sltROgcnFGRCaiTEsLZv8qmHKKRfHCedgfX6 lKF/b6Y0uwv8vQCGMmj1JKRtvfmyWwuyf51p7gB1pP3C1oX4kyM3NdKRFVIiOLLPr7Ap eAltkMnjbzLTMz1tvhzdgnGMzeeEOdEK1RDUZlvb/Q1yzSogSS+IlFX8zpHv2nmChFSD frznZ0na5jV+VxsUlEeJGFg4HZgIRQZO3MUCoj99Hq58x/YWmx2s4w1foUaERWxsqEll UtuGTgz7zZbhVDpM8S6pX5T53t9WUiw0yM2GRn2xpdiXIhGzaM8aD2kpi3Pfkc4QjhDt PTRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i9-20020a1709064fc900b0078badb3816dsi4209212ejw.952.2022.11.03.22.51.19; Thu, 03 Nov 2022 22:51:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231772AbiKDFue (ORCPT + 99 others); Fri, 4 Nov 2022 01:50:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231339AbiKDFsy (ORCPT ); Fri, 4 Nov 2022 01:48:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E86B28E00; Thu, 3 Nov 2022 22:48:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3EBBF620D9; Fri, 4 Nov 2022 05:48:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B239C433C1; Fri, 4 Nov 2022 05:48:50 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZs-0071Bq-22; Fri, 04 Nov 2022 01:49:16 -0400 Message-ID: <20221104054916.464295277@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:18 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , Nilesh Javali , GR-QLogic-Storage-Upstream@marvell.com, "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org Subject: [RFC][PATCH v3 25/33] timers: scsi: Use timer_shutdown_sync() and timer_shutdown() before freeing timer References: <20221104054053.431922658@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543579331716516?= X-GMAIL-MSGID: =?utf-8?q?1748543579331716516?= From: "Steven Rostedt (Google)" Before a timer is freed, timer_shutdown_sync() must be called, or timer_shutdown() if it's already known that the timer is disabled. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: Nilesh Javali Cc: GR-QLogic-Storage-Upstream@marvell.com Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- drivers/scsi/qla2xxx/qla_edif.c | 4 ++-- drivers/scsi/scsi_lib.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_edif.c b/drivers/scsi/qla2xxx/qla_edif.c index 00ccc41cef14..7f3a3c8673b5 100644 --- a/drivers/scsi/qla2xxx/qla_edif.c +++ b/drivers/scsi/qla2xxx/qla_edif.c @@ -416,7 +416,7 @@ static void __qla2x00_release_all_sadb(struct scsi_qla_host *vha, */ if (edif_entry->delete_sa_index != INVALID_EDIF_SA_INDEX) { - del_timer(&edif_entry->timer); + timer_shutdown_sync(&edif_entry->timer); /* build and send the aen */ fcport->edif.rx_sa_set = 1; @@ -2799,7 +2799,7 @@ qla28xx_sa_update_iocb_entry(scsi_qla_host_t *v, struct req_que *req, "%s: removing edif_entry %p, new sa_index: 0x%x\n", __func__, edif_entry, pkt->sa_index); qla_edif_list_delete_sa_index(sp->fcport, edif_entry); - del_timer(&edif_entry->timer); + timer_shutdown_sync(&edif_entry->timer); ql_dbg(ql_dbg_edif, vha, 0x5033, "%s: releasing edif_entry %p, new sa_index: 0x%x\n", diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 8b89fab7c420..e6cd1efb9eca 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -558,6 +558,7 @@ static bool scsi_end_request(struct request *req, blk_status_t error, */ destroy_rcu_head(&cmd->rcu); + timer_shutdown(&cmd->abort_work.timer); /* * In the MQ case the command gets freed by __blk_mq_end_request, * so we have to do all cleanup that depends on it earlier.