Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp423044pxk; Sun, 30 Aug 2020 08:37:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjIN/5i+EyFGxG7dKWC10NfuyNt49O5xkzKlr43QGCyDaszfbLwbvsmv17VGAia7osE2QS X-Received: by 2002:aa7:df0e:: with SMTP id c14mr7902705edy.200.1598801836154; Sun, 30 Aug 2020 08:37:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598801836; cv=none; d=google.com; s=arc-20160816; b=Z3ng/uHBK7NFR2y0eqWRGsK2OKZ/nL4HmvHYfC9J7SeZyyYsaQ1np1uwtvDRifpArp QWr/kG+4yesJSIUpt28AnEmgYy+qeLNC4TXC9/cC3gnIW1ihGhoM5n2m21k0uR+G5g3u w7Ax41Z91pKst7hyKN5BwP+fhAPlB0tltv+FKRmMZ5xJrAMIkDWk/cTLjGvd6/9Ow3OR cTz0l36HiVRHx2gSFuktEwPFkJvnSK3wMWPIr6UMhKA08piR8C4R91ckFpEfO22H7t4Y 7pJ5ZL1Nq+U2TWA6CbMw07UsA2N7QK/6nNmzCrUJHtanbA1qLOh4XOsnzoLoDINAH5wR GjaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=a+udlIItVzIcsdqKflFsMo7n+Gmh7eUYkrcpFHGaYK0=; b=V80qwbyuTFNgNfw6b27/Spu4Ej6pmDDDfani4bS7SsekKBR+Le7AvFBV9NZz1Kqtf3 yHI840hoJ5oHq2ljmXsHVyxVwEk9VzIZcJM/TjOBT0HQf68HsFuhO8h29Mw01K63tAdw AAQk8pJpXLos2Y/grtqiK1vh3kzfWwu1IqY4nt9tQxE+PUVz4zjylG8yZd1S0xdu5xL/ lHbG4PLvY/iy1eXRWmtYhJGln/VIix/nMxStfrAa0zKtMt0lTGB5owQzSrrcNrbuaLkv zrFk19JAExAzww9l0Jsl5doaHZ03ubSY1HYzHzxlG5jj2/H9Hou7NTb1qLwA6AFJAh4s Zfew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jo17si3606985ejb.362.2020.08.30.08.36.53; Sun, 30 Aug 2020 08:37:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727863AbgH3Pdu (ORCPT + 99 others); Sun, 30 Aug 2020 11:33:50 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:42744 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726579AbgH3P2B (ORCPT ); Sun, 30 Aug 2020 11:28:01 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from moshe@mellanox.com) with SMTP; 30 Aug 2020 18:27:56 +0300 Received: from dev-l-vrt-135.mtl.labs.mlnx (dev-l-vrt-135.mtl.labs.mlnx [10.234.135.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 07UFRtXE029649; Sun, 30 Aug 2020 18:27:56 +0300 Received: from dev-l-vrt-135.mtl.labs.mlnx (localhost [127.0.0.1]) by dev-l-vrt-135.mtl.labs.mlnx (8.15.2/8.15.2/Debian-10) with ESMTP id 07UFRtLX027845; Sun, 30 Aug 2020 18:27:55 +0300 Received: (from moshe@localhost) by dev-l-vrt-135.mtl.labs.mlnx (8.15.2/8.15.2/Submit) id 07UFRtJx027844; Sun, 30 Aug 2020 18:27:55 +0300 From: Moshe Shemesh To: "David S. Miller" , Jakub Kicinski Cc: Jiri Pirko , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Moshe Shemesh Subject: [PATCH net-next RFC v3 08/14] net/mlx5: Handle sync reset abort event Date: Sun, 30 Aug 2020 18:27:28 +0300 Message-Id: <1598801254-27764-9-git-send-email-moshe@mellanox.com> X-Mailer: git-send-email 1.8.4.3 In-Reply-To: <1598801254-27764-1-git-send-email-moshe@mellanox.com> References: <1598801254-27764-1-git-send-email-moshe@mellanox.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If firmware sends sync_reset_abort to driver the driver should clear the reset requested mode as reset is not expected any more. Signed-off-by: Moshe Shemesh --- .../net/ethernet/mellanox/mlx5/core/fw_reset.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c b/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c index f9e293de9de3..61237f4836cc 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c @@ -14,6 +14,7 @@ struct mlx5_fw_reset { struct work_struct reset_request_work; struct work_struct reset_reload_work; struct work_struct reset_now_work; + struct work_struct reset_abort_work; unsigned long reset_flags; struct timer_list timer; }; @@ -266,6 +267,16 @@ static void mlx5_sync_reset_now_event(struct work_struct *work) mlx5_load_one(dev, false); } +static void mlx5_sync_reset_abort_event(struct work_struct *work) +{ + struct mlx5_fw_reset *fw_reset = container_of(work, struct mlx5_fw_reset, + reset_abort_work); + struct mlx5_core_dev *dev = fw_reset->dev; + + mlx5_sync_reset_clear_reset_requested(dev, true); + mlx5_core_warn(dev, "PCI Sync FW Update Reset Aborted.\n"); +} + static void mlx5_sync_reset_events_handle(struct mlx5_fw_reset *fw_reset, struct mlx5_eqe *eqe) { struct mlx5_eqe_sync_fw_update *sync_fw_update_eqe; @@ -280,6 +291,9 @@ static void mlx5_sync_reset_events_handle(struct mlx5_fw_reset *fw_reset, struct case MLX5_SYNC_RST_STATE_RESET_NOW: queue_work(fw_reset->wq, &fw_reset->reset_now_work); break; + case MLX5_SYNC_RST_STATE_RESET_ABORT: + queue_work(fw_reset->wq, &fw_reset->reset_abort_work); + break; } } @@ -317,6 +331,7 @@ int mlx5_fw_reset_events_init(struct mlx5_core_dev *dev) INIT_WORK(&fw_reset->reset_request_work, mlx5_sync_reset_request_event); INIT_WORK(&fw_reset->reset_reload_work, mlx5_sync_reset_reload_work); INIT_WORK(&fw_reset->reset_now_work, mlx5_sync_reset_now_event); + INIT_WORK(&fw_reset->reset_abort_work, mlx5_sync_reset_abort_event); MLX5_NB_INIT(&fw_reset->nb, fw_reset_event_notifier, GENERAL_EVENT); mlx5_eq_notifier_register(dev, &fw_reset->nb); -- 2.17.1