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.1 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 50174C282C8 for ; Mon, 28 Jan 2019 21:22:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1BB142171F for ; Mon, 28 Jan 2019 21:22:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pto+MQD9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726878AbfA1VWB (ORCPT ); Mon, 28 Jan 2019 16:22:01 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:39873 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726744AbfA1VWA (ORCPT ); Mon, 28 Jan 2019 16:22:00 -0500 Received: by mail-wm1-f65.google.com with SMTP id y8so15483748wmi.4 for ; Mon, 28 Jan 2019 13:21:59 -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=CiiemiOtQ6m1Oa0BXzW67mGLVXN0ZECTIwtyhoZEk3I=; b=pto+MQD9yBAo2dEGYWYcQUzGMFuBSxPMSUuD37dX9fniGcN5vjU5+7eWs5LHl3U8ED K5fuc/n+KzXONILe6eq1+TFXYjTmZS1rfYmEW9qi/NcSjVj78OofBuk2rkzMZnRTKpWO ZxFqGN1FQlpr75DLZZGjwdbb8xKC/0pkQ33WltlYa6PNWaWgBsskgQLyz6XeTjFltXji 8ZjhzgZk2Uo6yFRaJQvcApIB3LT00ztU6cwTV7BWOONBGnIjhJZxig5yY7x/0QHKekmp eUKU8w8uM9ZV56VItyj82bKO2imxdB86+7cNogFYmsdHBkcdTxQaD50a3UP1DIBUuMpo M1KA== 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=CiiemiOtQ6m1Oa0BXzW67mGLVXN0ZECTIwtyhoZEk3I=; b=SdyhRGqxMKTQMfUNQtVYsTNgiwTEBS/0drK0cqYJX+XY1pry2I7s10+kxbhjsPEa/p AV9P+CoI9nNOZ0L5q8bN2JP4ZX4hG5CF/+2CGBZfO+EVWyyUC0yKtZXwq/pbLIEksROr GCjQgJgq7bt+bwTRfCLe6IbpXDEdy0JaegSMvdpBmMbyMc6rAy0/ahDYOOqVORjWLJIU 8QQNm7n+WI3JWfsthRm2vTmc49YCpGPbfT5wvZsZsWIVil2AWp9uU2iUSw4mIWsSv5G9 FXQpxjwtX0NQtn7O/l+nqxrng0XihdkpEBm0W6Z1hEjMwXdwFh7dtbBZXR/FOMtRrL4E jN6Q== X-Gm-Message-State: AJcUukdSTO1dEUpTyy0m81NKjWSnTabXqsRiBFcP7goR+2SsBhU2Y1mt EFJYc1qdmrTRa/FhGyLcswSI+lZB X-Google-Smtp-Source: ALg8bN4JQ6s0dMsydMzyzK/UyisgM5vUnbG5ZSGcKjMBtJ/SahhEONHJXn4jwy6j+EX9RpgXyAyxpw== X-Received: by 2002:a1c:2856:: with SMTP id o83mr19938780wmo.45.1548710518423; Mon, 28 Jan 2019 13:21:58 -0800 (PST) Received: from ?IPv6:2003:ea:8bf1:e200:2c9c:e1a3:b321:9449? (p200300EA8BF1E2002C9CE1A3B3219449.dip0.t-ipconnect.de. [2003:ea:8bf1:e200:2c9c:e1a3:b321:9449]) by smtp.googlemail.com with ESMTPSA id h2sm131206714wrv.87.2019.01.28.13.21.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jan 2019 13:21:57 -0800 (PST) Subject: Re: WoL broken in r8169.c since kernel 4.19 To: Marc Haber Cc: "netdev@vger.kernel.org" References: <20190125120210.GC27062@torres.zugschlus.de> <548c1682-ad7c-3a0a-b2ea-2207f328b070@gmail.com> <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> <20190128205957.GI27062@torres.zugschlus.de> From: Heiner Kallweit Message-ID: <48876bf2-19ff-3777-90d1-dfbfe26d01c7@gmail.com> Date: Mon, 28 Jan 2019 22:21:50 +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: <20190128205957.GI27062@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 On 28.01.2019 21:59, Marc Haber wrote: > On Mon, Jan 28, 2019 at 08:02:47PM +0100, Heiner Kallweit wrote: >> One more test .. Can you provide the output of the following under 4.18 and under 4.19? >> It may not apply cleanly, but you get the idea. The message is written when suspending. > > I booted, suspeneded, sent a magic packet that got ignored. I then woke > the box up with the any key, went through the ethtool motions, suspended > again, sent a magic paket that the machine acted on and woke up > > Log says: > 1 [1/4994]mh@fan:~ $ grep 'may wakeup' /var/log/syslog/syslog > Jan 28 21:51:44 fan kernel: [ 77.571211] may wakeup? 0 > Jan 28 21:54:11 fan kernel: [ 183.994131] may wakeup? 1 > [2/4995]mh@fan:~ $ > > Greetings > Marc > Thanks, this makes clearer what's going on. This change to r8169 bde135a672bf ("r8169: only enable PCI wakeups when WOL is active") removed marking the device as wakeup-enabled to work around an issue on certain notebooks (see commit message for details). ethtool doesn't care about the current settings and sets the new ones (wakeup-enabling the device). systemd however checks the current settings and writes new ones only if there's a change. Therefore in your case systemd does nothing and device doesn't get wakeup-enabled. Not totally clear to me is why it works under 4.18. And I wonder why the following didn't work for you, you said it makes no difference. Could you try again the following in addition to the latest debug output statement? drivers/net/ethernet/realtek/r8169.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 3e650bd9e..bd26d3f2e 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -7442,6 +7442,7 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) } tp->saved_wolopts = __rtl8169_get_wol(tp); + device_set_wakeup_enable(&pdev->dev, tp->saved_wolopts); mutex_init(&tp->wk.mutex); INIT_WORK(&tp->wk.work, rtl_task); --