From patchwork Tue Mar 21 21:01:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Berger X-Patchwork-Id: 741749 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3vnlc42FMGz9s7g for ; Wed, 22 Mar 2017 08:01:40 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uZyBk+D1"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933371AbdCUVBU (ORCPT ); Tue, 21 Mar 2017 17:01:20 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:36596 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932700AbdCUVBT (ORCPT ); Tue, 21 Mar 2017 17:01:19 -0400 Received: by mail-qk0-f193.google.com with SMTP id n141so23800263qke.3; Tue, 21 Mar 2017 14:01:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=fCGDJnulK5YAr2Gl21pcLnk8xVDYl2LjsM1HrEdlfBM=; b=uZyBk+D1GZH5Bn+Rvkz5Uyy22Ktw9B4/Yd8nsIT9/KgkRnEAsPfkmt4JccxRYmvr/H vuPAYS6sb4Ink0aIkUMfwLSKiMZKHIF1orbmMh+Dd7T41w1IkRWfuoJJqIPcg/VwFWQx Kyp743Wa2s+4DxlVTASqz00PsEXy5XpMJ6L763oJdl9uBx7OGAYXUogtmXLWq3XNS3X+ PaopCe14djefmASRLWoafWCu8ytyS5/KYOgYmnr/ubKaJOrbcyvlHdeiy67yNAyQd1uy Ge7tIlAWmsLHvFgDb+SEu7fjma1oqf3s7QtHsU67ixKOdFqCVBCDgVi6ryediQ36VRfU uUEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=fCGDJnulK5YAr2Gl21pcLnk8xVDYl2LjsM1HrEdlfBM=; b=U20HfxX9bhgvJqURCPSYHFjqzoWQsw5fHvZJjpvvMqI5ofrw/Mshqow3gtznou7iOI D8/w3IsO5RMzaJbAMQH9PG3V4GT+Xx+uNvUJnYRZyDZrcqs9mOqxqxUl8Ye8sJf3LrMS w5LsNbPUCjeV0UKwAFOonXeVOtB3RC3fmnb+io1py4a+whplT1eKiwOHMHXP+CafzkJa 4AB/OqrWGfMimXZQarud4FDwCI9ojWyluRvSMrw8sAvMcu3xPHd2WCj9xjqouL5NrDUN FJm2zHycrjIlHdpg17auavi7KPkxmVK6ZaWwOshBYUo1WvvmHAdB/yjxAsKqh54gaID/ 7cdQ== X-Gm-Message-State: AFeK/H2Meph3D8XQjiElBMa6B+EtpdVkm3ijHBaJOI/+ki6AOV81/aBahZJb3h6dFvQ0BA== X-Received: by 10.55.103.215 with SMTP id b206mr31452064qkc.264.1490130076474; Tue, 21 Mar 2017 14:01:16 -0700 (PDT) Received: from stb-bld-02.irv.broadcom.com ([192.19.255.250]) by smtp.gmail.com with ESMTPSA id q123sm15543451qkb.63.2017.03.21.14.01.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Mar 2017 14:01:15 -0700 (PDT) From: Doug Berger To: f.fainelli@gmail.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Doug Berger Subject: [PATCH net] net: bcmgenet: remove bcmgenet_internal_phy_setup() Date: Tue, 21 Mar 2017 14:01:06 -0700 Message-Id: <20170321210106.3875-1-opendmb@gmail.com> X-Mailer: git-send-email 2.11.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Commit 6ac3ce8295e6 ("net: bcmgenet: Remove excessive PHY reset") removed the bcmgenet_mii_reset() function from bcmgenet_power_up() and bcmgenet_internal_phy_setup() functions. In so doing it broke the reset of the internal PHY devices used by the GENETv1-GENETv3 which required this reset before the UniMAC was enabled. It also broke the internal GPHY devices used by the GENETv4 because the config_init that installed the AFE workaround was no longer occurring after the reset of the GPHY performed by bcmgenet_phy_power_set() in bcmgenet_internal_phy_setup(). In addition the code in bcmgenet_internal_phy_setup() related to the "enable APD" comment goes with the bcmgenet_mii_reset() so it should have also been removed. Commit bd4060a6108b ("net: bcmgenet: Power on integrated GPHY in bcmgenet_power_up()") moved the bcmgenet_phy_power_set() call to the bcmgenet_power_up() function, but failed to remove it from the bcmgenet_internal_phy_setup() function. Had it done so, the bcmgenet_internal_phy_setup() function would have been empty and could have been removed at that time. Commit 5dbebbb44a6a ("net: bcmgenet: Software reset EPHY after power on") was submitted to correct the functional problems introduced by commit 6ac3ce8295e6 ("net: bcmgenet: Remove excessive PHY reset"). It was included in v4.4 and made available on 4.3-stable. Unfortunately, it didn't fully revert the commit because this bcmgenet_mii_reset() doesn't apply the soft reset to the internal GPHY used by GENETv4 like the previous one did. This prevents the restoration of the AFE work- arounds for internal GPHY devices after the bcmgenet_phy_power_set() in bcmgenet_internal_phy_setup(). This commit takes the alternate approach of removing the unnecessary bcmgenet_internal_phy_setup() function which shouldn't have been in v4.3 so that when bcmgenet_mii_reset() was restored it should have only gone into bcmgenet_power_up(). This will avoid the problems while also removing the redundancy (and hopefully some of the confusion). Fixes: 6ac3ce8295e6 ("net: bcmgenet: Remove excessive PHY reset") Signed-off-by: Doug Berger Reviewed-by: Florian Fainelli --- drivers/net/ethernet/broadcom/genet/bcmmii.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c index e87607621e62..2f9281936f0e 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmmii.c +++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c @@ -220,20 +220,6 @@ void bcmgenet_phy_power_set(struct net_device *dev, bool enable) udelay(60); } -static void bcmgenet_internal_phy_setup(struct net_device *dev) -{ - struct bcmgenet_priv *priv = netdev_priv(dev); - u32 reg; - - /* Power up PHY */ - bcmgenet_phy_power_set(dev, true); - /* enable APD */ - reg = bcmgenet_ext_readl(priv, EXT_EXT_PWR_MGMT); - reg |= EXT_PWR_DN_EN_LD; - bcmgenet_ext_writel(priv, reg, EXT_EXT_PWR_MGMT); - bcmgenet_mii_reset(dev); -} - static void bcmgenet_moca_phy_setup(struct bcmgenet_priv *priv) { u32 reg; @@ -281,7 +267,6 @@ int bcmgenet_mii_config(struct net_device *dev) if (priv->internal_phy) { phy_name = "internal PHY"; - bcmgenet_internal_phy_setup(dev); } else if (priv->phy_interface == PHY_INTERFACE_MODE_MOCA) { phy_name = "MoCA"; bcmgenet_moca_phy_setup(priv);