netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH (net.git) 0/6] stmmac: fix EEE and chained mode
@ 2014-02-26  8:01 Giuseppe Cavallaro
  2014-02-26  8:01 ` [PATCH (net.git) 1/6 (v2)] stmmac: disable at run-time the EEE if not supported Giuseppe Cavallaro
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Giuseppe Cavallaro @ 2014-02-26  8:01 UTC (permalink / raw)
  To: netdev; +Cc: Giuseppe Cavallaro

These are some patches to fix some problem in the driver.
For example the EEE that needs to be disabled if not supported
and the chain mode that is broken and the kernel panics.

Also there are two patches to fix some minor issues in the STi glue-logic.

Giuseppe Cavallaro (6):
  stmmac: disable at run-time the EEE if not supported
  stmmac: fix and better tune the default buffer sizes
  stmmac: dwmac-sti: fix broken STiD127 compatibility
  stmmac: dwmac-sti: remove useless tx_retime_srcs
  stmmac: remove useless check in the stmmac_tx_clean
  stmmac: fix chained mode

 drivers/net/ethernet/stmicro/stmmac/chain_mode.c   |    2 +-
 drivers/net/ethernet/stmicro/stmmac/common.h       |   20 +---
 drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c    |    8 --
 drivers/net/ethernet/stmicro/stmmac/ring_mode.c    |    9 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  |  104 ++++++++++---------
 .../net/ethernet/stmicro/stmmac/stmmac_platform.c  |    2 +-
 6 files changed, 67 insertions(+), 78 deletions(-)

-- 
1.7.4.4

^ permalink raw reply	[flat|nested] 10+ messages in thread
* [PATCH (net.git) 1/6] stmmac: disable at run-time the EEE if not supported
@ 2014-02-25  9:58 Giuseppe Cavallaro
  2014-02-25  9:58 ` [PATCH (net.git) 5/6] stmmac: remove useless check in the stmmac_tx_clean Giuseppe Cavallaro
  0 siblings, 1 reply; 10+ messages in thread
From: Giuseppe Cavallaro @ 2014-02-25  9:58 UTC (permalink / raw)
  To: netdev; +Cc: Giuseppe Cavallaro

This patch is to disable the EEE (so HW and timers)
for example when the phy communicates that the EEE
can be supported anymore.

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 078ad0e..dc89dc3 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -286,10 +286,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 because 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);
@@ -300,13 +315,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;
 	}
@@ -2204,7 +2219,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);
 }
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-02-27  9:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-26  8:01 [PATCH (net.git) 0/6] stmmac: fix EEE and chained mode Giuseppe Cavallaro
2014-02-26  8:01 ` [PATCH (net.git) 1/6 (v2)] stmmac: disable at run-time the EEE if not supported Giuseppe Cavallaro
2014-02-26  8:01 ` [PATCH (net.git) 2/6] stmmac: fix and better tune the default buffer sizes Giuseppe Cavallaro
2014-02-26  8:01 ` [PATCH (net.git) 3/6] stmmac: dwmac-sti: fix broken STiD127 compatibility Giuseppe Cavallaro
2014-02-26  8:01 ` [PATCH (net.git) 4/6] stmmac: dwmac-sti: remove useless tx_retime_srcs Giuseppe Cavallaro
2014-02-26  8:01 ` [PATCH (net.git) 5/6] stmmac: remove useless check in the stmmac_tx_clean Giuseppe Cavallaro
2014-02-26 21:14   ` David Miller
2014-02-27  9:59     ` Giuseppe CAVALLARO
2014-02-26  8:01 ` [PATCH (net.git) 6/6] stmmac: fix chained mode Giuseppe Cavallaro
  -- strict thread matches above, loose matches on Subject: below --
2014-02-25  9:58 [PATCH (net.git) 1/6] stmmac: disable at run-time the EEE if not supported Giuseppe Cavallaro
2014-02-25  9:58 ` [PATCH (net.git) 5/6] stmmac: remove useless check in the stmmac_tx_clean Giuseppe Cavallaro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).