Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2353286rdb; Thu, 21 Sep 2023 16:42:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG0KGghoIgmpTbGU88xACVWyOFNRZF0sW/Fq/ili2ZZFGxHjfGqmNQ9+1MNzalCbAMaueQX X-Received: by 2002:a17:902:ec85:b0:1bb:fcb9:f85 with SMTP id x5-20020a170902ec8500b001bbfcb90f85mr1932152plg.32.1695339739058; Thu, 21 Sep 2023 16:42:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695339739; cv=none; d=google.com; s=arc-20160816; b=lIEMODCLHoZ6F1nfitaXvNEZ5WplpMOmbcAVNiKqs/NyVWdMQl/oRStD/D/YbOtemz +Hq2BPj0d2bDgBOyTO8ZIXuyNnYm9wVuhEs7HM6jt0AgRtD9vBDifCz6KA7Lfx013OLx ihS9dEJA39lKyQCa146rsqWm9LuJkQRrz8fJjrwYLpBrrWrVfBFtGEv+vR2eyRZsQlEC trPDCrgcHQnrDEIAAALVEbepLzMJYQHLyztCBXDurNLk0HQsMr6Q+q9ZxZh8Kfae0Pp8 Mlv1PoiOxh0vC7QEw8KHvDsTPQCn0xogzKbKkDxtyNKqxS0sdPywGA5mZ9bPyXf4TOAI vZkw== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=CC2gkTGhITx2Tkn4hzBnyxcQlVD3H0K9p7hCx7iKc0I=; fh=w+D8iVnaB1dRZ4H+1dL+9WiAc/3C7QmlzaAiPBgwUss=; b=OItqNAo11/5FnHQRwS+cr5C3OdvHmRfD6F0yzG7+5o4IRgtFMsPWHw2m0n00c0eujY OvJa8t++tdjdENodeqdLaVsEdPHpq55TqdbSiMNigZTlaralgyh70C6fvrZiKVk4LuVs va4y15QfsFEXjUeAXTlFaEJlixi4sfDNTPMjxXgeZ8ipvSvYN1zPKG2XYsVU5e+FtAiW LbO4wgJ6Zra7O70y1PjppNFl2OX+RywvpXiVzbcVxz5EGjz6EXum41LbjigLdiYV3mTQ /JLbdt6dBz+ZPAJi7VpHB7XUULfyypVLk/7keRA96QnuavgpFvx23rTbxlY5W6fpBmZc H0Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b="RX/Dh/Jl"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id h6-20020a170902680600b001c4376ceadfsi2410547plk.615.2023.09.21.16.42.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 16:42:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b="RX/Dh/Jl"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id D984A81E14C3; Thu, 21 Sep 2023 12:27:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230113AbjIUT15 (ORCPT + 99 others); Thu, 21 Sep 2023 15:27:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230129AbjIUT1b (ORCPT ); Thu, 21 Sep 2023 15:27:31 -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 2C313A1505; Thu, 21 Sep 2023 10:57:20 -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-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: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=CC2gkTGhITx2Tkn4hzBnyxcQlVD3H0K9p7hCx7iKc0I=; b=RX/Dh/JlHN7+Dr2mKIx1OHw08j abawgMlrvxjDlsbIPFGzplofhq7VcEHhhGFZr5v8TUs2rmkpzNCwTdiU/ex1Izqw2rmGLteOf6T3b rafTyBkIl6Vl7p+9BVOfWbBV6ztXErezBRlJ0k1UNn9OTHkTcAr7tQi0CZZ2getl6yCEM4qAHxcUF 0KrBEHNL0Z7sRA9uEwAO55WvgagpdOLapZsmOUsOq3ojQ/D5eDQ9JBA++gwR1mHYPfVN/hpVeI3CF AADotTfqbGiEqrhzLlKFo3aGvIzijqZ5x69wIwORuvfZRHh61rlcTaxBdznV8HpM6ZdVxWJ73Kr2f hqa/s60A==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:56250) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qjJk4-0004de-0F; Thu, 21 Sep 2023 14:29:16 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qjJjc-0003ZN-MP; Thu, 21 Sep 2023 14:28:48 +0100 Date: Thu, 21 Sep 2023 14:28:48 +0100 From: "Russell King (Oracle)" To: Choong Yong Liang Cc: Rajneesh Bhardwaj , David E Box , Hans de Goede , Mark Gross , Jose Abreu , Andrew Lunn , Heiner Kallweit , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Marek =?iso-8859-1?Q?Beh=FAn?= , Jean Delvare , Guenter Roeck , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Richard Cochran , Philipp Zabel , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Wong Vee Khee , Jon Hunter , Jesse Brandeburg , Revanth Kumar Uppala , Shenwei Wang , Andrey Konovalov , Jochen Henneberg , David E Box , Andrew Halaney , Simon Horman , Bartosz Golaszewski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, linux-hwmon@vger.kernel.org, bpf@vger.kernel.org, Voon Wei Feng , Tan Tee Min , Michael Sit Wei Hong , Lai Peter Jun Ann Subject: Re: [PATCH net-next v3 4/5] net: stmmac: enable Intel mGbE 1G/2.5G auto-negotiation support Message-ID: References: <20230921121946.3025771-1-yong.liang.choong@linux.intel.com> <20230921121946.3025771-5-yong.liang.choong@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230921121946.3025771-5-yong.liang.choong@linux.intel.com> Sender: Russell King (Oracle) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 21 Sep 2023 12:27:55 -0700 (PDT) On Thu, Sep 21, 2023 at 08:19:45PM +0800, Choong Yong Liang wrote: > +#if IS_ENABLED(CONFIG_INTEL_PMC_IPC) There shouldn't be any need to make this conditional. > +static int stmmac_mac_prepare(struct phylink_config *config, unsigned int mode, > + phy_interface_t interface) > +{ > + struct net_device *ndev = to_net_dev(config->dev); > + struct stmmac_priv *priv = netdev_priv(ndev); > + int ret = 0; > + > + priv->plat->phy_interface = interface; > + > + if (priv->plat->config_serdes) > + ret = priv->plat->config_serdes(ndev, priv->plat->bsp_priv); Please call this "phylink_mac_prepare" and pass the parameters that phylink passes you to this function, so we don't end up at a later date with people needing to extend this function to do other stuff, thus repeating mistakes from earlier. This is what has led to some very yucky code in all those "fix_mac_speed" implementations, with duplicated data in the BSPs to get the PHY mode and store it separately, etc. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!