mlxsw: core: Enable devlink reload only on probe
authorJiri Pirko <jiri@mellanox.com>
Sun, 10 Nov 2019 15:31:44 +0000 (16:31 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 12 Nov 2019 05:38:33 +0000 (21:38 -0800)
Call devlink enable only during probe time and avoid deadlock
during reload.

Reported-by: Shalom Toledo <shalomt@mellanox.com>
Fixes: a0c76345e3d3 ("devlink: disallow reload operation during device cleanup")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Tested-by: Shalom Toledo <shalomt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/core.c

index da436a6aad2fb1a41725940555421c719cf7594a..42e1ce3e39e1af6e93a32e2ebce5165890bf02a4 100644 (file)
@@ -1198,10 +1198,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;