aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose Abreu <jose.abreu@synopsys.com>2019-01-09 04:05:59 -0500
committerDavid S. Miller <davem@davemloft.net>2019-01-11 18:35:06 -0500
commit3b5094665e273c4a2a99f7f5f16977c0f1e19095 (patch)
treea436c066a196e85b476d6f6c416f81550527453b
parent0650d4017f4d2eee67230a02285a7ae5204240c2 (diff)
net: stmmac: Fix the logic of checking if RX Watchdog must be enabled
RX Watchdog can be disabled by platform definitions but currently we are initializing the descriptors before checking if Watchdog must be disabled or not. Fix this by checking earlier if user wants Watchdog disabled or not. Cc: Joao Pinto <jpinto@synopsys.com> Cc: David S. Miller <davem@davemloft.net> Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com> Cc: Alexandre Torgue <alexandre.torgue@st.com> Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 0e0a0789c2ed..83ceb1a12e77 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -4168,6 +4168,18 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
4168 return ret; 4168 return ret;
4169 } 4169 }
4170 4170
4171 /* Rx Watchdog is available in the COREs newer than the 3.40.
4172 * In some case, for example on bugged HW this feature
4173 * has to be disable and this can be done by passing the
4174 * riwt_off field from the platform.
4175 */
4176 if (((priv->synopsys_id >= DWMAC_CORE_3_50) ||
4177 (priv->plat->has_xgmac)) && (!priv->plat->riwt_off)) {
4178 priv->use_riwt = 1;
4179 dev_info(priv->device,
4180 "Enable RX Mitigation via HW Watchdog Timer\n");
4181 }
4182
4171 return 0; 4183 return 0;
4172} 4184}
4173 4185
@@ -4300,18 +4312,6 @@ int stmmac_dvr_probe(struct device *device,
4300 if (flow_ctrl) 4312 if (flow_ctrl)
4301 priv->flow_ctrl = FLOW_AUTO; /* RX/TX pause on */ 4313 priv->flow_ctrl = FLOW_AUTO; /* RX/TX pause on */
4302 4314
4303 /* Rx Watchdog is available in the COREs newer than the 3.40.
4304 * In some case, for example on bugged HW this feature
4305 * has to be disable and this can be done by passing the
4306 * riwt_off field from the platform.
4307 */
4308 if (((priv->synopsys_id >= DWMAC_CORE_3_50) ||
4309 (priv->plat->has_xgmac)) && (!priv->plat->riwt_off)) {
4310 priv->use_riwt = 1;
4311 dev_info(priv->device,
4312 "Enable RX Mitigation via HW Watchdog Timer\n");
4313 }
4314
4315 /* Setup channels NAPI */ 4315 /* Setup channels NAPI */
4316 maxq = max(priv->plat->rx_queues_to_use, priv->plat->tx_queues_to_use); 4316 maxq = max(priv->plat->rx_queues_to_use, priv->plat->tx_queues_to_use);
4317 4317