]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/mlx5e: Revert parameters on errors when changing PTP state without reset
authorMaxim Mikityanskiy <maximmi@mellanox.com>
Fri, 29 Jan 2021 12:04:34 +0000 (14:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Mar 2021 12:30:17 +0000 (14:30 +0200)
commitb3ff92a53f8d33a40f4056f564ab63fbca630ee5
treef748fa354830124ce75cfea82b7cdd53557470f6
parent422379ba05dfb60f5ce304130b31178c4c36abf1
net/mlx5e: Revert parameters on errors when changing PTP state without reset

[ Upstream commit 74640f09735f935437bd8df9fe61a66f03eabb34 ]

Port timestamping for PTP can be enabled/disabled while the channels are
closed. In that case mlx5e_safe_switch_channels is skipped, and the
preactivate hook is called directly. However, if that hook returns an
error, the channel parameters must be reverted back to their old values.
This commit adds missing handling on this case.

Fixes: 145e5637d941 ("net/mlx5e: Add TX PTP port object support")
Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c