Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp784129rdb; Fri, 2 Feb 2024 04:08:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IH+5tsbdEWbpq6xH6ElVLxamFWIMDQAa/ta/C07DkifSxH58avnU1kY4tGYeQaNz1j/ZWvA X-Received: by 2002:a05:6a00:14d2:b0:6dd:8853:ada8 with SMTP id w18-20020a056a0014d200b006dd8853ada8mr11129399pfu.26.1706875735640; Fri, 02 Feb 2024 04:08:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706875735; cv=pass; d=google.com; s=arc-20160816; b=DuB6hZ7Ak6u9MtKzjrbliyYptHD7xd6PmqX3oWcRy2accATC8p4VoBAl2a6ZpXj1+A qenW7sGFVu56I5acuHrpyxLcW3Lnk0ius6rreR4zPFnPRue3wP88awEAcJFZ4KJuL+oS RLsATEAVLaHwEniow2GXN1fSyCVqSmjcV0zK/EamKt7tblyV+Xqs8lsrzj/4APP+qgHs XE5IcknnU/3+IbSnIEK4WyEvTZ52hVPbPJeGLmE3FLG78jUoIqgTRxihAwAcam+RbPES ns5KA9aLTuK/Xy//Swk48xuoOo4oRHNcANuaJk4XO20Y+iTQndJnHfCFbNwFjxfvhmnF gboA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=UslJPsc9OxqAKRDemcvqM9t/waIR2GXs7pcOUZ0/ORQ=; fh=dEZC/cEjxUOLvUlcbjwM+PJI/pRPeuBvY+rIvO7Wiyw=; b=WwrcPHyWBSva7/Un9IAF+39vmDeiwE/3QeUBIIo3aUZJ+JZB2XnN2WC8/idUDQ7AJ2 HuWgZAEz6sL3mdJFnWofsq0ZCUV580PN96EJf2/UCnRpjSJChcc5mrt04vxzMxCqMHTQ HYjrnNqORx69UFlmX82bULXHzzXuoL1uJ4wNxHSprMb9kau/PVwfGhHwDBGy2U7KnLVy vixPKYnhHSqxk3hknpar5P7il7s0cZ4zWBzcdbKfZGHfTIW9h3Og9p9554GRr29roeb9 REXopPF+xR8UBOKxyE8iH4Mt69H4ZGFFaJ3KkPXXMAO94/HENYVIL9iUvRLlsMviHLUw JaLQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=jGp8goMJ; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-49780-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49780-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk X-Forwarded-Encrypted: i=1; AJvYcCU7Ky6GP10sA9dfB0uz8fBSRDUJ9YQMfgCQbFaIh5mm0EvSn+zlm1fZ9jiXubAnjriBUI8HvTAR1I3ROUdyocnG/CHTUmkeZ9kTFK7x9w== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id r70-20020a632b49000000b005bdff97f97bsi1507362pgr.92.2024.02.02.04.08.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 04:08:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49780-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=jGp8goMJ; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-49780-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49780-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id AEAB7B2959D for ; Fri, 2 Feb 2024 11:44:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 00695140791; Fri, 2 Feb 2024 11:40:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="jGp8goMJ" Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 694A01468FA; Fri, 2 Feb 2024 11:40:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706874045; cv=none; b=FBtODa/GTKOMqOdfT6UBWKOxDBcOWyOJDNBZ/tIpXnSEibdSTRak6+Q2ThWmcUGwCmlhskBQ5nw3xlSIM2phAacNsc6bLRrqSg5A+evFSgaqYNm2dAt6oBsOsD3RuCRBzxRrfTedymVU5JdmaNuGOoLHMbbrLhMs5pkYQ//3AYs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706874045; c=relaxed/simple; bh=THNcitwNvcPDGnnPmti91/QSPozPaK3v1G+mw5I964g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=O2H5RJ1SjgrqfcY2vp0Nf0Fh5YUNsQqVAqQRXUD2c2flezWtZvJqkX6vgivTJ4ch7ttEVxzQyKuctYplo+cjCfDQJDhWCBHXGfVYazC8B540OUNRH0mEgjfBcd7sgaadX79lqjvq6xs5uw2eeGEgnD+cuLIEsQBkoapN6HKnUZc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=jGp8goMJ; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To: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=UslJPsc9OxqAKRDemcvqM9t/waIR2GXs7pcOUZ0/ORQ=; b=jGp8goMJO/MxQ0XCJBfcTUrVlZ xZigOzTQl82Q8t4B92czFeAdsOazhcWc0byV/RMFxvtxNPdRsd3Pd/98g/123aQIqSzg4BJd0zKA7 6b9U2pyFIZBoaXbM0oZtq2p/jhjv81jjqAZsffVCIDl4f+Sy9SaVHMznBIgycpw28JXHyheJskcv2 qTf7ClI1YPceYNXMX9UidY/M0X7H0n314C0JuZeE3P17Q47bP5/hXk2TB+Gw/GeVKdjTU3PhlOX1x E8Ttl6pFzqH+aFIBCh8R+VXlHO6FuMM7EuhKoVzYtIGVkrGrjIm3aPaWBTEwf2ZDGCO6265lnP52l 6Qlaix/Q==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:46710) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rVruE-0005tL-1l; Fri, 02 Feb 2024 11:40:26 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rVru6-0008Hm-Un; Fri, 02 Feb 2024 11:40:18 +0000 Date: Fri, 2 Feb 2024 11:40:18 +0000 From: "Russell King (Oracle)" To: arinc.unal@arinc9.com Cc: Daniel Golle , DENG Qingfang , Sean Wang , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, Bartel Eerdekens , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH net-next v3 1/7] net: dsa: mt7530: empty default case on mt7530_setup_port5() Message-ID: References: <20240202-for-netnext-mt7530-improvements-2-v3-0-63d5adae99ca@arinc9.com> <20240202-for-netnext-mt7530-improvements-2-v3-1-63d5adae99ca@arinc9.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240202-for-netnext-mt7530-improvements-2-v3-1-63d5adae99ca@arinc9.com> Sender: Russell King (Oracle) On Fri, Feb 02, 2024 at 12:19:07PM +0300, Arınç ÜNAL via B4 Relay wrote: > From: Arınç ÜNAL > > There're two code paths for setting up port 5: > > mt7530_setup() > -> mt7530_setup_port5() > > mt753x_phylink_mac_config() > -> mt753x_mac_config() > -> mt7530_mac_config() > -> mt7530_setup_port5() > > On the first code path, priv->p5_intf_sel is either set to > P5_INTF_SEL_PHY_P0 or P5_INTF_SEL_PHY_P4 when mt7530_setup_port5() is run. > > On the second code path, priv->p5_intf_sel is set to P5_INTF_SEL_GMAC5 when > mt7530_setup_port5() is run. > > Empty the default case which will never run but is needed nonetheless to > handle all the remaining enumeration values. > > Signed-off-by: Arınç ÜNAL > Reviewed-by: Vladimir Oltean Reviewed-by: Russell King (Oracle) Thanks! While reviewing this change, but not related to it, I notice that this function sets the TX delay based on the RGMII interface mode. This isn't correct. I've explained why this is this many times in the past, but essentially it comes down to the model: phy-mode in NIC node Network driver PCB PHY rgmii no delays delays no delays rgmii-id no delays no delays tx/rx delays rgmii-txid no delays no delays tx delays rgmii-rxid no delays no delays rx delays Then we have rx-internal-delay-ps and tx-internal-delay-ps in the NIC node which define the RGMII delays at the local end and similar properties for the PHY node. So, if we take the view that, when a switch is connected to a NIC in RGMII mode, then the phy-mode specified delays still should not impact the local NIC. Now, for the switch, we specify the phy-mode in the port node as well. Consider the case of a switch port connected to a RGMII PHY. This has to operate in exactly the same way as a normal NIC - that is, the RGMII delays at the port should be ignored as it's the responsibility of a PHY. The final scenario to examine is the case of a RGMII switch port connected to a NIC. The NIC's phy-mode has no way to be communicated to DSA or vice versa, so neither phy-mode can impact the other side of the RGMII link, but should only place the link into RGMII mode. Given everything I've said above, the only way to configure RGMII delays is via the rx-internal-delay-ps and tx-internal-delay-ps properties. So, DSA drivers should _not_ be configuring their ports with RGMII delays based on the RGMII phy interface mode. The above is my purely logically reasoned point of view on this subject. Others may have other (to me completely illogical) interpretations that can only lead to interoperability issues. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!