Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3294055rwa; Tue, 23 Aug 2022 02:09:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR50zcZGLDVfB359qCCb1XkPv3/tAbbqirdoUNC9twHvI5VbpMG3y/8K09XN63I5i07V/+h6 X-Received: by 2002:a17:907:b05:b0:73d:68a6:2c5a with SMTP id h5-20020a1709070b0500b0073d68a62c5amr9069889ejl.245.1661245775535; Tue, 23 Aug 2022 02:09:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661245775; cv=none; d=google.com; s=arc-20160816; b=qKeQzEvfdr8ttUlYF8IHHJ3VjrkIDhRJQcys0T33TRrLih2ZQMsJVy+S8bZJJ7tLUH XsBLDGeP350stymsAL0NYFH4YwxfTAFpyhV9IWBJyuKF5MEMSSB/ajlhCCbmn0pEMasl 7v41JkG+LBRGXpQY2ZeKTxfaRCv7PumjJtRusP83fzFZ4il2j0cg5BHFhOSLLHxO51At 3PWqmVOH63fBlKzie3m+LutNLQXDMZec5r1k1DayxEbV9W4pK1N54l/YkAWBzB1vkrlD xbujGq5UAzKookGTQFYJjmbKn2T6AcPJoAvIzNTRS63Yi+rarExgq0x5vQ46pqXEUODW a8Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0ahTOZOy2FUmBhycx8SrM2SbFzBATayX/yqF54yVajc=; b=nYiGiU1biMlx1w/AnV3xYPbUKbM+5eBw99d/C2b5VANaQ15NZOs1axQEJGMoweu7yW YIA6ty1bKm9BYhzaUQ/h/rqlmQTW4Hn9CD/G0gf6SBS2Aip11CXCeIs7lTTiwJd4Rdvh lpYGcYGwijBQ1upDu3s94xrwH5zfA+IjDYoWlWDbub8U5zWGIh5Mlx4cGji04nW6YWyE kzyFaGwqL9nYlZFdOqv0YbX9PnQ9fyHacYn2t6+07nmOo+b5hvCE1sQde4xsp1FKKazE yoRh1VF33591VUkgk0aIfdd7zz4eS1DcvydCTyrUjZkGucvhBH3/IwIqyofRhHSyepBL fHoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oEwUN44l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds13-20020a170907724d00b0073bd9771c65si13917180ejc.389.2022.08.23.02.09.08; Tue, 23 Aug 2022 02:09:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oEwUN44l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236423AbiHWJBq (ORCPT + 99 others); Tue, 23 Aug 2022 05:01:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241104AbiHWJBH (ORCPT ); Tue, 23 Aug 2022 05:01:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4F3E82876; Tue, 23 Aug 2022 01:27:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0A5CBB81C48; Tue, 23 Aug 2022 08:27:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 422EFC433D6; Tue, 23 Aug 2022 08:27:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661243223; bh=XqrLsuMQD7WWEuspC3uWOb0vRFo3OKEJ+OYxw17qHtc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oEwUN44leMxMTSHFRzJSeWYjtTyG3798at4nFKsKFszNZxsKgyl5Fg0+KLwVAqUy0 vgk0GHr/BIDGj+WgJbNzYPVs1tpK+5NCniOmVotYrMcm4CcIfqMv+fsckrW4SbiGBd GPPFZ+N51RHE0SiTaoC9jHntF954tfK0RxybIgfM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Amit Cohen , Ido Schimmel , Petr Machata , "David S. Miller" Subject: [PATCH 5.19 209/365] mlxsw: spectrum: Clear PTP configuration after unregistering the netdevice Date: Tue, 23 Aug 2022 10:01:50 +0200 Message-Id: <20220823080126.937910740@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080118.128342613@linuxfoundation.org> References: <20220823080118.128342613@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Amit Cohen 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 Signed-off-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- 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);