From patchwork Tue Jan 14 16:50:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13938973 X-Patchwork-Delegate: kuba@kernel.org Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E5A40232459 for ; Tue, 14 Jan 2025 16:51:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736873475; cv=none; b=nKRtI0S43zgdoGcl5hPGdHLvWTfCy5CeGjTGV/a6FqnrxXS1I7udMSxavK4AUB131f/6dXn9OJ7PfsMO0afehVxcFc8NYFQwRlEv+t6ZzxXH72EnMxWEVjTfmqDEZJk1Tuht0x+AELy9XR23J58RseMNCKNj01y9GmpbaLXEl/M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736873475; c=relaxed/simple; bh=RcVSz5A7WTX07UZH0a3d61vsaNjL9w6wB09GU+odVGI=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=E5oMR63nNWeoLW9imGipykDksj2/mqsaCsNw9WRDsF8OzQrSxQCR5Voxqli568FudxURJgS+EHBQ9DMaawBHZLOjw9MSkeUs3TVG3d8vKK59s8yO12D2l2fkkcYEvlyCmpZPq6jRmV2uJLLIwmTz9Eu6WDa6IZUnRm6sxKZDJsA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=uJQScRrF; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="uJQScRrF" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=fMDPibTGVutVnoUV7xjLJg1ugDt9ePaw7m06y1uj5gw=; b=uJQScRrF22OwgBKkXrcgJx8pMw KgqhDM9jlafpk/fwbNqBd7N0z9qx1r+tCCXdSQYzohuvj9LKMt71VHP/7C+mVrDRY8rN3GXFhGJXw IpzOQQ+9y8mSGS5xWDDYV0+WKlWr/h5agTCYjeWtiTDfSxjzBSrweXyH4UrScLa4c2uLycsmlJw45 kGcqc/k54VAYZnWt2uiG+Qq6TdhrZcPCrstUKsDgJAMjgn0ZL7kqbUrLuNheM/L1QUv0u1au48P8Q SnW9IOewZ1Q7S/WRbkRGSRBt94GrbhbBzcvX3c8wF5xFEaeDsvePBbfmJM/ceL95hrgiAGyc0dKnI jQ+Pl3sQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:58802 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tXk8A-0008Nr-2U; Tue, 14 Jan 2025 16:51:06 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tXk7r-000r4l-Li; Tue, 14 Jan 2025 16:50:47 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Andrew Lunn , bcm-kernel-feedback-list@broadcom.com, "David S. Miller" , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Justin Chen , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 1/3] net: bcm: asp2: fix LPI timer handling Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Tue, 14 Jan 2025 16:50:47 +0000 X-Patchwork-Delegate: kuba@kernel.org Fix the LPI timer handling in Broadcom ASP2 driver after the phylib managed EEE patches were merged. Signed-off-by: Russell King (Oracle) Reviewed-by: Florian Fainelli Tested-by: Florian Fainelli --- drivers/net/ethernet/broadcom/asp2/bcmasp_ethtool.c | 2 -- drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp_ethtool.c b/drivers/net/ethernet/broadcom/asp2/bcmasp_ethtool.c index 9da5ae29a105..139058a0dbbb 100644 --- a/drivers/net/ethernet/broadcom/asp2/bcmasp_ethtool.c +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp_ethtool.c @@ -371,7 +371,6 @@ static int bcmasp_get_eee(struct net_device *dev, struct ethtool_keee *e) return -ENODEV; e->tx_lpi_enabled = p->tx_lpi_enabled; - e->tx_lpi_timer = umac_rl(intf, UMC_EEE_LPI_TIMER); return phy_ethtool_get_eee(dev->phydev, e); } @@ -395,7 +394,6 @@ static int bcmasp_set_eee(struct net_device *dev, struct ethtool_keee *e) return ret; } - umac_wl(intf, e->tx_lpi_timer, UMC_EEE_LPI_TIMER); intf->eee.tx_lpi_enabled = e->tx_lpi_enabled; bcmasp_eee_enable_set(intf, true); } diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c b/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c index cfd50efbdbc0..62861a454a27 100644 --- a/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c @@ -677,6 +677,8 @@ static void bcmasp_adj_link(struct net_device *dev) } umac_wl(intf, reg, UMC_CMD); + umac_wl(intf, phydev->eee_cfg.tx_lpi_timer, UMC_EEE_LPI_TIMER); + active = phy_init_eee(phydev, 0) >= 0; bcmasp_eee_enable_set(intf, active); } @@ -1055,6 +1057,9 @@ static int bcmasp_netif_init(struct net_device *dev, bool phy_connect) /* Indicate that the MAC is responsible for PHY PM */ phydev->mac_managed_pm = true; + + /* Set phylib's copy of the LPI timer */ + phydev->eee_cfg.tx_lpi_timer = umac_rl(intf, UMC_EEE_LPI_TIMER); } umac_reset(intf); From patchwork Tue Jan 14 16:50:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13938974 X-Patchwork-Delegate: kuba@kernel.org Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB005232459 for ; Tue, 14 Jan 2025 16:51:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736873479; cv=none; b=S4aHWeZhepyAIX9QvGDzsiV/PdWfbESxHneXVVj7BB3oqBJNnKGSju6LfYCuo7X1kYauQXVbWU8m57LKYiTT91KVtCKt8sSg+0qebhVnpF21XjhsPi6ThBpW/s68fJGzsPYpF3iZH7Mh4+t+o7JFWaskONXwKNAr5NAj16TU2RI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736873479; c=relaxed/simple; bh=kxwJ6ZLf1F2kRoZrAiF1HSoEtcU5OHUSCywmpVYXh9M=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=Xk1pgFEm0D2e86oqazSejly1+iBwUH22Vn+HKXh6nNvzyYI4TC1fji+ZvPnTtxxXuK0usNdOGKOjS6+dCTnoPg09A7NguN/9t8AknqekCJKNbDwI6Cb5jgdI9yKEdNy7Kx9A5SliOhngPq0ZoLMueTaTxxWg8SdN5UL0ERvyQ5M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=sQyC6mG6; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="sQyC6mG6" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=OaAYO4ab4fITs7juBW/FSfIp2nYrOC6gWB66JY5AddA=; b=sQyC6mG6GYkQpMQJCf3tH3J2qu 0bmlYAeqFJV56qZFSx5sFae82oaTOpFYZBbJ+RKILWO9DsR3eUvWNEkSCDkMpNeJyBXVx06E22SHV mCROmSLv/eRrYGL5JqYZqRQgMETl8nAKDIt+C4EDyKH6moTECilzVAwT8lH+iFK7u/+7lKfmz5u84 YRj6vI74B4pL7WEf1/QjH2xDSk4P7yAuJGfeIwn0aM1RCLzlvU3Qp8NT5SldDuNLH860z212FpuJE /4lCcJX/4hw9G8dmpWKNadAQZ4frmaAL1hVkXAe5Q8nd1clH/lqxMWq6GDPw3OmZ5jGriNbMbzCZS 5rjH5I+g==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:60486 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tXk8G-0008O4-0P; Tue, 14 Jan 2025 16:51:12 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tXk7w-000r4r-Pq; Tue, 14 Jan 2025 16:50:52 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Andrew Lunn , bcm-kernel-feedback-list@broadcom.com, "David S. Miller" , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Justin Chen , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 2/3] net: bcm: asp2: remove tx_lpi_enabled Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Tue, 14 Jan 2025 16:50:52 +0000 X-Patchwork-Delegate: kuba@kernel.org Phylib maintains a copy of tx_lpi_enabled, which will be used to populate the member when phy_ethtool_get_eee(). Therefore, writing to this member before phy_ethtool_get_eee() will have no effect. Remove it. Also remove setting our copy of info->eee.tx_lpi_enabled which becomes write-only. Signed-off-by: Russell King (Oracle) Reviewed-by: Florian Fainelli Tested-by: Florian Fainelli --- drivers/net/ethernet/broadcom/asp2/bcmasp_ethtool.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp_ethtool.c b/drivers/net/ethernet/broadcom/asp2/bcmasp_ethtool.c index 139058a0dbbb..5e04cd1839c0 100644 --- a/drivers/net/ethernet/broadcom/asp2/bcmasp_ethtool.c +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp_ethtool.c @@ -364,14 +364,9 @@ void bcmasp_eee_enable_set(struct bcmasp_intf *intf, bool enable) static int bcmasp_get_eee(struct net_device *dev, struct ethtool_keee *e) { - struct bcmasp_intf *intf = netdev_priv(dev); - struct ethtool_keee *p = &intf->eee; - if (!dev->phydev) return -ENODEV; - e->tx_lpi_enabled = p->tx_lpi_enabled; - return phy_ethtool_get_eee(dev->phydev, e); } @@ -394,7 +389,6 @@ static int bcmasp_set_eee(struct net_device *dev, struct ethtool_keee *e) return ret; } - intf->eee.tx_lpi_enabled = e->tx_lpi_enabled; bcmasp_eee_enable_set(intf, true); } From patchwork Tue Jan 14 16:50:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13938975 X-Patchwork-Delegate: kuba@kernel.org Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79F45232459 for ; Tue, 14 Jan 2025 16:51:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736873484; cv=none; b=KLaEBtO0ACn21xn4ztXI16pLk+lsyQf8F+UslEkhMi2jS3oG9LJrMy3U2WkPLR5A568cvf8Dy++S19G7bTc6fr/nAlwao5QPoB38FJ+2aTnnBMweCwBUDJqNv2UVT1drToJRXxRR4/Wcustq8mcxK8lTZO/eC/lHX9RjajBAf2s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736873484; c=relaxed/simple; bh=sS0SNPUTBZCONHd/3nmbyQ70JqGsNVfOp+hf+q5fd5E=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=N9JqOvEIOP8wnjnkdRNBfpyxOfQ94MNw4gyDIA/IyZI6DNC6XxspjWmjlJGERVgcx5G8NHHGg/m/ZNf1dykJ+/iLrA9m/FsTWi+on/GRlkkeNjDdZqJIue3aJiC4TSrOMoV/8OaWNVorA6X3fhxJT9XJ979LQTqHVOU4qA7C260= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=EdQOTFCc; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="EdQOTFCc" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=oenY17GSf8f8EXzY6YS/3Oz03Km0J1tQZHiPenN9SJA=; b=EdQOTFCcpVQqJL9SbFTXjDlfow ydKYKjYnd9HevwZDOpEePzwsVzWzRC+tPQNZ7fK7GSQTwYNv7Y4+z837NdR9f8mtnWCfUXTu0ljOw LNvr1S2CtvzR4yFEii1UTpneUjnNrKY8f4R5rTcKfBMj3Foo9jB3GCyFyaFXoTG7L53SBNkQ/CNxp sFM6CM0zhsrafqsJLeipqGP15yUje5a6bCM8LZ9UlfVJe7KNYqSj1zsGCM4xpKsaoks6ZnaF4GeJX lUwkZC3bB1eIRuR8th9XBqj6N8CubGhWVa9uSGDG2sdYhuF9qBLnL7LeR/du5FmcO8a32Vh8bTr46 LmghgCjg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:60496 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tXk8L-0008OK-0R; Tue, 14 Jan 2025 16:51:17 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tXk81-000r4x-TS; Tue, 14 Jan 2025 16:50:57 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Andrew Lunn , bcm-kernel-feedback-list@broadcom.com, "David S. Miller" , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Justin Chen , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 3/3] net: bcm: asp2: convert to phylib managed EEE Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Tue, 14 Jan 2025 16:50:57 +0000 X-Patchwork-Delegate: kuba@kernel.org Convert the Broadcom ASP2 driver to use phylib managed EEE support. Signed-off-by: Russell King (Oracle) Reviewed-by: Florian Fainelli Tested-by: Florian Fainelli --- drivers/net/ethernet/broadcom/asp2/bcmasp.h | 3 -- .../ethernet/broadcom/asp2/bcmasp_ethtool.c | 31 ------------------- .../net/ethernet/broadcom/asp2/bcmasp_intf.c | 19 ++++++------ 3 files changed, 10 insertions(+), 43 deletions(-) diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp.h b/drivers/net/ethernet/broadcom/asp2/bcmasp.h index f93cb3da44b0..8fc75bcedb70 100644 --- a/drivers/net/ethernet/broadcom/asp2/bcmasp.h +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp.h @@ -348,8 +348,6 @@ struct bcmasp_intf { /* Used if per intf wol irq */ int wol_irq; unsigned int wol_irq_enabled:1; - - struct ethtool_keee eee; }; #define NUM_NET_FILTERS 32 @@ -601,5 +599,4 @@ int bcmasp_netfilt_get_all_active(struct bcmasp_intf *intf, u32 *rule_locs, void bcmasp_netfilt_suspend(struct bcmasp_intf *intf); -void bcmasp_eee_enable_set(struct bcmasp_intf *intf, bool enable); #endif diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp_ethtool.c b/drivers/net/ethernet/broadcom/asp2/bcmasp_ethtool.c index 5e04cd1839c0..a537c121d3e2 100644 --- a/drivers/net/ethernet/broadcom/asp2/bcmasp_ethtool.c +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp_ethtool.c @@ -348,20 +348,6 @@ static int bcmasp_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, return err; } -void bcmasp_eee_enable_set(struct bcmasp_intf *intf, bool enable) -{ - u32 reg; - - reg = umac_rl(intf, UMC_EEE_CTRL); - if (enable) - reg |= EEE_EN; - else - reg &= ~EEE_EN; - umac_wl(intf, reg, UMC_EEE_CTRL); - - intf->eee.eee_enabled = enable; -} - static int bcmasp_get_eee(struct net_device *dev, struct ethtool_keee *e) { if (!dev->phydev) @@ -372,26 +358,9 @@ static int bcmasp_get_eee(struct net_device *dev, struct ethtool_keee *e) static int bcmasp_set_eee(struct net_device *dev, struct ethtool_keee *e) { - struct bcmasp_intf *intf = netdev_priv(dev); - struct ethtool_keee *p = &intf->eee; - int ret; - if (!dev->phydev) return -ENODEV; - if (!p->eee_enabled) { - bcmasp_eee_enable_set(intf, false); - } else { - ret = phy_init_eee(dev->phydev, 0); - if (ret) { - netif_err(intf, hw, dev, - "EEE initialization failed: %d\n", ret); - return ret; - } - - bcmasp_eee_enable_set(intf, true); - } - return phy_ethtool_set_eee(dev->phydev, e); } diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c b/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c index 62861a454a27..45ec1a9214a2 100644 --- a/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c @@ -619,7 +619,6 @@ static void bcmasp_adj_link(struct net_device *dev) struct phy_device *phydev = dev->phydev; u32 cmd_bits = 0, reg; int changed = 0; - bool active; if (intf->old_link != phydev->link) { changed = 1; @@ -678,9 +677,12 @@ static void bcmasp_adj_link(struct net_device *dev) umac_wl(intf, reg, UMC_CMD); umac_wl(intf, phydev->eee_cfg.tx_lpi_timer, UMC_EEE_LPI_TIMER); - - active = phy_init_eee(phydev, 0) >= 0; - bcmasp_eee_enable_set(intf, active); + reg = umac_rl(intf, UMC_EEE_CTRL); + if (phydev->enable_tx_lpi) + reg |= EEE_EN; + else + reg &= ~EEE_EN; + umac_wl(intf, reg, UMC_EEE_CTRL); } reg = rgmii_rl(intf, RGMII_OOB_CNTRL); @@ -1336,7 +1338,8 @@ static void bcmasp_suspend_to_wol(struct bcmasp_intf *intf) ASP_WAKEUP_INTR2_MASK_CLEAR); } - if (intf->eee.eee_enabled && intf->parent->eee_fixup) + if (ndev->phydev && ndev->phydev->eee_cfg.eee_enabled && + intf->parent->eee_fixup) intf->parent->eee_fixup(intf, true); netif_dbg(intf, wol, ndev, "entered WOL mode\n"); @@ -1378,7 +1381,8 @@ static void bcmasp_resume_from_wol(struct bcmasp_intf *intf) { u32 reg; - if (intf->eee.eee_enabled && intf->parent->eee_fixup) + if (intf->ndev->phydev && intf->ndev->phydev->eee_cfg.eee_enabled && + intf->parent->eee_fixup) intf->parent->eee_fixup(intf, false); reg = umac_rl(intf, UMC_MPD_CTRL); @@ -1409,9 +1413,6 @@ int bcmasp_interface_resume(struct bcmasp_intf *intf) bcmasp_resume_from_wol(intf); - if (intf->eee.eee_enabled) - bcmasp_eee_enable_set(intf, true); - netif_device_attach(dev); return 0;