summaryrefslogtreecommitdiff
path: root/drivers/net/phy/bcm-phy-lib.c
diff options
context:
space:
mode:
authorJustin Chen <justin.chen@broadcom.com>2026-05-05 10:39:26 -0700
committerJakub Kicinski <kuba@kernel.org>2026-05-07 08:36:47 -0700
commit32cd651d14fc72a93703ea2384cb5cd8998523a8 (patch)
tree041c5e83ffbe44bf298d0907759f2b33d7653fbe /drivers/net/phy/bcm-phy-lib.c
parent9032f7676935a13fd402608223d326c5f62da9c0 (diff)
downloadlinux-next-32cd651d14fc72a93703ea2384cb5cd8998523a8.tar.gz
linux-next-32cd651d14fc72a93703ea2384cb5cd8998523a8.zip
net: phy: broadcom: Save PHY counters during suspend
The PHY counters can be lost if the PHY is reset during suspend. We need to save the values into the shadow counters or the accounting will be incorrect over multiple suspend and resume cycles. Fixes: 820ee17b8d3b ("net: phy: broadcom: Add support code for reading PHY counters") Signed-off-by: Justin Chen <justin.chen@broadcom.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://patch.msgid.link/20260505173926.2870069-1-justin.chen@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/phy/bcm-phy-lib.c')
-rw-r--r--drivers/net/phy/bcm-phy-lib.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/phy/bcm-phy-lib.c b/drivers/net/phy/bcm-phy-lib.c
index 5198d66dbbc0..b64beade8dd9 100644
--- a/drivers/net/phy/bcm-phy-lib.c
+++ b/drivers/net/phy/bcm-phy-lib.c
@@ -563,6 +563,15 @@ void bcm_phy_get_stats(struct phy_device *phydev, u64 *shadow,
}
EXPORT_SYMBOL_GPL(bcm_phy_get_stats);
+void bcm_phy_update_stats_shadow(struct phy_device *phydev, u64 *shadow)
+{
+ unsigned int i;
+
+ for (i = 0; i < ARRAY_SIZE(bcm_phy_hw_stats); i++)
+ bcm_phy_get_stat(phydev, shadow, i);
+}
+EXPORT_SYMBOL_GPL(bcm_phy_update_stats_shadow);
+
void bcm_phy_r_rc_cal_reset(struct phy_device *phydev)
{
/* Reset R_CAL/RC_CAL Engine */