diff mbox series

[net] mlxsw: core: Enable devlink reload only on probe

Message ID 20191110153123.15885-1-jiri@resnulli.us
State Accepted
Delegated to: David Miller
Headers show
Series [net] mlxsw: core: Enable devlink reload only on probe | expand

Commit Message

Jiri Pirko Nov. 10, 2019, 3:31 p.m. UTC
From: Jiri Pirko <jiri@mellanox.com>

Call devlink enable only during probe time and avoid deadlock
during reload.

Reported-by: Shalom Toledo <shalomt@mellanox.com>
Fixes: 5a508a254bed ("devlink: disallow reload operation during device cleanup")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Shalom Toledo Nov. 10, 2019, 3:48 p.m. UTC | #1
On 10/11/2019 17:31, Jiri Pirko wrote:
> From: Jiri Pirko <jiri@mellanox.com>
> 
> Call devlink enable only during probe time and avoid deadlock
> during reload.
> 
> Reported-by: Shalom Toledo <shalomt@mellanox.com>
> Fixes: 5a508a254bed ("devlink: disallow reload operation during device cleanup")
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>

Tested-by: Shalom Toledo <shalomt@mellanox.com>
David Miller Nov. 12, 2019, 5:37 a.m. UTC | #2
From: Jiri Pirko <jiri@resnulli.us>
Date: Sun, 10 Nov 2019 16:31:23 +0100

> From: Jiri Pirko <jiri@mellanox.com>
> 
> Call devlink enable only during probe time and avoid deadlock
> during reload.
> 
> Reported-by: Shalom Toledo <shalomt@mellanox.com>
> Fixes: 5a508a254bed ("devlink: disallow reload operation during device cleanup")
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>

Applied, and since the Fixes: tag commit is queued up for -stable, I'll
queue up this one too.

Thanks.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c
index 20e9dc46cacd..0a0884d86d44 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/core.c
@@ -1186,10 +1186,11 @@  __mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info,
 	if (err)
 		goto err_thermal_init;
 
-	if (mlxsw_driver->params_register) {
+	if (mlxsw_driver->params_register)
 		devlink_params_publish(devlink);
+
+	if (!reload)
 		devlink_reload_enable(devlink);
-	}
 
 	return 0;