Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4744362pjb; Mon, 27 Jul 2020 04:09:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgmCMb4Ia/IvQ+gPtH/U0PyY6Evry36yoxa6Mokl/rJJUqwitSDKWlQS089cpGhkpKET/1 X-Received: by 2002:a17:906:403:: with SMTP id d3mr3368339eja.522.1595848181988; Mon, 27 Jul 2020 04:09:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595848181; cv=none; d=google.com; s=arc-20160816; b=A6KKQsW74++cNm/lsKSG4RSRbkwz7W18SQsY3sbvzdeSzYXjqsmTZMQ9VDbQn2TwoP rMXD6k1JtChNyE9tHCf0a6mfOSsQyWFJSfxU8c+GkzuoqYlee1/OBLzDa8ijxdnaIVJm OhQ9u0AdSS8/qQaiSOd1KipxkDq2+BJ2uOmg9cuhnOm8YPdg3hNMMmDRnXY0PLQ0a19z eC81xrYbLyZOksIJhs40syPpnpo/ocIB4nNus5CufkUOaFZXf10q2s0tJV+h0SJf7ia9 v4jyi481BN1GvNRNo+47RISDfxQ31POT5GOAf8peSFczWxEc4POhUxaUtZokVEtCOomf F1Aw== 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=ba2/HNlNpb6tRIS0lhnd5nki1s+M5Iib87GpA/w1h0U=; b=sCmM8poiuMwcWepwSQeQtSPTXLZ4Vk5RqzZWdjX0O0pYlbBWaDRwG2glViSeMEkjLo gK39WYAL90PSmZE5ke3CZ5c4/EREVEGNKG/ad5q09EG+y1pZulcCFAGuzGb8eLoo0Q7H E0mnsXQVYvc/Eau/vilehInEdzW7hWifBTXOh1OI2dyz7XiFGXmz4gnDtOXWDu+1vMkr AqnF8Wr3qRasw8E9VWWyekh3jhWMxHxjwxIwibPfJgPiDxGGjBp1do1LK/2hb5rd7B/J wJlAb2e06Tlyee3EPZ+Z6qK9I6810EIL8+zBZjiowUr3YX60JChdxesFXF71qvqm1HKt RW6g== 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 h23si5159266ejj.573.2020.07.27.04.09.19; Mon, 27 Jul 2020 04:09:41 -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 S1728726AbgG0LHy (ORCPT + 99 others); Mon, 27 Jul 2020 07:07:54 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:40693 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728068AbgG0LGQ (ORCPT ); Mon, 27 Jul 2020 07:06:16 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from moshe@mellanox.com) with SMTP; 27 Jul 2020 14:06:13 +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 06RB6Dg9022237; Mon, 27 Jul 2020 14:06:13 +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 06RB6Dfs002396; Mon, 27 Jul 2020 14:06:13 +0300 Received: (from moshe@localhost) by dev-l-vrt-135.mtl.labs.mlnx (8.15.2/8.15.2/Submit) id 06RB6DUe002395; Mon, 27 Jul 2020 14:06:13 +0300 From: Moshe Shemesh To: "David S. Miller" , Jiri Pirko , Vasundhara Volam Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Moshe Shemesh Subject: [PATCH net-next RFC 07/13] net/mlx5: Handle sync reset abort event Date: Mon, 27 Jul 2020 14:02:27 +0300 Message-Id: <1595847753-2234-8-git-send-email-moshe@mellanox.com> X-Mailer: git-send-email 1.8.4.3 In-Reply-To: <1595847753-2234-1-git-send-email-moshe@mellanox.com> References: <1595847753-2234-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 87f2b24f4aaa..e665080e9a4e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c @@ -9,6 +9,7 @@ struct mlx5_fw_reset { struct workqueue_struct *wq; struct work_struct reset_request_work; struct work_struct reset_now_work; + struct work_struct reset_abort_work; struct completion done; int ret; }; @@ -192,6 +193,16 @@ static void mlx5_sync_reset_now_event(struct work_struct *work) complete(&fw_reset->done); } +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_health_clear_reset_requested_mode(dev); + 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; @@ -206,6 +217,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; } } @@ -242,6 +256,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_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