From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D067BECAAA1 for ; Thu, 15 Sep 2022 08:37:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230104AbiIOIhi (ORCPT ); Thu, 15 Sep 2022 04:37:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230113AbiIOIhb (ORCPT ); Thu, 15 Sep 2022 04:37:31 -0400 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37F0F97EDF; Thu, 15 Sep 2022 01:37:27 -0700 (PDT) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 28F8av5d020223; Thu, 15 Sep 2022 03:36:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1663231017; bh=2RSmklK1TVuVRmWe/70Gpjzew728xNGbXx1E3M+lpr8=; h=Date:CC:Subject:To:References:From:In-Reply-To; b=SpCm8zgKOL/xH+6QYS9hvm1VYeoEBIuy1znTpdRovLDu9xZs7LUrdNrXbob4fdXYE SdUQxG0OXJlbZv1B1gn/bGHjyRvvaGYY1+DzyQ2Vn3cSqQURh8qKVmGMg2iCz5i/Cn hxHb3a4gfERI7btHXOlSmaP7o+0CY2r4WUuFZELk= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 28F8avuA055725 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 15 Sep 2022 03:36:57 -0500 Received: from DFLE104.ent.ti.com (10.64.6.25) 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.2507.6; Thu, 15 Sep 2022 03:36:57 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Thu, 15 Sep 2022 03:36:57 -0500 Received: from [10.24.69.241] (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 28F8alx3095898; Thu, 15 Sep 2022 03:36:47 -0500 Message-ID: Date: Thu, 15 Sep 2022 14:06:46 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 CC: , , , , , , , , , , , , , , , , Subject: Re: [PATCH 2/8] net: ethernet: ti: am65-cpsw: Add support for SERDES configuration Content-Language: en-US To: "Russell King (Oracle)" References: <20220914095053.189851-1-s-vadapalli@ti.com> <20220914095053.189851-3-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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Russell, On 14/09/22 21:07, Russell King (Oracle) wrote: > On Wed, Sep 14, 2022 at 03:20:47PM +0530, Siddharth Vadapalli wrote: >> @@ -1427,6 +1471,9 @@ static void am65_cpsw_nuss_mac_link_down(struct phylink_config *config, unsigned >> struct net_device *ndev = port->ndev; >> int tmo; >> >> + /* disable phy */ >> + am65_cpsw_disable_phy(port->slave.ifphy); >> + > > This seems really strange. If you have a serdes interface which > presumably supports SGMII, 1000base-X etc, then link status is sent > across the serdes interface. If you power down the serdes, then you > can't receive the link status, and so mac_link_up() won't be called. > > Are you really sure you want to be enabling and disabling the PHY > in mac_link_down()/mac_link_up() ? Thank you for reviewing the patch. The PHY passed to the "am65_cpsw_disable_phy()" and "am65_cpsw_disable_phy()" functions within the "am65_cpsw_nuss_mac_link_down()" and "am65_cpsw_nuss_mac_link_up()" functions respectively, is the CPSW ethernet MAC's PHY and not the SERDES PHY. The SERDES PHY is powered on through the function call to the "am65_cpsw_init_phy()" function. The calls to the functions "am65_cpsw_enable_phy()" and "am65_cpsw_disable_phy()" within the "am65_cpsw_nuss_mac_link_up()" and "am65_cpsw_nuss_mac_link_down()" functions respectively, try to power on and power off the CPSW ethernet MAC's phy. Looking at it again,they do nothing, since the driver corresponding to the ethernet MAC's PHY which happens to be drivers/phy/ti/phy-gmii-sel.c, does not provide any methods to power on and power off the ethernet MAC's PHY. I have just realized that this is stale code and will remove it in the v2 series. Also, I realize now that I did not invoke "am65_cpsw_disable_phy()" on the SERDES PHY in the driver's remove function. I will fix this in the v2 series. Regards, Siddharth. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4B0F8ECAAD3 for ; Thu, 15 Sep 2022 08:38:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:To:Subject: CC:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IsimB7zT/Blhdgr0x0VgTY3HuOHDTB2Vxfg2NuakG0I=; b=XWkrffnFDb1dS9 JOeE+G0p0aMN/OMAVzxPOky9RP2zAk5zcatIYUvRUDRn7WlBWj7ueII1n3RIaJj5Gu3lWyS0X1mqk z2I79rxrsv1axEp7BQr1X1nd6UcPwIucU17mFLIniU5CGdWiXl2tum3UtwIzOIeZtQExrm3tQi6sH p6CGxVg6KDnJ1UahAq1xtPjcu3aKf0lJ3yMGxYoXAmB72hZtKSX7gQr1fX+EKkT9HL3mCcyhbmZz7 vecRtUSfQxyBG9slTxNDXY+CqKJNIeuhQetewAqnIMMvIWJf7CDp9R8dpRIHoj2E/K0E0RAFkYp6g GtJYNZS8zfFqq6SMOlmw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oYkNA-0044nZ-G6; Thu, 15 Sep 2022 08:37:24 +0000 Received: from fllv0015.ext.ti.com ([198.47.19.141]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oYkN5-0044UJ-FW for linux-arm-kernel@lists.infradead.org; Thu, 15 Sep 2022 08:37:21 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 28F8av5d020223; Thu, 15 Sep 2022 03:36:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1663231017; bh=2RSmklK1TVuVRmWe/70Gpjzew728xNGbXx1E3M+lpr8=; h=Date:CC:Subject:To:References:From:In-Reply-To; b=SpCm8zgKOL/xH+6QYS9hvm1VYeoEBIuy1znTpdRovLDu9xZs7LUrdNrXbob4fdXYE SdUQxG0OXJlbZv1B1gn/bGHjyRvvaGYY1+DzyQ2Vn3cSqQURh8qKVmGMg2iCz5i/Cn hxHb3a4gfERI7btHXOlSmaP7o+0CY2r4WUuFZELk= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 28F8avuA055725 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 15 Sep 2022 03:36:57 -0500 Received: from DFLE104.ent.ti.com (10.64.6.25) 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.2507.6; Thu, 15 Sep 2022 03:36:57 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Thu, 15 Sep 2022 03:36:57 -0500 Received: from [10.24.69.241] (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 28F8alx3095898; Thu, 15 Sep 2022 03:36:47 -0500 Message-ID: Date: Thu, 15 Sep 2022 14:06:46 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 CC: , , , , , , , , , , , , , , , , Subject: Re: [PATCH 2/8] net: ethernet: ti: am65-cpsw: Add support for SERDES configuration Content-Language: en-US To: "Russell King (Oracle)" References: <20220914095053.189851-1-s-vadapalli@ti.com> <20220914095053.189851-3-s-vadapalli@ti.com> From: Siddharth Vadapalli In-Reply-To: X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220915_013719_690862_382EE4C1 X-CRM114-Status: GOOD ( 19.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello Russell, On 14/09/22 21:07, Russell King (Oracle) wrote: > On Wed, Sep 14, 2022 at 03:20:47PM +0530, Siddharth Vadapalli wrote: >> @@ -1427,6 +1471,9 @@ static void am65_cpsw_nuss_mac_link_down(struct phylink_config *config, unsigned >> struct net_device *ndev = port->ndev; >> int tmo; >> >> + /* disable phy */ >> + am65_cpsw_disable_phy(port->slave.ifphy); >> + > > This seems really strange. If you have a serdes interface which > presumably supports SGMII, 1000base-X etc, then link status is sent > across the serdes interface. If you power down the serdes, then you > can't receive the link status, and so mac_link_up() won't be called. > > Are you really sure you want to be enabling and disabling the PHY > in mac_link_down()/mac_link_up() ? Thank you for reviewing the patch. The PHY passed to the "am65_cpsw_disable_phy()" and "am65_cpsw_disable_phy()" functions within the "am65_cpsw_nuss_mac_link_down()" and "am65_cpsw_nuss_mac_link_up()" functions respectively, is the CPSW ethernet MAC's PHY and not the SERDES PHY. The SERDES PHY is powered on through the function call to the "am65_cpsw_init_phy()" function. The calls to the functions "am65_cpsw_enable_phy()" and "am65_cpsw_disable_phy()" within the "am65_cpsw_nuss_mac_link_up()" and "am65_cpsw_nuss_mac_link_down()" functions respectively, try to power on and power off the CPSW ethernet MAC's phy. Looking at it again,they do nothing, since the driver corresponding to the ethernet MAC's PHY which happens to be drivers/phy/ti/phy-gmii-sel.c, does not provide any methods to power on and power off the ethernet MAC's PHY. I have just realized that this is stale code and will remove it in the v2 series. Also, I realize now that I did not invoke "am65_cpsw_disable_phy()" on the SERDES PHY in the driver's remove function. I will fix this in the v2 series. Regards, Siddharth. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel