Skip to content

Commit

Permalink
IB/mlx5: Fix fatal error dispatching
Browse files Browse the repository at this point in the history
commit dbaaff2 upstream.

When an internal error condition is detected, make sure to set the
device inactive after dispatching the event so ULPs can get a
notification of this event.

Fixes: e126ba9 ('mlx5: Add driver for Mellanox Connect-IB adapters')
Signed-off-by: Eli Cohen <eli@mellanox.com>
Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Reviewed-by: Mohamad Haj Yahia <mohamad@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Eli Cohen authored and Greg Kroah-Hartman committed Nov 26, 2016
1 parent 7340399 commit c524185
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/infiniband/hw/mlx5/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,13 +947,13 @@ static void mlx5_ib_event(struct mlx5_core_dev *dev, void *context,
{
struct mlx5_ib_dev *ibdev = (struct mlx5_ib_dev *)context;
struct ib_event ibev;

bool fatal = false;
u8 port = 0;

switch (event) {
case MLX5_DEV_EVENT_SYS_ERROR:
ibdev->ib_active = false;
ibev.event = IB_EVENT_DEVICE_FATAL;
fatal = true;
break;

case MLX5_DEV_EVENT_PORT_UP:
Expand Down Expand Up @@ -998,6 +998,9 @@ static void mlx5_ib_event(struct mlx5_core_dev *dev, void *context,

if (ibdev->ib_active)
ib_dispatch_event(&ibev);

if (fatal)
ibdev->ib_active = false;
}

static void get_ext_port_caps(struct mlx5_ib_dev *dev)
Expand Down

0 comments on commit c524185

Please sign in to comment.