From: Choong Yong Liang <yong.liang.choong@linux.intel.com>
To: Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Jose Abreu <joabreu@synopsys.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Oleksij Rempel <o.rempel@pengutronix.de>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH net v1 1/2] net: phy: set eee_cfg based on PHY configuration
Date: Thu, 14 Nov 2024 16:16:52 +0800 [thread overview]
Message-ID: <20241114081653.3939346-2-yong.liang.choong@linux.intel.com> (raw)
In-Reply-To: <20241114081653.3939346-1-yong.liang.choong@linux.intel.com>
Not all PHYs have EEE enabled by default. For example, Marvell PHYs are
designed to have EEE hardware disabled during the initial state, and it
needs to be configured to turn it on again.
This patch reads the PHY configuration and sets it as the initial value for
eee_cfg.tx_lpi_enabled and eee_cfg.eee_enabled instead of having them set to
true by default.
Fixes: 49168d1980e2 ("net: phy: Add phy_support_eee() indicating MAC support EEE")
Cc: <stable@vger.kernel.org>
Signed-off-by: Choong Yong Liang <yong.liang.choong@linux.intel.com>
---
drivers/net/phy/phy_device.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 499797646580..b4fa40c2371a 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -3010,9 +3010,12 @@ EXPORT_SYMBOL_GPL(phy_advertise_eee_all);
*/
void phy_support_eee(struct phy_device *phydev)
{
+ bool is_enabled = true;
+
+ genphy_c45_eee_is_active(phydev, NULL, NULL, &is_enabled);
linkmode_copy(phydev->advertising_eee, phydev->supported_eee);
- phydev->eee_cfg.tx_lpi_enabled = true;
- phydev->eee_cfg.eee_enabled = true;
+ phydev->eee_cfg.tx_lpi_enabled = is_enabled;
+ phydev->eee_cfg.eee_enabled = is_enabled;
}
EXPORT_SYMBOL(phy_support_eee);
--
2.34.1
next prev parent reply other threads:[~2024-11-14 8:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-14 8:16 [PATCH net v1 0/2] Fix 'ethtool --show-eee' during initial stage Choong Yong Liang
2024-11-14 8:16 ` Choong Yong Liang [this message]
2024-11-14 9:23 ` [PATCH net v1 1/2] net: phy: set eee_cfg based on PHY configuration Russell King (Oracle)
2024-11-14 10:05 ` Russell King (Oracle)
2024-11-14 10:16 ` Russell King (Oracle)
2024-11-15 1:46 ` Choong Yong Liang
2024-11-14 8:16 ` [PATCH net v1 2/2] net: stmmac: set initial EEE policy configuration Choong Yong Liang
2024-11-14 14:19 ` Andrew Lunn
2024-11-15 1:45 ` Choong Yong Liang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241114081653.3939346-2-yong.liang.choong@linux.intel.com \
--to=yong.liang.choong@linux.intel.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=joabreu@synopsys.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=linux@armlinux.org.uk \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®