Return-Path: Received: from mail-by2nam01on0139.outbound.protection.outlook.com ([104.47.34.139]:60384 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932206AbeARVAc (ORCPT ); Thu, 18 Jan 2018 16:00:32 -0500 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Florian Fainelli , "David S . Miller" , Sasha Levin Subject: [added to the 4.1 stable tree] net: bcmgenet: Do not suspend PHY if Wake-on-LAN is enabled Date: Thu, 18 Jan 2018 20:59:55 +0000 Message-ID: <20180118205908.3220-59-alexander.levin@microsoft.com> References: <20180118205908.3220-1-alexander.levin@microsoft.com> In-Reply-To: <20180118205908.3220-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Florian Fainelli This patch has been added to the stable tree. If you have any objections, please let us know. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ Upstream commit 5371bbf4b295eea334ed453efa286afa2c3ccff3 ] Suspending the PHY would be putting it in a low power state where it may no longer allow us to do Wake-on-LAN. Fixes: cc013fb48898 ("net: bcmgenet: correctly suspend and resume PHY devic= e") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/e= thernet/broadcom/genet/bcmgenet.c index a9fcac044e9e..add05e743b6c 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -3234,7 +3234,8 @@ static int bcmgenet_suspend(struct device *d) =20 bcmgenet_netif_stop(dev); =20 - phy_suspend(priv->phydev); + if (!device_may_wakeup(d)) + phy_suspend(priv->phydev); =20 netif_device_detach(dev); =20 @@ -3331,7 +3332,8 @@ static int bcmgenet_resume(struct device *d) =20 netif_device_attach(dev); =20 - phy_resume(priv->phydev); + if (!device_may_wakeup(d)) + phy_resume(priv->phydev); =20 if (priv->eee.eee_enabled) bcmgenet_eee_enable_set(dev, true); --=20 2.11.0