Date: Thu, 8 Mar 2018 09:51:33 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330645 - head/sys/dev/mlx5/mlx5_core Message-ID: <201803080951.w289pXdD032835@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Thu Mar 8 09:51:33 2018 New Revision: 330645 URL: https://svnweb.freebsd.org/changeset/base/330645 Log: Avoid calling sleeping function from the health poll thread in mlx5core. linux commit c1d4d2e92ad670168a17a57dfa182a5a5baa72d4 Submitted by: Matthew Finlay <matt@mellanox.com> MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_health.c Thu Mar 8 09:47:09 2018 (r330644) +++ head/sys/dev/mlx5/mlx5_core/mlx5_health.c Thu Mar 8 09:51:33 2018 (r330645) @@ -87,15 +87,23 @@ static int in_fatal(struct mlx5_core_dev *dev) void mlx5_enter_error_state(struct mlx5_core_dev *dev) { - if (dev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) + mutex_lock(&dev->intf_state_mutex); + if (dev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) { + goto unlock; return; + } mlx5_core_err(dev, "start\n"); - if (pci_channel_offline(dev->pdev) || in_fatal(dev)) + if (pci_channel_offline(dev->pdev) || in_fatal(dev)) { dev->state = MLX5_DEVICE_STATE_INTERNAL_ERROR; + mlx5_trigger_cmd_completions(dev); + } mlx5_core_event(dev, MLX5_DEV_EVENT_SYS_ERROR, 0); mlx5_core_err(dev, "end\n"); + +unlock: + mutex_unlock(&dev->intf_state_mutex); } static void mlx5_handle_bad_state(struct mlx5_core_dev *dev) @@ -213,7 +221,6 @@ static void poll_health(unsigned long data) return; if (dev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) { - mlx5_trigger_cmd_completions(dev); mod_timer(&health->timer, get_next_poll_jiffies()); return; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803080951.w289pXdD032835>