Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4431044rwd; Sun, 4 Jun 2023 05:21:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6jAox0L6FAfkQ1q24xK5cnCi5KaWud9Dcz6O0U80oqbKnly0KRIQVKdn6S5DjXIC7rYWFb X-Received: by 2002:a05:6a20:4308:b0:111:d03c:2bf9 with SMTP id h8-20020a056a20430800b00111d03c2bf9mr1301736pzk.12.1685881316968; Sun, 04 Jun 2023 05:21:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685881316; cv=none; d=google.com; s=arc-20160816; b=ozuGbU4xWguMktmXjpSBD+9rUqT5ahYSuYV3grmMUoJxBztRgUiaaduRt610FNE1Am GO7NkFMQk3vGErn5Y2i+NCUx61PDeXOS3v9Zhlyn/BQWvmufL2fC5iyA8GdcfazcAvd9 JoC8kP6AbiP5/bYazeqRg+gp7BLwqWdg/dvl8Hp1LDeTp/cRn+If+r2JzsKCCbzXVc1s Cz8a65Gc6JOjvMIbE5CNpSPGP3mcoBhx13CP0jjxGF64Ul9JuBjIcaPFeWWhkpIrf72R vjOKoAT/TEKuo6LT+7nreWVV2Ypw4T9XXgf0mvZDTEV+bubWfnhG/Rx2JlN8WHOXFkYt 9riw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=M7DP37lPI2Y7kMT7BCaNIjykdXMNnaQCjot38IYbWV0=; b=GQ3FwF0uV6uaOidzia0g3TOEVuhkPe6L3z3RySo9V9nSotNjPwZvp2LOq6FcjmA8Cc HFhvlrQ6GNSclDhyeZmP/R/UTQE47bXo8eJHDbORHTOV/w/WxPHrmXHU3aSUh9gSu6/P 6ko70K9Ywq+061Es0Zx211MbrlBcJBnCXvYRh81+Tf3UtbV3vaFyXoANdNK3L63uOX0U 22afpDdDlRFo8FJ7OaxtBsVJDFKVjWqjk1c6m522K2WosP3iw6MDKE7hrtNf8MdCDh87 OBpMzNJQbo/sAWKzH2Nn2fJ57woJ9l14MNORiuH1r1MSMDVEcjcur+dU6hvhY4gpW/55 FvEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=bZgNEeZQ; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e12-20020a65688c000000b0053efd751392si4109322pgt.827.2023.06.04.05.21.43; Sun, 04 Jun 2023 05:21: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=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=bZgNEeZQ; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229799AbjFDMSj (ORCPT + 99 others); Sun, 4 Jun 2023 08:18:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229588AbjFDMSi (ORCPT ); Sun, 4 Jun 2023 08:18:38 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30F0DB5; Sun, 4 Jun 2023 05:18:37 -0700 (PDT) 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=M7DP37lPI2Y7kMT7BCaNIjykdXMNnaQCjot38IYbWV0=; b=bZgNEeZQDkY8VlU4xEniQTA4j2 /3dHH505sQJsoKvU9fx6ahMqNO7057sFg08gAhbLCezxVc6KReswaAQXSFVM1XlxEPyyEXveUkKQo 3mP3D+1dkAVrssu/6sQxGwzHsgFz/rZWZ8WtsQLG12JzKhxor5H+Ooi/xl/XuG6/lV4MRibLUZQjT kVjhn3RlbPTt6JM9p1UMhopTsdkOHcCoIQp3g3d8eD5hcsJQ/i7AvBUhLTcI9TBTTPoPtDag6MH5n LtgkkGZeyAa+fyLvcmtxTpejH4jSIZm980ktJBOTAmsuIiebuoAkSaj23M+MWdy3yilGWB1iY2We5 tajiqKyw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:36806) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q5mgX-0002Yy-1w; Sun, 04 Jun 2023 13:18:13 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1q5mgO-000533-KN; Sun, 04 Jun 2023 13:18:04 +0100 Date: Sun, 4 Jun 2023 13:18:04 +0100 From: "Russell King (Oracle)" To: =?utf-8?B?QXLEsW7DpyDDnE5BTA==?= Cc: Vladimir Oltean , Sean Wang , Landen Chao , DENG Qingfang , Daniel Golle , Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Richard van Schagen , Richard van Schagen , Frank Wunderlich , Bartel Eerdekens , erkin.bozoglu@xeront.com, mithat.guner@xeront.com, 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 08/30] net: dsa: mt7530: change p{5,6}_interface to p{5,6}_configured Message-ID: References: <20230522121532.86610-1-arinc.unal@arinc9.com> <20230522121532.86610-1-arinc.unal@arinc9.com> <20230522121532.86610-9-arinc.unal@arinc9.com> <20230522121532.86610-9-arinc.unal@arinc9.com> <20230524175107.hwzygo7p4l4rvawj@skbuf> <576f92b0-1900-f6ff-e92d-4b82e3436ea1@arinc9.com> <20230526130145.7wg75yoe6ut4na7g@skbuf> <7117531f-a9f2-63eb-f69d-23267e5745d0@arinc9.com> <826fd2fc-fbf8-dab7-9c90-b726d15e2983@arinc9.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <826fd2fc-fbf8-dab7-9c90-b726d15e2983@arinc9.com> Sender: Russell King (Oracle) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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 On Sun, Jun 04, 2023 at 01:46:46PM +0300, Arınç ÜNAL wrote: > On 3.06.2023 15:26, Russell King (Oracle) wrote: > > Given that, you should have no need to make explicit calls to your > > mac_config, pcs_link_up and mac_link_up functions. If you need to > > make these calls, it suggests that phylink is not being used for the > > CPU port. > > Your own commit does this so I don't know what to tell you. > > https://github.com/torvalds/linux/commit/cbd1f243bc41056c76fcfc5f3380cfac1f00d37b I would like to make a comment here to explain why in that commit I added a call into mt7531_cpu_port_config() to mt7531_cpu_port_config(). When I'm making changes to drivers, then I follow a golden rule: do not change the behaviour unless it is an intentional change. This is exactly what is going on in this commit. mt7531_cpu_port_config() called mt753x_phylink_mac_link_up(), which then, as the very first thing, called mt753x_mac_pcs_link_up(). mt753x_mac_pcs_link_up() called priv->info->mac_pcs_link_up() if it is defined. Since converting to phylink_pcs involves the removal of the direct call from mt753x_phylink_mac_link_up() to the priv->info->mac_pcs_link_up() method, in order to preserve the behaviour of the driver, it is necessary to ensure that mt7531_cpu_port_config() still makes that call. mt753x_phylink_pcs_link_up() is the new function replacing mt753x_mac_pcs_link_up() which makes that call, so it is entirely appropriate to add that call into mt7531_cpu_port_config() so that mt7531_cpu_port_config() behaves _precisely_ the same as it did before and after this change. In that sense, as far as mt7531_cpu_port_config() is concerned, this change is entirely idempotent. I don't know whether mt7531_cpu_port_config() is necessary to properly bring up a CPU port, or whether _all_ firmware descriptions for mt7531 include all the necessary properties so that DSA will always bring up a phylink instance for the CPU port - that really is not relevant for the change you point out. What is relevant is only making the intended change, and the intended change is to split the PCS-specific code from the MAC-specific code. This principle of only making one change in a patch, and ensuring that parts of the code which merely need to be re-organised to achieve that change are done in an idempotent way is fundamental to good code maintenance, especially when modifying drivers that one does not have the hardware to be able to test. You have provided new information - that basically indicates that phylink is used for your setup. If we can get to a position where we can confidently say that phylink will always be used for the CPU port, the code in mt7531_cpu_port_config() that bypasses phylink, calling methods in phylink's mac_ops and pcs_ops, should be removed. I don't remember whether Vladimir's firmware validator will fail for mt753x if CPU ports are not fully described, but that would be well worth checking. If it does, then we can be confident that phylink will always be used, and those bypassing calls should not be necessary. I hope this explains the situation better. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!