From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Subject: Re: [PATCH 2/2] net: phy: micrel: Restore led_mode and clk_sel on resume Date: Tue, 30 May 2017 11:05:19 -0700 Message-ID: <44ddeaeb-3e23-3d88-cc5c-9ed290507648@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Johan Hovold , Alexandre Belloni , Philipp Zabel , Fabio Estevam , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org To: Leonard Crestez , Shawn Guo , Andrew Lunn , Andy Duan Return-path: In-Reply-To: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On 05/30/2017 10:34 AM, Leonard Crestez wrote: > These bits seem to be lost after a suspend/resume cycle so just set them > again. > > This patch fixes ethernet suspend/resume on imx6ul-14x14-evk boards. > > Signed-off-by: Leonard Crestez > --- > drivers/net/phy/micrel.c | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c > index 6a5fd18..c53ee17 100644 > --- a/drivers/net/phy/micrel.c > +++ b/drivers/net/phy/micrel.c > @@ -700,6 +700,9 @@ static int kszphy_suspend(struct phy_device *phydev) > > static int kszphy_resume(struct phy_device *phydev) > { > + struct kszphy_priv *priv = phydev->priv; > + int ret; > + > genphy_resume(phydev); > > /* Enable PHY Interrupts */ > @@ -709,6 +712,18 @@ static int kszphy_resume(struct phy_device *phydev) > phydev->drv->config_intr(phydev); > } > > + if (priv->rmii_ref_clk_sel) { > + ret = kszphy_rmii_clk_sel(phydev, priv->rmii_ref_clk_sel_val); > + if (ret) { > + phydev_err(phydev, > + "failed to set rmii reference clock\n"); > + return ret; > + } > + } > + > + if (priv->led_mode >= 0) > + kszphy_setup_led(phydev, priv->type->led_mode_reg, priv->led_mode); Should not we actually call kszphy_config_init() in order to restore broadcast and nand disable bits as well? If not, I would be more comfortable if we did create a specific function that takes care of setting the reference clock and LED mode. Other than that, LGTM! -- Florian