Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp474705pxk; Thu, 1 Oct 2020 07:05:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiUGCzMzAXe0hEvOTK53fNXZksGkgOQxKLCnUb05tofhTTDq5JPg7kw2N/BS3RqLLdPs1s X-Received: by 2002:a17:906:2f0c:: with SMTP id v12mr8261864eji.484.1601561113549; Thu, 01 Oct 2020 07:05:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601561113; cv=none; d=google.com; s=arc-20160816; b=MFuVdJyxWjHYIj0CTVFjGWG2PbgM0q+/ZGPgaXmhPA8uvMN/fX6Ptv7CrRMLAzd0+S L1YywvJaot1ka2SM+64qRZiT8lBUcPoonM6F1f7nOx99mNenNG2cJE4ddbdu+qsLQ4vF s0qjXRxNny36owtMRVctC1ZkDMyqs2iNCHH8Ac3SrcMczyJQvdMFZmDWrMX8Bfqcm/vD rGcwQXvu/ZZxa/oSKBMBYtONCZbpGrC5ck1JWIwL2xC1wdt3q5cz4s33ADOy+5et8H2x 7i6QkqK/5tEK4H2cK15Kt5vBFkgLa0wKiX5OXVWgSTIMvN8fvmFyaQ6TM9bBIxhcozqs sjYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=Gbt7/Iih24M8+l3kLxUT6G8ZkSmXw2hdUoW/CVBHHus=; b=QbfWv9gF0oXZPjnsY28sehg8bazzt6bK56JUHtOrzERBmqwC6d1QhU0z/yAoTFO/IZ Y6Kmrr26V0PXT4ql5P+zb5fqXyyxuWgvzKdWtKbemYdI6/IzHyY8ihQ6gFYBWiGPKdvx kSiA5BmB1d1Q3SkPppaxj050rvtv4DEJE5T1jsMd3HTrrczQiMzfYXBePGf+zQXoSx5/ /Wo7M4pXJ/harmuG/rRKq8V3dFjlmsagTs+RbY+unSWJpa4L1MIUwshGTaaviUEC/oPB umvfywneMWRyZ8YU48D6DAV21EmW6O7LfgQZ3PMjkmFdC6OOmlGDWKQKUSVZ+QLlQZUF omJw== 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 jo19si1452336ejb.252.2020.10.01.07.04.49; Thu, 01 Oct 2020 07:05:13 -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 S1732775AbgJAOCi (ORCPT + 99 others); Thu, 1 Oct 2020 10:02:38 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:36653 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732452AbgJAOA3 (ORCPT ); Thu, 1 Oct 2020 10:00:29 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from moshe@mellanox.com) with SMTP; 1 Oct 2020 17:00:25 +0300 Received: from dev-l-vrt-136.mtl.labs.mlnx (dev-l-vrt-136.mtl.labs.mlnx [10.234.136.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 091E0Pr4002097; Thu, 1 Oct 2020 17:00:25 +0300 Received: from dev-l-vrt-136.mtl.labs.mlnx (localhost [127.0.0.1]) by dev-l-vrt-136.mtl.labs.mlnx (8.14.7/8.14.7) with ESMTP id 091E0P2Q011179; Thu, 1 Oct 2020 17:00:25 +0300 Received: (from moshe@localhost) by dev-l-vrt-136.mtl.labs.mlnx (8.14.7/8.14.7/Submit) id 091E0PwE011178; Thu, 1 Oct 2020 17:00:25 +0300 From: Moshe Shemesh To: "David S. Miller" , Jakub Kicinski , Jiri Pirko Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Moshe Shemesh Subject: [PATCH net-next 10/16] net/mlx5: Handle sync reset abort event Date: Thu, 1 Oct 2020 16:59:13 +0300 Message-Id: <1601560759-11030-11-git-send-email-moshe@mellanox.com> X-Mailer: git-send-email 1.8.4.3 In-Reply-To: <1601560759-11030-1-git-send-email-moshe@mellanox.com> References: <1601560759-11030-1-git-send-email-moshe@mellanox.com> 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 Reviewed-by: Saeed Mahameed --- .../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 26caf65e9f5f..56ae72e016f1 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; }; @@ -271,6 +272,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; @@ -285,6 +296,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; } } @@ -335,6 +349,7 @@ int mlx5_fw_reset_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); return 0; } -- 2.18.2