Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp168977pxu; Tue, 6 Oct 2020 23:05:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZbMhBs0H1AflK7+K8BMh6OZM5rH7boCEQWNkPMkbr0oOY38jEO9wr3NVEUexmtJYTQKNx X-Received: by 2002:a17:906:d045:: with SMTP id bo5mr1673632ejb.320.1602050701115; Tue, 06 Oct 2020 23:05:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602050701; cv=none; d=google.com; s=arc-20160816; b=SS6Bi205Jym4vMyJrDfOg+qEYjXWnHaNkP7J/CG8ZY0De/CgB0F52jZ/0UVX9Cuu5N zNE89fV1EemL88SQMPHj4JXkrPZuMX+NgVWtQhcFbgbDaJvViba+x0YddzTRggRU9WoT pddfWQ1uWFwSvIVhQn7SB8lcG5c0Z/asdrzn9o77/CYJrAjR/25+xwHaY0Is14RkTPvi qYrzBK5mdDM62O8Efpps0f7vm9/jZQQok7DCAnzmSBMP9fgql64DdFurGp0vGGqRJRHG gx/pigAnvIh+4q8srdOGmE4Up5yDSkoksz3MP41CmIybvFrs8vBO9IBE5etBBLaNH31+ hKFg== 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=WCVc8vlMVsnVcfqA+cPnh7pVOiUQIuCtXS2Yjil89cYBrcd0KY+OVctQBF9RKGaCRy K3KSp3SCFmLBN1W6Z99/X48K2TQoVnG68qcI+W+ecV1E0+Bq3WN1t2/+3Jo2T5nyozDE S8gJSTvwuHwMFPsQ3+6wVNVRNLW7FVAjq+KWaQI/EkjE82SveF42ufLT5ee1OBoiTr7o okz1D7ss7HjEp3DBIpQ4zvJOeas5UfM5SNFkNPeT08cZUWn653QJqAGuwo2AOYtiFLnm VUORAyJDFDzMwfyEYK3IYE3zo/4ofVVVfX9CGR6GComD5xFnPcPQw5+CBjHaaUc0kuu9 GHhQ== 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 s2si636467edy.490.2020.10.06.23.04.38; Tue, 06 Oct 2020 23:05:01 -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 S1727705AbgJGGCa (ORCPT + 99 others); Wed, 7 Oct 2020 02:02:30 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:34433 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727331AbgJGGB1 (ORCPT ); Wed, 7 Oct 2020 02:01:27 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from moshe@mellanox.com) with SMTP; 7 Oct 2020 09:01:17 +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 09761HXU018860; Wed, 7 Oct 2020 09:01:17 +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 09761HNU021783; Wed, 7 Oct 2020 09:01:17 +0300 Received: (from moshe@localhost) by dev-l-vrt-136.mtl.labs.mlnx (8.14.7/8.14.7/Submit) id 09761HFR021782; Wed, 7 Oct 2020 09:01:17 +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 v2 10/16] net/mlx5: Handle sync reset abort event Date: Wed, 7 Oct 2020 09:00:51 +0300 Message-Id: <1602050457-21700-11-git-send-email-moshe@mellanox.com> X-Mailer: git-send-email 1.8.4.3 In-Reply-To: <1602050457-21700-1-git-send-email-moshe@mellanox.com> References: <1602050457-21700-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