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);