lkml.org 
[lkml]   [2022]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.19 209/365] mlxsw: spectrum: Clear PTP configuration after unregistering the netdevice
    Date
    From: Amit Cohen <amcohen@nvidia.com>

    commit a159e986ad26d3f35c0157ac92760ba5e44e6785 upstream.

    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: 8748642751ede ("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>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
    +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
    @@ -1822,9 +1822,9 @@ static void mlxsw_sp_port_remove(struct

    cancel_delayed_work_sync(&mlxsw_sp_port->periodic_hw_stats.update_dw);
    cancel_delayed_work_sync(&mlxsw_sp_port->ptp.shaper_dw);
    - mlxsw_sp_port_ptp_clear(mlxsw_sp_port);
    mlxsw_core_port_clear(mlxsw_sp->core, local_port, mlxsw_sp);
    unregister_netdev(mlxsw_sp_port->dev); /* This calls ndo_stop */
    + mlxsw_sp_port_ptp_clear(mlxsw_sp_port);
    mlxsw_sp_port_vlan_classification_set(mlxsw_sp_port, true, true);
    mlxsw_sp->ports[local_port] = NULL;
    mlxsw_sp_port_vlan_flush(mlxsw_sp_port, true);

    \
     
     \ /
      Last update: 2022-08-23 11:02    [W:2.954 / U:0.332 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site