]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum: Clear PTP configuration after unregistering the netdevice
authorAmit Cohen <amcohen@nvidia.com>
Fri, 12 Aug 2022 15:32:01 +0000 (17:32 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 15 Aug 2022 10:49:58 +0000 (11:49 +0100)
commit0c070678b033af94c826c318b2a1172ad0b1a077
tree70cce1324ac33dc8d1cd22071a378576ad20a3d7
parent9abc277f94bf04b1c19a92813313a92c532d89f5
mlxsw: spectrum: Clear PTP configuration after unregistering the netdevice

Currently as part of removing port, PTP API is called to clear the
existing configuration and set the 'rx_filter' and 'tx_type' to zero.
The clearing is done before unregistering the netdevice, which means that
there is a window of time in which the user can reconfigure PTP in the
port, and this configuration will not be cleared.

Reorder the operations, clear PTP configuration after unregistering the
netdevice.

Fixes: b711e885ca602 ("mlxsw: spectrum: PTP: Support SIOCGHWTSTAMP, SIOCSHWTSTAMP ioctls")
Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c