From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 898E0C43217 for ; Fri, 4 Feb 2022 09:24:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357685AbiBDJYP (ORCPT ); Fri, 4 Feb 2022 04:24:15 -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: stable@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)