From patchwork Fri Mar 20 09:53:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jose Abreu X-Patchwork-Id: 222173 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34439C4332B for ; Fri, 20 Mar 2020 09:54:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F29D620774 for ; Fri, 20 Mar 2020 09:54:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="Hw5YrFFk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727323AbgCTJx4 (ORCPT ); Fri, 20 Mar 2020 05:53:56 -0400 Received: from smtprelay-out1.synopsys.com ([149.117.87.133]:42798 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727302AbgCTJxy (ORCPT ); Fri, 20 Mar 2020 05:53:54 -0400 Received: from mailhost.synopsys.com (mdc-mailhost1.synopsys.com [10.225.0.209]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id AFAC8C0F91; Fri, 20 Mar 2020 09:53:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1584698034; bh=rM1MFF/KqlI5E67w4k50vtl46f5JYXf2zwsUKsu4MlE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=Hw5YrFFkEckCI7xE7E+GhH8qQzuzu7Kry4v7xxcYzt9a+DihwvoJCGhVqihywoj0i mXr5ZWHVfMiFcufENPvHEiNVl8bCM1cp25ctzE4l8XRFpTQA8mkCE0N/rb50rNZn84 g0xJX1ru2MDm5Qptn80ZDUeh5jgNdKvuWJq2/UGBC4GKOZbyTkJONHbEGS4qP5gOM1 QIKvy1BwsdHrclNuBD4kmmcFRIUviT2WzDQgB7caVS/vI1AC+j0pqcPYByqeN0rx1E XAWi19zehkbU9jqsm81/GhlTI+lOdW1xXYfEeTIIFqt1fcxUsK7nefTkLHr3+it5WR AnY2QX9TDFC4w== Received: from de02dwia024.internal.synopsys.com (de02dwia024.internal.synopsys.com [10.225.19.81]) by mailhost.synopsys.com (Postfix) with ESMTP id EF48EA0065; Fri, 20 Mar 2020 09:53:48 +0000 (UTC) From: Jose Abreu To: netdev@vger.kernel.org Cc: Joao Pinto , Jose Abreu , Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , "David S. Miller" , linux-kernel@vger.kernel.org Subject: [PATCH net-next 2/4] net: phy: xpcs: Reset XPCS upon probe Date: Fri, 20 Mar 2020 10:53:35 +0100 Message-Id: <7704477e54a88cde1ca48f860974ce8378c1615d.1584697754.git.Jose.Abreu@synopsys.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Reset the XPCS upon probe stage so that we start it from well known state. Signed-off-by: Jose Abreu --- Cc: Jose Abreu Cc: Andrew Lunn Cc: Florian Fainelli Cc: Heiner Kallweit Cc: Russell King Cc: "David S. Miller" Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/net/phy/mdio-xpcs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/mdio-xpcs.c b/drivers/net/phy/mdio-xpcs.c index c04e9bf40180..54976047dcb9 100644 --- a/drivers/net/phy/mdio-xpcs.c +++ b/drivers/net/phy/mdio-xpcs.c @@ -688,7 +688,7 @@ static int xpcs_probe(struct mdio_xpcs_args *xpcs, phy_interface_t interface) match = entry; if (xpcs_check_features(xpcs, match, interface)) - return 0; + return xpcs_soft_reset(xpcs, MDIO_MMD_PCS); } } From patchwork Fri Mar 20 09:53:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jose Abreu X-Patchwork-Id: 222172 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7157C4332B for ; Fri, 20 Mar 2020 09:54:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 79E0B20722 for ; Fri, 20 Mar 2020 09:54:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="OZA7F/0S" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727224AbgCTJxx (ORCPT ); Fri, 20 Mar 2020 05:53:53 -0400 Received: from smtprelay-out1.synopsys.com ([149.117.73.133]:39084 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726806AbgCTJxw (ORCPT ); Fri, 20 Mar 2020 05:53:52 -0400 Received: from mailhost.synopsys.com (mdc-mailhost1.synopsys.com [10.225.0.209]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id B22AB405DD; Fri, 20 Mar 2020 09:53:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1584698032; bh=4+HvQGiA8FWnUSDj7nvWYYz5tzaFq+FB1nKqZ26AjLk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=OZA7F/0SEVrv5G+XgdxJ8e9Fx2RXYJjG8hD/wexZuKwVRS13v2OkgcUFUUbXQOYfQ N3iTn+RQPSvGiyrsPAnfn8Q1BD+/2qWXU7p0ENfNOn171ZKUyN9dVrqKCmoAaYFL4T lPHOsDriUyld+4Gr1IgDiwLLFbndEMwukeHUJcb4UhXVNcI5d0YjL7imc4G/MMhHLr spMpfEJFAIZMPdFbfKKvB01bC551cKevjdi8GU/zSjIQX1Vmw9nsg0Gd59BAoncBBT 4J8/CnsLoV6hDdMO4wNoVyUdIxPCAau4bHfRebBcAZ56lkHDYXX05AuFjOSLLpUsty oiREoGcyv8Pcw== Received: from de02dwia024.internal.synopsys.com (de02dwia024.internal.synopsys.com [10.225.19.81]) by mailhost.synopsys.com (Postfix) with ESMTP id 0BE75A0063; Fri, 20 Mar 2020 09:53:49 +0000 (UTC) From: Jose Abreu To: netdev@vger.kernel.org Cc: Joao Pinto , Jose Abreu , Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , "David S. Miller" , linux-kernel@vger.kernel.org Subject: [PATCH net-next 3/4] net: phy: xpcs: Set Link down if AutoNeg is enabled and did not finish Date: Fri, 20 Mar 2020 10:53:36 +0100 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Set XPCS Link as down when AutoNeg is enabled but it didn't finish with success. Signed-off-by: Jose Abreu --- Cc: Jose Abreu Cc: Andrew Lunn Cc: Florian Fainelli Cc: Heiner Kallweit Cc: Russell King Cc: "David S. Miller" Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/net/phy/mdio-xpcs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/mdio-xpcs.c b/drivers/net/phy/mdio-xpcs.c index 54976047dcb9..f10d86b85fbd 100644 --- a/drivers/net/phy/mdio-xpcs.c +++ b/drivers/net/phy/mdio-xpcs.c @@ -617,10 +617,12 @@ static int xpcs_get_state(struct mdio_xpcs_args *xpcs, return xpcs_config(xpcs, state); } - if (state->link && state->an_enabled && xpcs_aneg_done(xpcs, state)) { + if (state->an_enabled && xpcs_aneg_done(xpcs, state)) { state->an_complete = true; xpcs_read_lpa(xpcs, state); xpcs_resolve_lpa(xpcs, state); + } else if (state->an_enabled) { + state->link = 0; } else if (state->link) { xpcs_resolve_pma(xpcs, state); }