Received: by 2002:a19:771d:0:0:0:0:0 with SMTP id s29csp1283227lfc; Wed, 1 Jun 2022 14:10:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKn1Hf9I+wlIiPR0O6TrGOxZwByhr4KM94Cah6FLDjk/xGCcH1X6l4LuT9REtSkaVimzh+ X-Received: by 2002:a17:90a:ab8d:b0:1e0:a082:b2c7 with SMTP id n13-20020a17090aab8d00b001e0a082b2c7mr1334301pjq.17.1654117805094; Wed, 01 Jun 2022 14:10:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654117805; cv=none; d=google.com; s=arc-20160816; b=QvL0kTOtaCtGXbiF/8TVy29XLFvJE0HbVp2nYR880lphsy/c3yhOn/b/CZATTt+MHr wnyP8Z2Ef2YR7JhqiIApEcKoeHSdkNX0L5dL81176UHmgo8xCq6BNz1uf6zIa/mLksJf 6dMSEvJSwxSnQqcyfNoiN2rjfIslwvYPaBi9MmBEm1qhmc3J4FCOjWyOKXXfWXXTs4LJ epWjpG77+ubQIRnZHytjWZCYw9uzKGAtDZcro2mwiFTsdW4gVgJAHexb24MGBg2IHRQI Rzy/xH5O11/R343kBOFFOZ8N4tFYH0iEmDOVSgg3L/QuF4Rl+2l8B8V9jtwQrMZvRAj1 UuFg== 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=hUcYa8u6coeEqMUwnvlLzfUj34eb1m5imtA8bKADKGY=; b=CyUYnABbudf0g0FqnuZFsjXeh9AT1hHQ7Bk5yqLwjiWNQkCWkGaosBWA0KNkTZOvEz fpGyj8oirSapZvPPMkMW18MASYl9L5Acoj7TLxmMt5CC4/0zIqIagHCLshMSSuW9icJx DXEa6HAF0CRpbSubsSMIkU1CbBPDsAFGwDm+SlAJAtw6wQN/b0tueyWgZiuuLNvp8PtN skqJ6N/5Tlq0KMVj06SwJJdHZMY5NAROcJxu5JLzy0LGRLoym3Gd9ZAQRJAlfaxlsSFs jcz6EDDYonwqQ+GDLPdHs5XVTkqaakSTr0ZFvawTbHxFjYzTJiG56aGUiBFbVwKeD7qH fxzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=CjtD9x0I; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id b3-20020a056a00114300b00517f45a36e3si3662238pfm.101.2022.06.01.14.10.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 14:10:05 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=CjtD9x0I; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9F74B219102; Wed, 1 Jun 2022 13:01:48 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350788AbiFAI3z (ORCPT + 99 others); Wed, 1 Jun 2022 04:29:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349252AbiFAI3q (ORCPT ); Wed, 1 Jun 2022 04:29:46 -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 A88C04B86B; Wed, 1 Jun 2022 01:29:43 -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=hUcYa8u6coeEqMUwnvlLzfUj34eb1m5imtA8bKADKGY=; b=CjtD9x0IC7BZ2I0RCGMwMpYUA1 UifYNmQLjK9EOCJGtNDfeqX0Zio+3tm4Zoq/mqT1yOWmBbxZXhhoj5WM41VJYJmMBHz2wMy6HHY6X X7nKiZC1RVRhxCitUovdQ32VLT9KUYnvQeGeD2C6fEDKjX0DjoKAIHWimZEWxX6atXV+JhqjCKsRi gvswIn0V1tTbExn4irwLbMPVZ6zxCRlTcFyNtdPHcRcZlRGywL3kP6Hnd7FLneZ+cqDwMDChYnU5w lzzQXex+lQ8+KdJSNa9fixC0q1n30XEY/YBjOD8cUn2Z6sZtlIKzvaSGzYCTAzOn0jINqSA9XN1NR lJVoA5Sw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:60916) 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 1nwJjP-0005ls-4h; Wed, 01 Jun 2022 09:29:31 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1nwJjM-0003Jb-FF; Wed, 01 Jun 2022 09:29:28 +0100 Date: Wed, 1 Jun 2022 09:29:28 +0100 From: "Russell King (Oracle)" To: Siddharth Vadapalli Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, vladimir.oltean@nxp.com, grygorii.strashko@ti.com, vigneshr@ti.com, nsekhar@ti.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kishon@ti.com Subject: Re: [PATCH 3/3] net: ethernet: ti: am65-cpsw: Move phy_set_mode_ext() to correct location Message-ID: References: <20220531113058.23708-1-s-vadapalli@ti.com> <20220531113058.23708-4-s-vadapalli@ti.com> <9f531f8d-9ff2-2ec9-504f-eed324ba86c6@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9f531f8d-9ff2-2ec9-504f-eed324ba86c6@ti.com> Sender: Russell King (Oracle) X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Wed, Jun 01, 2022 at 11:39:57AM +0530, Siddharth Vadapalli wrote: > Hello Russell, > > On 31/05/22 17:25, Russell King (Oracle) wrote: > > On Tue, May 31, 2022 at 05:00:58PM +0530, Siddharth Vadapalli wrote: > >> In TI's J7200 SoC CPSW5G ports, each of the 4 ports can be configured > >> as a QSGMII main or QSGMII-SUB port. This configuration is performed > >> by phy-gmii-sel driver on invoking the phy_set_mode_ext() function. > >> > >> It is necessary for the QSGMII main port to be configured before any of > >> the QSGMII-SUB interfaces are brought up. Currently, the QSGMII-SUB > >> interfaces come up before the QSGMII main port is configured. > >> > >> Fix this by moving the call to phy_set_mode_ext() from > >> am65_cpsw_nuss_ndo_slave_open() to am65_cpsw_nuss_init_slave_ports(), > >> thereby ensuring that the QSGMII main port is configured before any of > >> the QSGMII-SUB ports are brought up. > > > > This sounds like "if we're configured via port->slave.phy_if to be in > > QSGMII mode, then the serdes PHY needs to be configured before any of > > the QSGMII ports are used". Doesn't that mean that if > > port->slave.phy_if is QSGMII, then the port _only_ supports QSGMII > > mode, and conversely, the port doesn't support QSGMII unless firmware > > said it could be. > > > > So, doesn't that mean am65_cpsw_nuss_init_port_ndev() should indicate > > only QSGMII, or only the RGMII modes, but never both together? > > The phy-gmii-sel driver called by phy_set_mode_ext() configures the CPSW5G MAC > rather than the SerDes Phy. In the CPSW5G MAC, the QSGMII mode is further split > up as two modes that are TI SoC specific, namely QSGMII main and QSGMII-SUB. Of > the 4 ports present in CPSW5G (4 external ports), only one can be the main port > while the rest are the QSGMII-SUB ports. Only the QSGMII main interface is > responsible for auto-negotiation between the MAC and PHY. For this reason, the > writes to the CPSW5G MAC, mentioning which of the interfaces is the QSGMII main > interface and which ones are the QSGMII-SUB interfaces has to be done before any > of the interfaces are brought up. Otherwise, it would result in a QSGMII-SUB > interface being brought up before the QSGMII main interface is determined, > resulting in the failure of auto-negotiation process, thereby making the > QSGMII-SUB interfaces non-functional. That confirms my suspicion - if an interface is in QSGMII mode, then RGMII should not be marked as a supported interface to phylink. If the "QSGMII main interface" were to be switched to RGMII mode, then this would break the other ports. So RGMII isn't supported if in QSGMII mode. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!