Re: [PATCH RFC net-next 3/3] net: phy: stop the PHY clock during LPI only if supported

2017-03-27 Thread Andrew Lunn
On Mon, Mar 27, 2017 at 11:47:21AM -0700, Florian Fainelli wrote:
> Now that we detect whether a PHY supports stopping its clock during LPI,
> deny a call to phy_init_eee() with clk_stop_enable being set and the PHY
> not supporting that.

Hi Florian

We are not denying the call. This just ignores the clk_stop_enable
parameter if the clock cannot be stopped. So i think this message
could be better worded.

Maybe also update the function comment?

* and it programs the MMD register 3.0 setting the "Clock stop enable"
* bit if supported by the device.

  Andrew


[PATCH RFC net-next 3/3] net: phy: stop the PHY clock during LPI only if supported

2017-03-27 Thread Florian Fainelli
Now that we detect whether a PHY supports stopping its clock during LPI,
deny a call to phy_init_eee() with clk_stop_enable being set and the PHY
not supporting that.

Signed-off-by: Florian Fainelli 
---
 drivers/net/phy/phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index ba4676ee9018..1c3800e01d82 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -1251,7 +1251,7 @@ int phy_init_eee(struct phy_device *phydev, bool 
clk_stop_enable)
if (!phy_check_valid(phydev->speed, phydev->duplex, lp & adv))
goto eee_exit_err;
 
-   if (clk_stop_enable) {
+   if (clk_stop_enable && phydev->clk_stop_cap) {
/* Configure the PHY to stop receiving xMII
 * clock while it is signaling LPI.
 */
-- 
2.9.3