Skip to content

Commit c524185

Browse files
Eli Cohengregkh
authored andcommitted
IB/mlx5: Fix fatal error dispatching
commit dbaaff2a2caa03d472b5cc53a3fbfd415c97dc26 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>
1 parent 7340399 commit c524185

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • drivers/infiniband/hw/mlx5

drivers/infiniband/hw/mlx5/main.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -947,13 +947,13 @@ static void mlx5_ib_event(struct mlx5_core_dev *dev, void *context,
947947
{
948948
struct mlx5_ib_dev *ibdev = (struct mlx5_ib_dev *)context;
949949
struct ib_event ibev;
950-
950+
bool fatal = false;
951951
u8 port = 0;
952952

953953
switch (event) {
954954
case MLX5_DEV_EVENT_SYS_ERROR:
955-
ibdev->ib_active = false;
956955
ibev.event = IB_EVENT_DEVICE_FATAL;
956+
fatal = true;
957957
break;
958958

959959
case MLX5_DEV_EVENT_PORT_UP:
@@ -998,6 +998,9 @@ static void mlx5_ib_event(struct mlx5_core_dev *dev, void *context,
998998

999999
if (ibdev->ib_active)
10001000
ib_dispatch_event(&ibev);
1001+
1002+
if (fatal)
1003+
ibdev->ib_active = false;
10011004
}
10021005

10031006
static void get_ext_port_caps(struct mlx5_ib_dev *dev)

0 commit comments

Comments
 (0)