From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jose Abreu Subject: C45 Phys and PHY_FORCING state Date: Fri, 19 Oct 2018 13:02:12 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------E22ED0459994E4C227AFAC37" Cc: "David S. Miller" , "netdev@vger.kernel.org" , Joao Pinto To: Andrew Lunn , Florian Fainelli Return-path: Received: from smtprelay.synopsys.com ([198.182.60.111]:49436 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727469AbeJSUIW (ORCPT ); Fri, 19 Oct 2018 16:08:22 -0400 Sender: netdev-owner@vger.kernel.org List-ID: --------------E22ED0459994E4C227AFAC37 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hello Andrew and Florian, Currently I have a 10G C45 phy that is fixed at 10G link. This version does not support auto negotiation so I'm turning off the feature in phydev struct field. I found out that when I do this phylib is not composing C45 frames and is instead using C22. This is due to call to genphy_udpate_link() which doesn't work on my phy because it doesn't support C22. If I apply attached patch then things work perfectly fine. Can you please review it ? Thanks and Best Regards, Jose Miguel Abreu --------------E22ED0459994E4C227AFAC37 Content-Type: text/x-patch; name="0005-net-phy-Use-C45-Helpers-when-forcing-PHY.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0005-net-phy-Use-C45-Helpers-when-forcing-PHY.patch" >>From cccf07f4d7335cbc36f3856da6d368cb01570760 Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: References: From: Jose Abreu Date: Thu, 18 Oct 2018 17:36:21 +0200 Subject: [PATCH 5/8] net: phy: Use C45 Helpers when forcing PHY If PHY is in force state and we have a C45 phy we need to use the standard C45 helpers and not the C22 ones. Signed-off-by: Jose Abreu --- drivers/net/phy/phy.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 1ee25877c4d1..28ed957bc0f6 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -1007,7 +1007,11 @@ void phy_state_machine(struct work_struct *work) } break; case PHY_FORCING: - err = genphy_update_link(phydev); + if (phydev->is_c45) + err = gen10g_read_status(phydev); + else + err = genphy_update_link(phydev); + if (err) break; -- 2.7.4 --------------E22ED0459994E4C227AFAC37--