Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2451888imd; Fri, 2 Nov 2018 11:37:59 -0700 (PDT) X-Google-Smtp-Source: AJdET5eclJ188ou9v4OvzfvO+V2g4EiIqS2+1SaW5filfNRW59EyfDEspRnYrTAh4d7lrFESjUTJ X-Received: by 2002:a62:8f8c:: with SMTP id n134-v6mr12940018pfd.258.1541183879594; Fri, 02 Nov 2018 11:37:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541183879; cv=none; d=google.com; s=arc-20160816; b=sok8Q5jEBfHeLtCP1iRD/9WGqzQeC8uKrWpIZmyciTUxqeY6nwNNdtFuZMoxtNvBn5 9h44tr3PQ4yDbVCF7+HrF0865Y8TXqK3Nn6s3WksIXfsysDlRWS+JFn7WYne6PdcnnBm D7pQkPHuftUfy+RtUE8ddFmHWwNXN4Capdiy2PIk47P7b/1aNU23BqtmqftGBFOEX8ZQ /WZs3gqPw7DOQMi1vgA+NoPJ2qqPeAJOHjXt3/yL9gUctFqzM7Uov5FdafE0U74oG8QP m1/3ShkgEe+UMFW054mF/Kz4G3yV1x2VG8WEucL4n/z1Z1Vp/vKa4ITHAdbnlo9fFOr8 kbJQ== 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=HZMTKcsuB/VFRjd5m4qvnY55B1hhIyNaArD+mkAcfbg=; b=v9aFma/QrcuohUo2wL8R7TJKxlX8D8CwndXPQ7w5QYbBN8vWUTTLvGaV0RfXWVbKfM FJh0Lcc4WRah4hmEA/OefjfTFUq/WhExVVLAyyLMeI4dgsqhcIhOPbNCBNb5AV3eDkmY VGypgd8ZNpjp/TdvK+38q1hWFGupavTKPgf7/4N2aDshHUOxoYYaN90eJYfLJgbPi5BI Pi/8v4UIHLA4TOF7mmGcNkdp3v0O1euXleTFVzPD2KJEdzIBeE7Yv5v5cqftSUAQb4M+ BW7tsYJnSiNkPR3318rnWH4SGpCTFsF107M7i/2oVwjksCAPq8Cf5JwW5xN3wrytRLar 24bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2NGo9IlY; 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 d16-v6si35324950pgd.555.2018.11.02.11.37.45; Fri, 02 Nov 2018 11:37:59 -0700 (PDT) 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=2NGo9IlY; 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 S1728498AbeKCDpN (ORCPT + 99 others); Fri, 2 Nov 2018 23:45:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:39000 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727629AbeKCDpN (ORCPT ); Fri, 2 Nov 2018 23:45:13 -0400 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 D3DD42081B; Fri, 2 Nov 2018 18:37:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541183822; bh=/awlyUUM9d7n9POnmphbP2Kt5GrKEI3QrCnFB3zNYS8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2NGo9IlYXjV5B/AkgYrQZ2v+tEEu7dQ9ZoGI1voFYHMOc7r87PNgmwqbfKSM6cJAb nEwK+f3rFgciEC/0LdVYqxWnG/pt8l3/z2mjolEjU3h904SxudTBmNbHAJvr/Z2O8F 3hEVjqGYHcrCeY4o7uKqjoUBGvU95RrTQun2Z0+A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Neil MacLeod , Heiner Kallweit , "David S. Miller" Subject: [PATCH 4.19 18/24] r8169: fix broken Wake-on-LAN from S5 (poweroff) Date: Fri, 2 Nov 2018 19:34:51 +0100 Message-Id: <20181102182842.573472714@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182839.725385066@linuxfoundation.org> References: <20181102182839.725385066@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Heiner Kallweit [ Upstream commit 649f0837a8cc2b39329f2de00fa0d04b029291c5 ] It was reported that WoL from S5 is broken (WoL from S3 works) and the analysis showed that during system shutdown the network interface was brought down already when the actual kernel shutdown started. Therefore netif_running() returned false and as a consequence the PHY was suspended. Obviously WoL wasn't working then. To fix this the original patch needs to be effectively reverted. A side effect is that when normally bringing down the interface and WoL is enabled the PHY will remain powered on (like it was before the original patch). Fixes: fe87bef01f9b ("r8169: don't check WoL when powering down PHY and interface is down") Reported-by: Neil MacLeod Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/realtek/r8169.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -4175,10 +4175,15 @@ static void rtl_wol_suspend_quirk(struct static bool rtl_wol_pll_power_down(struct rtl8169_private *tp) { - if (!netif_running(tp->dev) || !__rtl8169_get_wol(tp)) + struct phy_device *phydev; + + if (!__rtl8169_get_wol(tp)) return false; - phy_speed_down(tp->dev->phydev, false); + /* phydev may not be attached to netdevice */ + phydev = mdiobus_get_phy(tp->mii_bus, 0); + + phy_speed_down(phydev, false); rtl_wol_suspend_quirk(tp); return true;