summaryrefslogtreecommitdiffstats
path: root/include/linux/mlx5/driver.h
diff options
context:
space:
mode:
authorHuy Nguyen <huyn@mellanox.com>2017-08-08 13:17:00 -0500
committerSaeed Mahameed <saeedm@mellanox.com>2017-08-30 21:20:43 +0300
commitb3cb5388499c5e219324bfe7da2e46cbad82bfcf (patch)
treea955b5290d59ec1e87ba1e7cebae113d69da139b /include/linux/mlx5/driver.h
parent672d0880b7798a917bcc622308f25a0fbb991dab (diff)
downloadlinux-b3cb5388499c5e219324bfe7da2e46cbad82bfcf.tar.gz
linux-b3cb5388499c5e219324bfe7da2e46cbad82bfcf.tar.bz2
linux-b3cb5388499c5e219324bfe7da2e46cbad82bfcf.zip
net/mlx5: Skip mlx5_unload_one if mlx5_load_one fails
There is an issue where the firmware fails during mlx5_load_one, the health_care timer detects the issue and schedules a health_care call. Then the mlx5_load_one detects the issue, cleans up and quits. Then the health_care starts and calls mlx5_unload_one to clean up the resources that no longer exist and causes kernel panic. The root cause is that the bit MLX5_INTERFACE_STATE_DOWN is not set after mlx5_load_one fails. The solution is removing the bit MLX5_INTERFACE_STATE_DOWN and quit mlx5_unload_one if the bit MLX5_INTERFACE_STATE_UP is not set. The bit MLX5_INTERFACE_STATE_DOWN is redundant and we can use MLX5_INTERFACE_STATE_UP instead. Fixes: 5fc7197d3a25 ("net/mlx5: Add pci shutdown callback") Signed-off-by: Huy Nguyen <huyn@mellanox.com> Reviewed-by: Daniel Jurgens <danielj@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'include/linux/mlx5/driver.h')
-rw-r--r--include/linux/mlx5/driver.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index df6ce59a1f95..918f5e644506 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -673,9 +673,8 @@ enum mlx5_device_state {
};
enum mlx5_interface_state {
- MLX5_INTERFACE_STATE_DOWN = BIT(0),
- MLX5_INTERFACE_STATE_UP = BIT(1),
- MLX5_INTERFACE_STATE_SHUTDOWN = BIT(2),
+ MLX5_INTERFACE_STATE_UP = BIT(0),
+ MLX5_INTERFACE_STATE_SHUTDOWN = BIT(1),
};
enum mlx5_pci_status {