]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: Fix a bug of using ptp channel index as pin index
authorEran Ben Elisha <eranbe@mellanox.com>
Wed, 8 Jul 2020 15:53:19 +0000 (18:53 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Tue, 28 Jul 2020 19:55:40 +0000 (12:55 -0700)
commitd3e9e3971bafc15b79cfa232718663051d4927d2
treec1a2f654208e474ee42419e5610de88199f84f7d
parentb4d56e8306d345dbcff7aed2af9b080a6d8ed6fa
net/mlx5: Fix a bug of using ptp channel index as pin index

On PTP mlx5_ptp_enable(on=0) flow, driver mistakenly used channel index
as pin index.

After ptp patch marked in fixes tag was introduced, driver can freely
call ptp_find_pin() as part of the .enable() callback.

Fix driver mlx5_ptp_enable(on=0) flow to always use ptp_find_pin(). With
that, Driver will use the correct pin index in mlx5_ptp_enable(on=0) flow.

In addition, when initializing the pins, always set channel to zero. As
all pins can be attached to all channels, let ptp_set_pinfunc() to move
them between the channels.

For stable branches, this fix to be applied only on kernels that includes
both patches in fixes tag. Otherwise, mlx5_ptp_enable(on=0) will be stuck
on pincfg_mux.

Fixes: 421c194b68bc ("ptp: Avoid deadlocks in the programmable pin code.")
Fixes: e4ade0b7f5ed ("net/mlx5e: Implement 1PPS support")
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Reviewed-by: Ariel Levkovich <lariel@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c