Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp851511iog; Fri, 17 Jun 2022 15:30:09 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vO8YimwPwwwYEH2WThhQk9NpsjP0O3vd7dKnt6mWAEMkiA83/BhQK8elMA7hSD7yaa5u3G X-Received: by 2002:a05:6402:4255:b0:431:34c3:6018 with SMTP id g21-20020a056402425500b0043134c36018mr15027872edb.146.1655505009206; Fri, 17 Jun 2022 15:30:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655505009; cv=none; d=google.com; s=arc-20160816; b=hJpCHxl9xB9q704NV6fmODg/tlJAQW9GHxjpv7hlynvzoTFRpm85tEmaBoaicGKynm 2P1FGi1PI85V27tdLOd3q/U38A27xBEb+DYGXnliMHzd2wGAPz9WYjoMvVKUedRVNA71 GOKJJee45WIm9eX2fK4wqbuZ/qxS+29EPnE4q7MPgAhjPDBHZv0Sh/r8fnCicS8D5zfr XFNy+N1lBsWiqE2pek5psR1N1TLd+du3ES85jrNS1z6jrw/EfIfjlcBQXTCEoCXj2pTW hCBKZM+kZnYsSSP5NSWk9KYt1Y5yJvIK2uumkcchAr7UqAvsIx6AMEVWknNP2gZGwkV+ 5jZQ== 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=+N2H+x44Iv08WsRXm2it/nhRDV8pHzv6Cqk9ZurKm5k=; b=Ht1ZJfjEHyVXyk5eAp2wH0BeXkOY+2GmNpDN7raZk+L3jcmavr5gkEI5pXb2CVQcsL c0pfYS9ThPqrNl8A1Vn5ntVZnXMMWP4NFceNdAB3GfxxuTMYtg9KL5FzkDx1/+ffgKxf JgjKpkBcF4vvPPph/V2ap2FJpiO3/Wucga2bUN6ODoLLoU57lyrXOhzX401Cq24XVsQx pN8k6TYzvwrUU5vZrZ/jKX+CYAR6s6QMb7u7YE1PKl7KDrfuRbvMyJmDj6LGU2nV9LwI Gl7Mck3XMz8FQ6n+spRKsTTPM/dzd7lcChpMz02D5P3yn/87Mip8hDXh7wHxLtxBMcPo vpjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=X2qZ8Kde; 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 oz17-20020a1709077d9100b0070777336121si6501365ejc.446.2022.06.17.15.29.44; Fri, 17 Jun 2022 15:30:09 -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=X2qZ8Kde; 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 S237117AbiFQWBw (ORCPT + 99 others); Fri, 17 Jun 2022 18:01:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235560AbiFQWBu (ORCPT ); Fri, 17 Jun 2022 18:01:50 -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 900125D1A4; Fri, 17 Jun 2022 15:01:47 -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=+N2H+x44Iv08WsRXm2it/nhRDV8pHzv6Cqk9ZurKm5k=; b=X2qZ8Kde29X9DMRY4lTIZ/k3NS 7krTSzi2HiIlRyudWk10Um2yZAkDxYoutdORY4W7lG9yTNwZ4c9RE5/nRES0AQPNWNMh1lOXL2sZq sFf8B5UOm4QQoYfsVg+qpKOJAqC+8M2CGHZ80E1zuGirpOm74jKERmPhDIUNgGZ96w6hAzej3/rjQ bu6sXtU8AIuxbT6BvaR8grdRWPf7mtDB7MQlH2XzD1XffIUrN3pss0BnRscM7xvo31OU/9bXuUGCp r6m6kbbZyG4FhwEjlszkU3ydaJHnII45fQ84SohWkixNIavNqrUJvJMLJ2fsjTMftb/JLHN0y05yJ QsthPtag==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:32904) 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 1o2K27-0003OY-MH; Fri, 17 Jun 2022 23:01:39 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1o2K25-0002HX-13; Fri, 17 Jun 2022 23:01:37 +0100 Date: Fri, 17 Jun 2022 23:01:36 +0100 From: "Russell King (Oracle)" To: Sean Anderson Cc: "David S . Miller" , Jakub Kicinski , Madalin Bucur , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Paolo Abeni , Eric Dumazet Subject: Re: [PATCH net-next 25/28] [RFC] net: dpaa: Convert to phylink Message-ID: References: <20220617203312.3799646-1-sean.anderson@seco.com> <20220617203312.3799646-26-sean.anderson@seco.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220617203312.3799646-26-sean.anderson@seco.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,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 Hi, On Fri, Jun 17, 2022 at 04:33:09PM -0400, Sean Anderson wrote: > This converts DPAA to phylink. For the moment, only MEMAC is converted. > This should work with no device tree modifications (including those made in > this series), except for QSGMII (as noted previously). > > One area where I wasn't sure how to do things was regarding when to call > phy_init and phy_power_on. Should that happen when selecting the PCS? Is this a common serdes PHY that is shared amongst the various PCS? I think from what I understand having read the other patches, it is. In which case, initialising the PHY prior to calling phylink_start() and powering down the PHY after phylink_stop() should be sufficient. > Similarly, I wasn't sure where to reconfigure the thresholds in > dpaa_eth_cgr_init. Should happen in link_up? If so, I think we will need > some kind of callback. Bear in mind that with 1000BASE-X, SGMII, etc, we need the link working in order for the link to come up, so if the serdes PHY hasn't been properly configured for the interface mode, then the link may not come up. How granular are these threshold configurations? Do they depend on speed? (Note that SGMII operates at a constant speed irrespective of the data rate due to symbol replication, so there shouldn't be a speed component beyond that described by the interface mode, aka phy_interface_t.) > This has been tested on an LS1046ARDB. Without the serdes enabled, > everything works. With the serdes enabled, everything works but eth3 (aka > MAC6). On that interface, SGMII never completes AN for whatever reason. I > haven't tested the counterfactual (serdes enabled but no phylink). With > managed=phy (e.g. unspecified), I was unable to get the interfaces to come > up at all. I'm not sure of the level of accurate detail in the above statement, so the following is just to cover all bases... It's worth enabling debug in phylink so you can see what's going on - for example, whether the "MAC" (actually PCS today) is reporting that the link came up (via its pcs_get_state() callback.) Also whether phylib is reporting that the PHY is saying that the link is up. That should allow you to identify which part of the system is not Having looked through your phylink implementation, nothing obviously wrong stands out horribly in terms of how you're using it. The only issue I've noticed is in dpaa_ioctl(), where you only forward one ioctl command to phylink, whereas there are actually three ioctls for PHY access - SIOCGMIIPHY, SIOCGMIIREG and SIOCSMIIREG. Note that phylink (and phylib) return -EOPNOTSUPP if the ioctl is not appropriate for them to handle. However, note that phylib will handle SIOCSHWTSTAMP. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!