Received: by 2002:a19:771d:0:0:0:0:0 with SMTP id s29csp1247976lfc; Wed, 1 Jun 2022 13:01:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwworxmJFG2cYEESj15Y/quqxNtzRL9GsMeHScxUNhwtXTukTzN+rW1idc2RuR5Qzt82RMy X-Received: by 2002:a63:4387:0:b0:3c6:9490:4e4b with SMTP id q129-20020a634387000000b003c694904e4bmr907187pga.438.1654113710343; Wed, 01 Jun 2022 13:01:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654113710; cv=none; d=google.com; s=arc-20160816; b=K2L1CxT0ECZMfJHvHN1iiIXk7hZpQ6VTB03RjbYZ43DYxbBgsoI6m3sfIOMNt/xSHm qK46EuxdLhAh76nrKyFP5KdBv/xCidQBmvUkSeFkX/SvUUIjV1DF/6Sd9kD4F7k+3FkQ TyM44dFYCHKoucGiEr79S+fnZRWUXOd9W6hC3hpYNEMMTo9I3gza/tIllSbLaOXggrtd ihU+953b/FEDwnNPSxnbfNoRpvXJBvrN5iQRtNZY6dFkM4XBr1cFQuHP3ba9+Ga/nCZG xoRYCEaeMi1jDuLc2I5REcG1AaPZaRpIbiTIvFjDLErhuKiW8+PYoPP4GuCnKx0x4fKx Nikw== 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=X2lnrRO9o6cSNn26M09xwDW9Isoaa0xelVPjfV/VnZA=; b=WhWXUQLgGuGNreZnvqDRV5LjaIrAV3ELw6xd1xHxUNjTN9iDJyo8ON+v4yYx4Pe4vk KhosdeHCsZJTct1mq01NqPxBfm3y3DlKjnQOh+YOEzJ97t8JOe/ZOSOC6bJjwsZyrwDa qNC4MgDaNmM76QxQlo6VpP8VgLKJ1LH8sj20ivzKKfWBeFrfWKlGaOR72Q4KVI8p2kfW gB5WhwEnDiUvKoQ9/xqqwJjI6C7bFw3RUhM65ykFTyzZ7qlL9nkYM0Pm7DrYqGYdR35r ZyPSYVrtyCzuPoRfkT664aXl3pXoSz1xcsjWOpi8YAWWDt42EBE/CaIwB8IRHGDqsNzu dBAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=rT9etXCA; 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 bm18-20020a656e92000000b003fcd3d1b031si482653pgb.562.2022.06.01.13.01.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 13:01:50 -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=rT9etXCA; 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 C48BD219110; Wed, 1 Jun 2022 12:19:50 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349833AbiFAGKT (ORCPT + 99 others); Wed, 1 Jun 2022 02:10:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349824AbiFAGKR (ORCPT ); Wed, 1 Jun 2022 02:10:17 -0400 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35B2350E01; Tue, 31 May 2022 23:10:16 -0700 (PDT) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 2516A4ZQ079034; Wed, 1 Jun 2022 01:10:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1654063805; bh=X2lnrRO9o6cSNn26M09xwDW9Isoaa0xelVPjfV/VnZA=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=rT9etXCAKTQnrKzlByExPMYtPVYd2Q1iPJcEAr3fqahSG6tr3MlLf/rU5OqTvkHg9 ezvLEXzarCdjv9+j3Zv+ONTYUSZ71Hm+Pe+ztxITiInIMzbtmgBmujllJYYnsTKqnX HhN/2Vz2G/OhubSeVDVrhqXq/fRXoP3J3U2CO114= Received: from DFLE102.ent.ti.com (dfle102.ent.ti.com [10.64.6.23]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 2516A48h022179 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 1 Jun 2022 01:10:04 -0500 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE102.ent.ti.com (10.64.6.23) 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 01:10:04 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE106.ent.ti.com (10.64.6.27) 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 01:10:04 -0500 Received: from [172.24.222.108] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 25169w8b130862; Wed, 1 Jun 2022 01:09:59 -0500 Message-ID: <9f531f8d-9ff2-2ec9-504f-eed324ba86c6@ti.com> Date: Wed, 1 Jun 2022 11:39:57 +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> 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 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. Thanks, Siddharth.