Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b532c900 authored by Suraj Jaiswal's avatar Suraj Jaiswal Committed by Gerrit - the friendly Code Review server
Browse files

net: stmmac: LPM link detection fix



Fix Link detection issue after suspend resume.

Change-Id: If2bd3825225bb17689709cdc226eeea827ff4bf3
Acked-by: default avatarNagarjuna Chaganti <nchagant@qti.qualcomm.com>
Signed-off-by: default avatarSuraj Jaiswal <jsuraj@codeaurora.org>
parent 8f1ad5f7
Loading
Loading
Loading
Loading
+14 −2
Original line number Original line Diff line number Diff line
@@ -4806,6 +4806,11 @@ int stmmac_suspend(struct device *dev)


	phylink_mac_change(priv->phylink, false);
	phylink_mac_change(priv->phylink, false);


#ifdef CONFIG_DWMAC_QCOM_ETHQOS
	rtnl_lock();
	phylink_stop(priv->phylink);
	rtnl_unlock();
#endif
	mutex_lock(&priv->lock);
	mutex_lock(&priv->lock);


	netif_device_detach(ndev);
	netif_device_detach(ndev);
@@ -4825,9 +4830,11 @@ int stmmac_suspend(struct device *dev)
		priv->irq_wake = 1;
		priv->irq_wake = 1;
	} else {
	} else {
		mutex_unlock(&priv->lock);
		mutex_unlock(&priv->lock);
#ifndef CONFIG_DWMAC_QCOM_ETHQOS
		rtnl_lock();
		rtnl_lock();
		phylink_stop(priv->phylink);
		phylink_stop(priv->phylink);
		rtnl_unlock();
		rtnl_unlock();
#endif
		mutex_lock(&priv->lock);
		mutex_lock(&priv->lock);


		stmmac_mac_set(priv, priv->ioaddr, false);
		stmmac_mac_set(priv, priv->ioaddr, false);
@@ -4925,13 +4932,18 @@ int stmmac_resume(struct device *dev)
	stmmac_start_all_queues(priv);
	stmmac_start_all_queues(priv);


	mutex_unlock(&priv->lock);
	mutex_unlock(&priv->lock);

#ifndef CONFIG_DWMAC_QCOM_ETHQOS
	if (!device_may_wakeup(priv->device)) {
	if (!device_may_wakeup(priv->device)) {
		rtnl_lock();
		rtnl_lock();
		phylink_start(priv->phylink);
		phylink_start(priv->phylink);
		rtnl_unlock();
		rtnl_unlock();
	}
	}

#endif
#ifdef CONFIG_DWMAC_QCOM_ETHQOS
		rtnl_lock();
		phylink_start(priv->phylink);
		rtnl_unlock();
#endif
	phylink_mac_change(priv->phylink, true);
	phylink_mac_change(priv->phylink, true);


	return 0;
	return 0;