Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp143222pxb; Mon, 7 Feb 2022 08:06:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJyDRxd8byEtj9NyIB2bYydEBuMRaZCZuxWqtDJJ3BGPESH8Sk3764+UJ6oerDahpS+JX5sn X-Received: by 2002:a63:216:: with SMTP id 22mr70992pgc.89.1644249991710; Mon, 07 Feb 2022 08:06:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644249991; cv=none; d=google.com; s=arc-20160816; b=fGKX0Vq7DWUNnuBvboKdEpIn6EcwtG3tf8tHr6rXQJXepHcLfQQ0I9FY3BiGqRjz53 reHVNvrKvyXYyEbj1FDntAI2mhhd6i15KqOG1acFycv6bCav3Fmf2hv1/omviusG4b+2 F6CgUXI2/OvcjrB9DSaLqqbUQnoWIeIghIdpUgaXAeSUSD8GgQPcslOzproEXa/EUxhu NpIQl64LUvS8P9LwN1G+O90e6JpPNXSSfDkqpKKZnT6O1qCMi1OF5I0VB7EvmMy8VUdJ PIu5zg/oucgZzeFMoTsq53wk0kccBk1AvmqRbYMQeGT99dsDvZJURj++0sqkaS5hOvPV dk3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lOYBvOtnC4qXbwoAgZh6E/ajZsLomoq2yiBpfdJSF1c=; b=sHcYJVLVBXR1/kPDJPLDEatyxm+TQE0HDfppeFN7Cth+hbBdx+W+WQbyhAm7YDgfEg NqzRPB2rniw5OQ8e4huuqgTy+vat2m05uFTnqlkOW4zY+9W43p/eGF+S31Y8izr0Spr6 pIZU+NeyO4/l221sTc147RIkoJOnn0wzw3zP0dVwQSIFKwUQL1pd5apOFcu/aA05BGcs fecNFnuuq6fygsbtUHIwt3SvRNV+BkPzOqGrULKYMTk7DYYDvV4YBkxYb7aPYHu/kZAH gR95/dqIHXpvxZHxfaYJ0If/KVOMD4rYve14ojRLM5enWQXygoH1FWJX2evtE3MNjz/m F5JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=x3w6Wnii; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p5si9369621plk.338.2022.02.07.08.06.15; Mon, 07 Feb 2022 08:06:31 -0800 (PST) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=x3w6Wnii; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357586AbiBDJY2 (ORCPT + 99 others); Fri, 4 Feb 2022 04:24:28 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:42634 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357864AbiBDJXX (ORCPT ); Fri, 4 Feb 2022 04:23:23 -0500 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 C23D7616B0; Fri, 4 Feb 2022 09:23:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E95EC340ED; Fri, 4 Feb 2022 09:23:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643966602; bh=FAjeDFHv7D9J2c8F4j6IzyeX2v7R5BW6Uj33dBF69mE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x3w6WniikzNo705ZPZMZGGxVUBLObCw5gbXOtTF+MJdb75kSXQZQmrSTHr4jJh1ka p6/0Ej8c+Izmn51Wy8omQiYW8ZR3WrQ87A/XIxhPvUVcfV0Y1nJCgVyDEcaRIF86ZP ZsaLOw0u838D0Jrvw8s/XwmCCpJJv8KMHyoUixE8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maher Sanalla , Moshe Shemesh , Saeed Mahameed Subject: [PATCH 5.15 15/32] net/mlx5: Use del_timer_sync in fw reset flow of halting poll Date: Fri, 4 Feb 2022 10:22:25 +0100 Message-Id: <20220204091915.764312201@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220204091915.247906930@linuxfoundation.org> References: <20220204091915.247906930@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maher Sanalla commit 3c5193a87b0fea090aa3f769d020337662d87b5e upstream. Substitute del_timer() with del_timer_sync() in fw reset polling deactivation flow, in order to prevent a race condition which occurs when del_timer() is called and timer is deactivated while another process is handling the timer interrupt. A situation that led to the following call trace: RIP: 0010:run_timer_softirq+0x137/0x420 recalibrate_cpu_khz+0x10/0x10 ktime_get+0x3e/0xa0 ? sched_clock_cpu+0xb/0xc0 __do_softirq+0xf5/0x2ea irq_exit_rcu+0xc1/0xf0 sysvec_apic_timer_interrupt+0x9e/0xc0 asm_sysvec_apic_timer_interrupt+0x12/0x20 Fixes: 38b9f903f22b ("net/mlx5: Handle sync reset request event") Signed-off-by: Maher Sanalla Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c @@ -131,7 +131,7 @@ static void mlx5_stop_sync_reset_poll(st { struct mlx5_fw_reset *fw_reset = dev->priv.fw_reset; - del_timer(&fw_reset->timer); + del_timer_sync(&fw_reset->timer); } static void mlx5_sync_reset_clear_reset_requested(struct mlx5_core_dev *dev, bool poll_health)