Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3522575imu; Mon, 7 Jan 2019 05:03:30 -0800 (PST) X-Google-Smtp-Source: AFSGD/VTehBibplSFCG9yW366GpwozFe41kGVGf6VyfanXWG68HEfFJ3favCJtCW/ZcQx75jVQsJ X-Received: by 2002:a62:6799:: with SMTP id t25mr62788303pfj.139.1546866210607; Mon, 07 Jan 2019 05:03:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546866210; cv=none; d=google.com; s=arc-20160816; b=exseCdOqa4OWfCRb5NewosHg6YggfMc5qEIM/MXkQgVE9V1l3cAsRKzkp2XaKDoXYa I0H3DqCtXo5cfcFFHjloczd5ncNi56kuSqZuHVjh5gWVnl5ZXxeD+vYPuE45psaZMk44 cAX5rBI1x8JSSWoTlsCGOq3mdZDGkpzxcPwJ25bwLu0AnHkCn9pDN2i9oZqBK3yJBZY5 N3mE48Ji8AT60C9pqDqsgjKU/kd8Ij5ddr6T+UUlor7v/QRjFtfxI8pMcLwx6McCtp8D 1I+iPU33jHQAtbg3byi+AH/0ItKclud2nbDjhL5Ja6Ac4a1x7SzSvTSxvSf5D/xUUzoD llLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=d9SFmh47jGK4u/4A1eiqJ9TzvL2lcVD5OzhrS7uf92Y=; b=GWaK/K4X6/dCK97dWMQVsrrMm4RKT3AB8yRRZSmKjzX/wcM4vMH+SyX9wt1lWWerYP hu++sdYiYaC4gO+wW460skU7ZPcvbbNDXxRMea/UBkRisX7y/qwSikg1ip4Ml3QFT/m7 ZnO6VJaH32wRqRQvuJYpOoEwl4vMIUFxoKhyKKpjDoY1BNDouEhYCOYRIC0mCfDc/GKb wMAp0XEy0UbwoSQL28SMjigh8RY/tBx7BBpmLSGt0MFoqbeYTMRRgTj/RVXgRSClqlco P6McdMSuxYJWBTYMUy4kkmahM6L2LOHffaA5QHy6QaRM1bFaRP5txTGUM++Anh7PPtXn Q7Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="MbXc2/Gc"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l3si3128165pld.229.2019.01.07.05.03.15; Mon, 07 Jan 2019 05:03:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="MbXc2/Gc"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730382AbfAGNAF (ORCPT + 99 others); Mon, 7 Jan 2019 08:00:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:47590 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730361AbfAGNAC (ORCPT ); Mon, 7 Jan 2019 08:00:02 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C3DEE21736; Mon, 7 Jan 2019 13:00:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546866002; bh=mmXLF8aT1pGkw52DP5sy5UWhrhUanjCpYAawrKnBhCA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MbXc2/Gc/xuHRqGXaKeE04TBMxC9Gzvep5uGwdc+mittDp8w3Rofz2Dt/URZo7+SH kq/LShM1Y/13w+9nN9mNfAqE05Xp8eISnx14BoEqYnI4aVVVC0UTG7FmXisrbUSR+z f4ZKiVWC2eyAu2NxnsJ8giSlXl9QnhT5K2YBs9aE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Heiner Kallweit , Kunihiko Hayashi , "David S. Miller" Subject: [PATCH 4.14 014/101] net: phy: Fix the issue that netif always links up after resuming Date: Mon, 7 Jan 2019 13:32:02 +0100 Message-Id: <20190107105332.304954889@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190107105330.372621917@linuxfoundation.org> References: <20190107105330.372621917@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kunihiko Hayashi [ Upstream commit 8742beb50f2db903d3b6d69ddd81d67ce9914453 ] Even though the link is down before entering hibernation, there is an issue that the network interface always links up after resuming from hibernation. If the link is still down before enabling the network interface, and after resuming from hibernation, the phydev->state is forcibly set to PHY_UP in mdio_bus_phy_restore(), and the link becomes up. In suspend sequence, only if the PHY is attached, mdio_bus_phy_suspend() calls phy_stop_machine(), and mdio_bus_phy_resume() calls phy_start_machine(). In resume sequence, it's enough to do the same as mdio_bus_phy_resume() because the state has been preserved. This patch fixes the issue by calling phy_start_machine() in mdio_bus_phy_restore() in the same way as mdio_bus_phy_resume(). Fixes: bc87922ff59d ("phy: Move PHY PM operations into phy_device") Suggested-by: Heiner Kallweit Signed-off-by: Kunihiko Hayashi Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/phy/phy_device.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -159,11 +159,8 @@ static int mdio_bus_phy_restore(struct d if (ret < 0) return ret; - /* The PHY needs to renegotiate. */ - phydev->link = 0; - phydev->state = PHY_UP; - - phy_start_machine(phydev); + if (phydev->attached_dev && phydev->adjust_link) + phy_start_machine(phydev); return 0; }