Message ID | 1376894288-31279-1-git-send-email-peppe.cavallaro@st.com |
---|---|
State | Changes Requested, archived |
Delegated to: | David Miller |
Headers | show |
Hello. On 08/19/2013 10:38 AM, Giuseppe CAVALLARO wrote: > This patch is to disable the EEE (so HW and timers) > for example when the phy communicates that the EEE > can be supported nomore. > Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> > --- > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 24 ++++++++++++++++---- > 1 files changed, 19 insertions(+), 5 deletions(-) > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > index 0a9bb9d..75cc2d3 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c [...] > @@ -2166,7 +2181,6 @@ static int stmmac_poll(struct napi_struct *napi, int budget) > static void stmmac_tx_timeout(struct net_device *dev) > { > struct stmmac_priv *priv = netdev_priv(dev); > - > /* Clear Tx resources and restart transmitting again */ Why? This seems unneeded change. WBR, Sergei -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Date: Mon, 19 Aug 2013 22:44:24 +0400 >> @@ -2166,7 +2181,6 @@ static int stmmac_poll(struct napi_struct *napi, >> int budget) >> static void stmmac_tx_timeout(struct net_device *dev) >> { >> struct stmmac_priv *priv = netdev_priv(dev); >> - >> /* Clear Tx resources and restart transmitting again */ > > Why? This seems unneeded change. Agreed, not only was this code properly styled already, changing it is totally unrelated to what this patch is supposed to be doing. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 0a9bb9d..75cc2d3 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -285,10 +285,25 @@ bool stmmac_eee_init(struct stmmac_priv *priv) /* MAC core supports the EEE feature. */ if (priv->dma_cap.eee) { + int tx_lpi_timer = priv->tx_lpi_timer; + /* Check if the PHY supports EEE */ - if (phy_init_eee(priv->phydev, 1)) + if (phy_init_eee(priv->phydev, 1)) { + /* To manage at run-time if the EEE cannot be supported + * anymore (for example becasue the lp caps have been + * changed). + * In that case the driver disable own timers. + */ + if (priv->eee_active) { + pr_debug("stmmac: disable EEE\n"); + del_timer_sync(&priv->eee_ctrl_timer); + priv->hw->mac->set_eee_timer(priv->ioaddr, 0, + tx_lpi_timer); + } + priv->eee_active = 0; goto out; - + } + /* Activate the EEE and start timers */ if (!priv->eee_active) { priv->eee_active = 1; init_timer(&priv->eee_ctrl_timer); @@ -299,13 +314,13 @@ bool stmmac_eee_init(struct stmmac_priv *priv) priv->hw->mac->set_eee_timer(priv->ioaddr, STMMAC_DEFAULT_LIT_LS, - priv->tx_lpi_timer); + tx_lpi_timer); } else /* Set HW EEE according to the speed */ priv->hw->mac->set_eee_pls(priv->ioaddr, priv->phydev->link); - pr_info("stmmac: Energy-Efficient Ethernet initialized\n"); + pr_debug("stmmac: Energy-Efficient Ethernet initialized\n"); ret = true; } @@ -2166,7 +2181,6 @@ static int stmmac_poll(struct napi_struct *napi, int budget) static void stmmac_tx_timeout(struct net_device *dev) { struct stmmac_priv *priv = netdev_priv(dev); - /* Clear Tx resources and restart transmitting again */ stmmac_tx_err(priv); }
This patch is to disable the EEE (so HW and timers) for example when the phy communicates that the EEE can be supported nomore. Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 24 ++++++++++++++++---- 1 files changed, 19 insertions(+), 5 deletions(-)