Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3413697rwa; Tue, 23 Aug 2022 04:29:57 -0700 (PDT) X-Google-Smtp-Source: AA6agR74k0qdVerGuu8sYkuSrhTyj6xMbRoSQuJC5lheaUFFnOJ0UoMRjeO3sEAA2rlVbIEsVQWa X-Received: by 2002:a17:90a:1d0e:b0:1fa:bf2e:a56e with SMTP id c14-20020a17090a1d0e00b001fabf2ea56emr2838129pjd.23.1661254196956; Tue, 23 Aug 2022 04:29:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661254196; cv=none; d=google.com; s=arc-20160816; b=ssTKfC1nuVAyTJE4T8yyc4pk+KVtz3ajAybfU7uJm3KtR9cVDJWlZOdJy7qrJEzvJM Tq5Fo3SDH1L2KhtAa2p84DXNZry50NcCrFuUQKYCaV2DIl5rZcroJWWBP/eHMbQ+Qlsv FGzug0ycT70BDuQcRAEN1XcqyTBeIbdHd8KgdiWF94XdaYM+KSFIn4xlDn5mt0560ID0 mhAXJVIOZ72lvPlrAwJH2ENe73bkNCkxxg5J3TFT6EgB5tYx6NBlawm0X3ZV3oIwABuZ kaJy7lHush+1EcIByKkYw3AoDmV5mP/852ZjnYVVyxRiS7QEhUtyiyV4jk4LnVKk7jse msIQ== 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=sAjHiikY1vyAhRV25san67NGnocMjmKYTL1clbS1Im4=; b=QURXCqdpHV8i2l645Q0L5/S6hf4vqdRX+yC9kNg68tSzvm46HgigLRWqIfQI9/WADV EU/7ad5VOht1k2fZHmTWTi4xAnDM92zPD0vWu4xrHpk683A+cT7F5xeHl+nIl8lyjIMT r+Nnb6uFaPA6ZXhCs7wagEhGZq4Hup6uEOH1Rngf7Mh7+t65YBJO7cAHSbqJ2yg3lsr1 NYeADHm8wrX3f9kKZYRqBJcUo8GNa0i9z8MOTO+y66+PejXPLW8a8QSyPYy8i7aErW/j AgEgcrF+NwlbNN7N8nEc7snq3nURqg2CosbzI3kNZgqHO+rvV/tMSBN8tth2EZTvMn6n qkQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mWmfsGD2; 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 e3-20020a170902cf4300b0016eec1292e4si14661098plg.500.2022.08.23.04.29.44; Tue, 23 Aug 2022 04:29:56 -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=mWmfsGD2; 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 S1353791AbiHWKMH (ORCPT + 99 others); Tue, 23 Aug 2022 06:12:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352179AbiHWKEl (ORCPT ); Tue, 23 Aug 2022 06:04:41 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 767FD7CB49; Tue, 23 Aug 2022 01:51:46 -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 DF3BAB81BF8; Tue, 23 Aug 2022 08:51:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FC5BC433C1; Tue, 23 Aug 2022 08:51:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244703; bh=xchc2uYcdy/PHF2UcBVcST9d80rgCnHTzb/KmibmEeg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mWmfsGD2tCKrJh5yYm6kPc1k8B5Gb1ia36kW9ImL7VtqYCpQ/qz2EqInmD87361qP 3MKkXBqWt8T08YI3rREbEvBMnzq5CP2I/pmU7p/9j63ZJ7uNv07FMq+Kg/stAapQnZ 9LJ4uvqpObmHeoYYPxYTBE68CY64NYJC4JibBslY= 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.15 136/244] mlxsw: spectrum: Clear PTP configuration after unregistering the netdevice Date: Tue, 23 Aug 2022 10:24:55 +0200 Message-Id: <20220823080103.693521759@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080059.091088642@linuxfoundation.org> References: <20220823080059.091088642@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 @@ -1730,9 +1730,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);