From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03D16C169C4 for ; Tue, 29 Jan 2019 19:01:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BEC7620844 for ; Tue, 29 Jan 2019 19:01:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kUOun83g" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727229AbfA2TBY (ORCPT ); Tue, 29 Jan 2019 14:01:24 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:42465 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726910AbfA2TBY (ORCPT ); Tue, 29 Jan 2019 14:01:24 -0500 Received: by mail-wr1-f68.google.com with SMTP id q18so23301971wrx.9 for ; Tue, 29 Jan 2019 11:01:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=g3gDzity2achMgnU6OvNZso1LXSahqmPwEJBEeWbFoY=; b=kUOun83gZuTEjelhaGcPeF1pj24vSNk+/nxrMDGJXq19l4GE6SfzdLQV5uFkl84WCf 5iZb+Mo0XovH0Yq5sc4RHrsMwPvr7xCrBuKvHRU0PU5lJXXSnBKO8XjynzhmmLxGVikW uDY3TCkEjGrmmHLhnk0LCn7fgeNv7GtSZSLC//1e3hZdm4G4W3uf2WZCDuvZ5PbQ2aC7 eXukwtGY+D1WKkz8YHl5jJMpPHHSv8bqca2Aa4AuOs93f5SKYdBk/IxXaHOgFFyCKRcZ 8DHw53yoPPIEsR/CDnfsYldNOWkPhAYYJ8v0q8Vg0DHsTJz9+G/BSBVX3mFjdTWSvU4q yxzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=g3gDzity2achMgnU6OvNZso1LXSahqmPwEJBEeWbFoY=; b=mckAmTBzPRMvzduprBnKIr68JTplYCjV5IMRasQgOePtTVBm5EouIq3OIkEdJlA5Ww /wJk58qXOHz/K2QYQbXSAeyTwqGmJlmhmPRU/+drMwX0b3RgJUAg0sbq0yKK2zqEO8Xy 6Zi2pkcZQrnBgveW0QPpF62gfqdquxZQ8OwLdVoQ2QBQBxUlb94EhpWd+x6GVq0DdGAg jsHPW1rB/Z2QjzLp1Pv8xnH6T+/hOhDYLGkJ9zzHYxdn5u01Kb2n4ncsVQWtAsmJCp+B 2zCzdRlZNln5KzttMxiBnMGHUUQtu8ZWkNJ0EfNCWymlEQFDf4mjXQ+zcElacPPNyqaz ToIw== X-Gm-Message-State: AJcUukfxOuAHWF122S2ybXOakOh/2MdILEWELLlyCCun3A86s41r5Mc8 YBTr4bXLMsjSNaJTtuT7v3gEasbA X-Google-Smtp-Source: ALg8bN7J1eFbYEcM+WmGmzeW4+iO2hDEIMmsXXM7CFEoKjeYPrIGy/ZJQZSJ1+tYez1YNtxz2LYfzw== X-Received: by 2002:a5d:4dc8:: with SMTP id f8mr27732644wru.45.1548788481338; Tue, 29 Jan 2019 11:01:21 -0800 (PST) Received: from ?IPv6:2003:ea:8bf1:e200:ec14:5b59:80e3:7bca? (p200300EA8BF1E200EC145B5980E37BCA.dip0.t-ipconnect.de. [2003:ea:8bf1:e200:ec14:5b59:80e3:7bca]) by smtp.googlemail.com with ESMTPSA id x15sm160792665wrs.27.2019.01.29.11.01.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jan 2019 11:01:20 -0800 (PST) Subject: Re: WoL broken in r8169.c since kernel 4.19 To: Marc Haber Cc: "netdev@vger.kernel.org" References: <20190126135640.GD27062@torres.zugschlus.de> <1a17454a-3017-7283-89d6-206681ca4c47@gmail.com> <20190126170752.GE27062@torres.zugschlus.de> <6ecafe07-3278-a9c4-d76d-971c0df26ce8@gmail.com> <20190127205555.GF27062@torres.zugschlus.de> <64b22f62-ca8a-caee-5a39-f06ffe6598d1@gmail.com> <20190128073010.GG27062@torres.zugschlus.de> <20190128202235.GH27062@torres.zugschlus.de> <20190129073253.GJ27062@torres.zugschlus.de> <20190129153553.GL27062@torres.zugschlus.de> From: Heiner Kallweit Message-ID: <1f40f95a-f595-45f5-5641-9eb4837da71e@gmail.com> Date: Tue, 29 Jan 2019 20:01:14 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190129153553.GL27062@torres.zugschlus.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi Marc, the change to replace __rtl8169_set_wol(tp, 0) doesn't seem to be the right commit because it was included in 4.18 already. And if you read the commit description you'll see that it was replaced because it caused issues with certain boards. Having said that it's not an option for us. Still I'm struggling to see where the relevant difference between 4.18 and 4.19 is. Especially as 4.19 and also later versions work perfectly fine here. Can you in addition apply the following (again it may not apply cleanly) and provide the results for 4.18 and 4.19? And from today's run, can you provide the full dmesg output? I'd like to check why the message was written on resume only. Heiner --- drivers/net/ethernet/realtek/r8169.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index bd26d3f2e..e9c37f10c 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -1414,6 +1414,8 @@ static void rtl8169_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) wol->supported = WAKE_ANY; wol->wolopts = tp->saved_wolopts; rtl_unlock_work(tp); + + pr_info("get_wol: 0x%08x\n", wol->wolopts); } static void __rtl8169_set_wol(struct rtl8169_private *tp, u32 wolopts) @@ -1491,6 +1493,8 @@ static int rtl8169_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) struct rtl8169_private *tp = netdev_priv(dev); struct device *d = tp_to_dev(tp); + pr_info("set_wol: 0x%08x\n", wol->wolopts); + if (wol->wolopts & ~WAKE_ANY) return -EINVAL; -- 2.20.1 On 29.01.2019 16:35, Marc Haber wrote: > Hi, > > after having a good night's sleep over that, it's obviously a merge > commit which cannot easily be reverted. How would I continue after > identifying a merge commit as the culprit? > > On Tue, Jan 29, 2019 at 08:32:53AM +0100, Marc Haber wrote: >> According to bisect, the first bad commit is >> 19725496da5602b401eae389736ab00d1817e264 >> >> commit 19725496da5602b401eae389736ab00d1817e264 >> Merge: aea5f654e6b7 9981b4fb8684 > > git diff aea5f654e6b7..19725496da5602b401eae389736ab00d1817e264, > filtered for r8169 looks manageable: > > --- a/drivers/net/ethernet/realtek/r8169.c > +++ b/drivers/net/ethernet/realtek/r8169.c > @@ -7396,8 +7396,7 @@ static int rtl_init_one(struct pci_dev *pdev, const struc > return rc; > } > > - /* override BIOS settings, use userspace tools to enable WOL */ > - __rtl8169_set_wol(tp, 0); > + tp->saved_wolopts = __rtl8169_get_wol(tp); > > mutex_init(&tp->wk.mutex); > u64_stats_init(&tp->rx_stats.syncp); > > but the other one seems unmanageably big: > > [18/5009]mh@fan:~/linux/git/linux (master % u=) $ git diff 9981b4fb8684..19725496da5602b401eae389736ab00d1817e264 -- drivers/net/ethernet/realtek/r8169.c | diffstat > r8169.c | 815 ++++++++++++++++++---------------------------------------------- > 1 file changed, 234 insertions(+), 581 deletions(-) > [19/5009]mh@fan:~/linux/git/linux (master % u=) $ > > ------- > But, indeed, adding the call to __rtl8169_set_wol(tp, 0) fixes the issue > for me and the machine now wakes up from StR on a magic packet without > having to go through strange ethtool motions. > ------- > > Would that code change be suitable for the official kernel cod? > > Greetings > Marc >