Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1580827

[PATCH 5/8] net: stmmac: run stmmac_hw_fix_mac_speed when speed is valid

From Corentin Labbe <clabbe.montjoie@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 5/8] net: stmmac: run stmmac_hw_fix_mac_speed when speed is valid
Date 2017-02-14 21:10 +0100
Message-ID <taRAe-6la-25@gated-at.bofh.it> (permalink)
References <taRqy-62G-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


This patch mutualise a bit by running stmmac_hw_fix_mac_speed() after
the switch in case of valid speed.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index f7664b9..bebe810 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -719,7 +719,6 @@ static void stmmac_adjust_link(struct net_device *dev)
 				if (priv->plat->has_gmac ||
 				    priv->plat->has_gmac4)
 					ctrl &= ~priv->hw->link.port;
-				stmmac_hw_fix_mac_speed(priv);
 				break;
 			case 100:
 			case 10:
@@ -734,7 +733,6 @@ static void stmmac_adjust_link(struct net_device *dev)
 				} else {
 					ctrl &= ~priv->hw->link.port;
 				}
-				stmmac_hw_fix_mac_speed(priv);
 				break;
 			default:
 				netif_warn(priv, link, priv->dev,
@@ -742,7 +740,8 @@ static void stmmac_adjust_link(struct net_device *dev)
 				phydev->speed = SPEED_UNKNOWN;
 				break;
 			}
-
+			if (phydev->speed != SPEED_UNKNOWN)
+				stmmac_hw_fix_mac_speed(priv);
 			priv->speed = phydev->speed;
 		}
 
-- 
2.10.2

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/8] net: stmmac: misc patchs Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-02-14 21:00 +0100
  [PATCH 3/8] net: stmmac: use SPEED_UNKNOWN/DUPLEX_UNKNOWN Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-02-14 21:00 +0100
  [PATCH 4/8] net: stmmac: set speed at SPEED_UNKNOWN in case of broken speed Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-02-14 21:00 +0100
  [PATCH 2/8] net: stmmac: likely is useless in occasional function Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-02-14 21:00 +0100
  [PATCH 6/8] net: stmmac: split the stmmac_adjust_link 10/100 case Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-02-14 21:00 +0100
  [PATCH 7/8] net: stmmac: reduce indentation by adding a continue Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-02-14 21:10 +0100
  [PATCH 5/8] net: stmmac: run stmmac_hw_fix_mac_speed when speed is valid Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-02-14 21:10 +0100
  [PATCH 8/8] net: stmmac: invert the logic for dumping regs Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-02-14 21:10 +0100
  Re: [PATCH 0/8] net: stmmac: misc patchs Giuseppe CAVALLARO <peppe.cavallaro@st.com> - 2017-02-15 07:40 +0100
    Re: [PATCH 0/8] net: stmmac: misc patchs Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-02-15 08:40 +0100
      Re: [PATCH 0/8] net: stmmac: misc patchs Giuseppe CAVALLARO <peppe.cavallaro@st.com> - 2017-02-15 10:20 +0100

csiph-web