From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3AD0FC10F11 for ; Sat, 13 Apr 2019 16:54:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F39362084D for ; Sat, 13 Apr 2019 16:54:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="Vlem83uN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727960AbfDMQy4 (ORCPT ); Sat, 13 Apr 2019 12:54:56 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:60371 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727687AbfDMQyy (ORCPT ); Sat, 13 Apr 2019 12:54:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=8FGzyxiVa5nhTxjUUV1pjEyq7929pVzVZNP/1mzeySA=; b=Vlem83uNCdK4TrZvZRXXMb4g1s uuKJxOZUdAkvvxOa/hM9wEF97x+BYFDomqu27GvAHK8RIOziEgUCVkmz3tOXg/61t69o0AwPMa+C2 o0bWysIZui9tWE7wnkOmdR44ucjfEVKRJSh1Vjd5EjavwbFt0eEciR9fpeLd3Uc1CDAs=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1hFLut-0005ZA-HU; Sat, 13 Apr 2019 18:54:11 +0200 Date: Sat, 13 Apr 2019 18:54:11 +0200 From: Andrew Lunn To: Vladimir Oltean Cc: f.fainelli@gmail.com, vivien.didelot@gmail.com, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, georg.waibel@sensor-technik.de Subject: Re: [PATCH v3 net-next 21/24] net: dsa: sja1105: Prevent PHY jabbering during switch reset Message-ID: <20190413165411.GK17901@lunn.ch> References: <20190413012822.30931-1-olteanv@gmail.com> <20190413012822.30931-22-olteanv@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190413012822.30931-22-olteanv@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 13, 2019 at 04:28:19AM +0300, Vladimir Oltean wrote: > Resetting the switch at runtime is currently done while changing the > vlan_filtering setting (due to the required TPID change). > > But reset is asynchronous with packet egress, and the switch core will > not wait for egress to finish before carrying on with the reset > operation. > > As a result, a connected PHY such as the BCM5464 would see an > unterminated Ethernet frame and start to jabber (repeat the last seen > Ethernet symbols - jabber is by definition an oversized Ethernet frame > with bad FCS). This behavior is strange in itself, but it also causes > the MACs of some link partners (such as the FRDM-LS1012A) to completely > lock up. > > So as a remedy for this situation, when switch reset is required, simply > inhibit Tx on all ports, and wait for the necessary time for the > eventual one frame left in the egress queue (not even the Tx inhibit > command is instantaneous) to be flushed. > > Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn Andrew