mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Moshe Shemesh <moshe@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Jiri Pirko <jiri@mellanox.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Moshe Shemesh <moshe@mellanox.com>
Subject: [PATCH net-next RFC v5 09/15] net/mlx5: Handle sync reset abort event
Date: Fri, 18 Sep 2020 19:06:45 +0300	[thread overview]
Message-ID: <1600445211-31078-10-git-send-email-moshe@mellanox.com> (raw)
In-Reply-To: <1600445211-31078-1-git-send-email-moshe@mellanox.com>

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 <moshe@mellanox.com>
---
 .../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


  parent reply	other threads:[~2020-09-18 16:15 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-18 16:06 [PATCH net-next RFC v5 00/15] Add devlink reload action and limit level options Moshe Shemesh
2020-09-18 16:06 ` [PATCH net-next RFC v5 01/15] devlink: Add reload action option to devlink reload command Moshe Shemesh
2020-09-23 18:25   ` Jakub Kicinski
2020-09-24 19:01     ` Moshe Shemesh
2020-09-24 20:38       ` Jakub Kicinski
2020-09-18 16:06 ` [PATCH net-next RFC v5 02/15] devlink: Add reload action limit level Moshe Shemesh
2020-09-23 18:36   ` Jakub Kicinski
2020-09-24 19:29     ` Moshe Shemesh
2020-09-24 20:45       ` Jakub Kicinski
2020-09-18 16:06 ` [PATCH net-next RFC v5 03/15] devlink: Add reload action stats Moshe Shemesh
2020-09-23 18:42   ` Jakub Kicinski
2020-09-24 19:31     ` Moshe Shemesh
2020-09-18 16:06 ` [PATCH net-next RFC v5 04/15] devlink: Add reload actions stats to dev get Moshe Shemesh
2020-09-23 18:50   ` Jakub Kicinski
2020-09-24 19:34     ` Moshe Shemesh
2020-09-18 16:06 ` [PATCH net-next RFC v5 05/15] net/mlx5: Add functions to set/query MFRL register Moshe Shemesh
2020-09-18 16:06 ` [PATCH net-next RFC v5 06/15] net/mlx5: Set cap for pci sync for fw update event Moshe Shemesh
2020-09-18 16:06 ` [PATCH net-next RFC v5 07/15] net/mlx5: Handle sync reset request event Moshe Shemesh
2020-09-18 16:06 ` [PATCH net-next RFC v5 08/15] net/mlx5: Handle sync reset now event Moshe Shemesh
2020-09-18 16:06 ` Moshe Shemesh [this message]
2020-09-18 16:06 ` [PATCH net-next RFC v5 10/15] net/mlx5: Add support for devlink reload action fw activate Moshe Shemesh
2020-09-18 16:06 ` [PATCH net-next RFC v5 11/15] devlink: Add enable_remote_dev_reset generic parameter Moshe Shemesh
2020-09-18 16:06 ` [PATCH net-next RFC v5 12/15] net/mlx5: Add devlink param enable_remote_dev_reset support Moshe Shemesh
2020-09-18 16:06 ` [PATCH net-next RFC v5 13/15] net/mlx5: Add support for fw live patch event Moshe Shemesh
2020-09-18 16:06 ` [PATCH net-next RFC v5 14/15] net/mlx5: Add support for devlink reload action limit level no reset Moshe Shemesh
2020-09-18 16:06 ` [PATCH net-next RFC v5 15/15] devlink: Add Documentation/networking/devlink/devlink-reload.rst Moshe Shemesh
2020-09-23 13:44 ` [PATCH net-next RFC v5 00/15] Add devlink reload action and limit level options Moshe Shemesh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1600445211-31078-10-git-send-email-moshe@mellanox.com \
    --to=moshe@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=jiri@mellanox.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®