diff options
| author | Eli Cohen <eli@mellanox.com> | 2016-10-27 09:36:44 -0400 |
|---|---|---|
| committer | Doug Ledford <dledford@redhat.com> | 2016-11-16 20:03:44 -0500 |
| commit | dbaaff2a2caa03d472b5cc53a3fbfd415c97dc26 (patch) | |
| tree | c48f2bee323daccd92b2331cd5f538b7c4e8e0f1 /drivers/infiniband/hw | |
| parent | 6bc1a656ab9f57f0112823b4a36930c9a29d1f89 (diff) | |
IB/mlx5: Fix fatal error dispatching
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: e126ba97dba9 ('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>
Diffstat (limited to 'drivers/infiniband/hw')
| -rw-r--r-- | drivers/infiniband/hw/mlx5/main.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index bb61487861cc..a014ad38d889 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c | |||
| @@ -2311,14 +2311,14 @@ static void mlx5_ib_event(struct mlx5_core_dev *dev, void *context, | |||
| 2311 | { | 2311 | { |
| 2312 | struct mlx5_ib_dev *ibdev = (struct mlx5_ib_dev *)context; | 2312 | struct mlx5_ib_dev *ibdev = (struct mlx5_ib_dev *)context; |
| 2313 | struct ib_event ibev; | 2313 | struct ib_event ibev; |
| 2314 | 2314 | bool fatal = false; | |
| 2315 | u8 port = 0; | 2315 | u8 port = 0; |
| 2316 | 2316 | ||
| 2317 | switch (event) { | 2317 | switch (event) { |
| 2318 | case MLX5_DEV_EVENT_SYS_ERROR: | 2318 | case MLX5_DEV_EVENT_SYS_ERROR: |
| 2319 | ibdev->ib_active = false; | ||
| 2320 | ibev.event = IB_EVENT_DEVICE_FATAL; | 2319 | ibev.event = IB_EVENT_DEVICE_FATAL; |
| 2321 | mlx5_ib_handle_internal_error(ibdev); | 2320 | mlx5_ib_handle_internal_error(ibdev); |
| 2321 | fatal = true; | ||
| 2322 | break; | 2322 | break; |
| 2323 | 2323 | ||
| 2324 | case MLX5_DEV_EVENT_PORT_UP: | 2324 | case MLX5_DEV_EVENT_PORT_UP: |
| @@ -2370,6 +2370,9 @@ static void mlx5_ib_event(struct mlx5_core_dev *dev, void *context, | |||
| 2370 | 2370 | ||
| 2371 | if (ibdev->ib_active) | 2371 | if (ibdev->ib_active) |
| 2372 | ib_dispatch_event(&ibev); | 2372 | ib_dispatch_event(&ibev); |
| 2373 | |||
| 2374 | if (fatal) | ||
| 2375 | ibdev->ib_active = false; | ||
| 2373 | } | 2376 | } |
| 2374 | 2377 | ||
| 2375 | static void get_ext_port_caps(struct mlx5_ib_dev *dev) | 2378 | static void get_ext_port_caps(struct mlx5_ib_dev *dev) |
