Received: by 2002:a19:771d:0:0:0:0:0 with SMTP id s29csp1281916lfc; Wed, 1 Jun 2022 14:07:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmUaLIEO3UR5VCNa68uZbWltqAhDYRk/tz778gRlu6tzxgSEOAKa5HW774dZoIrr0fq8DL X-Received: by 2002:a17:902:7fc2:b0:153:3c90:17b9 with SMTP id t2-20020a1709027fc200b001533c9017b9mr1312155plb.61.1654117634492; Wed, 01 Jun 2022 14:07:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654117634; cv=none; d=google.com; s=arc-20160816; b=uiOxQeoJo5akgvBWDrdqd3UWhhw/DTkUZxMQ0zcsXEWVLGQpMGn2Fzml6qqGGCiwUb zaF9ZuuC5mHAjqv0j5L5TiDGr9lvjxQNMNq9pMBUTKA4UFFn+R8ZUh64+c7nXJm7pgFh p5WRu5bOj9W2+kcyRRK+4/C0Kb8BqXIEmbb2RVZD/Wrt5tp12Q2+w1t8Bkp5HJCYJ5PX nzKdhgYeMFcXSyRE+ot5x0RdWALAhNnbuOLZzs5rUvKMTzHzy0TTpAjEq9Hs51+xDXQw QbTv1+TjqZPybHKCb/OO3+JMilY7h1W43y0d3cfymAQoA6HM9Iv0n+OFOHrhe2Z7iATy JPwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=tNWTiL26yip0+8RRcm3Q4HITepb/6ZBenFxH0bJw1ro=; b=eOP4J19mfR0SlbIp7M7qrhOSSWOIBFBwhKylQwToHbtGFbsaZ9XVPNpNMXXz2+W5mp 2sCQws1UpCUkF5IgByVXpCwXkdfgF6xKZHHv8i/pEIhrBxGYasrwchTOoK0iiFoOq4O5 prvWCrxNRmZTQhC8DJMX/6JUz1/zESdtYNg0YQ+7xIO1uueWp/ilDIY0UoGthTyOBLEj Ge52maeNiX2e+EksB+rEJ9Qx17TD5JB5AtGzT9U2t7C9FhOCvtpQuv+RkSsI/fpxhrwe Xn7/cfedfsXhYplyLW//mMnmSzNNTYkusW2CaNmI/sESo++XvMssRrKkhsbFNfVqKju0 NbCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Trot8imI; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id x11-20020a170902ec8b00b0016390f2f284si2911805plg.167.2022.06.01.14.07.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 14:07:14 -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=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Trot8imI; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4956A2D054D; Wed, 1 Jun 2022 13:16:59 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350899AbiFAJaR (ORCPT + 99 others); Wed, 1 Jun 2022 05:30:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350618AbiFAJaM (ORCPT ); Wed, 1 Jun 2022 05:30:12 -0400 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A972606D0; Wed, 1 Jun 2022 02:30:11 -0700 (PDT) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 2519Ts7j041056; Wed, 1 Jun 2022 04:29:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1654075794; bh=tNWTiL26yip0+8RRcm3Q4HITepb/6ZBenFxH0bJw1ro=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=Trot8imIKW2KUEAF31573pI1l80b/EVxxLUVds5Zu4mWnWEM7XtSOGnsln4U0Z5xU Fzp4hCjTXOy4Pv1XL1ba72iZ8Xj8rgsnTRNzoZ+l2k2ghyb8ZoVBYqnHEbKeoxe6Sc Hf4ee01r9VHpMqmJoPNBxUTEmz7j2qRWScgMOBnU= Received: from DFLE109.ent.ti.com (dfle109.ent.ti.com [10.64.6.30]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 2519TsZL014057 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 1 Jun 2022 04:29:54 -0500 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Wed, 1 Jun 2022 04:29:53 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Wed, 1 Jun 2022 04:29:53 -0500 Received: from [172.24.222.108] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 2519TliG022357; Wed, 1 Jun 2022 04:29:48 -0500 Message-ID: <41277985-28c9-9bf0-8b24-6acc40391ef2@ti.com> Date: Wed, 1 Jun 2022 14:59:47 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH 3/3] net: ethernet: ti: am65-cpsw: Move phy_set_mode_ext() to correct location Content-Language: en-US To: "Russell King (Oracle)" CC: , , , , , , , , , , , , , References: <20220531113058.23708-1-s-vadapalli@ti.com> <20220531113058.23708-4-s-vadapalli@ti.com> <9f531f8d-9ff2-2ec9-504f-eed324ba86c6@ti.com> From: Siddharth Vadapalli In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Hello Russell, On 01/06/22 13:59, Russell King (Oracle) wrote: > 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 CPSW5G MAC supports both RGMII and QSGMII modes, so wouldn't it be correct to mark both RGMII and QSGMII modes as supported? The mode is specified in the device-tree and configured in CPSW5G MAC accordingly. > "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. Yes, if the QSGMII main interface were to be switched to RGMII mode, then it would break the other ports. However, the am65-cpsw driver currently has no provision to dynamically change the port modes once the driver is initialized. Thanks, Siddharth.