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 688BDC282C0 for ; Fri, 25 Jan 2019 18:22:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 39610218A6 for ; Fri, 25 Jan 2019 18:22:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lvKV/vl/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728907AbfAYSWp (ORCPT ); Fri, 25 Jan 2019 13:22:45 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:53786 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726252AbfAYSWo (ORCPT ); Fri, 25 Jan 2019 13:22:44 -0500 Received: by mail-wm1-f68.google.com with SMTP id d15so7686792wmb.3 for ; Fri, 25 Jan 2019 10:22:43 -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=ylFIlzRFLk8R41+qnyqjYx+SkLf67tSIHxsX5ruw1oQ=; b=lvKV/vl/1g0zCvMtU0aapdlrAtTjzCLIf9CHBkWuBkz4GsKAfdF4QbUJX69SoQ+0Al OpeAG9YLu3kNRuCwgnXtXmGyBFheQQMg1o/L7sQzg88XGJoQNkWfrRgRSwZoWIdZG7QH nbnX5/XHhVw96yyxncpl3IxKZu6s6d/oNSbok/bWaaWcMsGwShBtavTtGCSc4LtudSpM 1F1IdIo3Mhyxe9Wn7U3euXi80ihNZ3yj0B8Hh415nZpTqeJxyc109+ExFwqNOf9ge0qp 9OqiHVm6X5EBWONJIILa9FEW4cPaEJ5lSqk2DeIolKyq0oPnUx5FopmutChhwOZRUEq1 gJUw== 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=ylFIlzRFLk8R41+qnyqjYx+SkLf67tSIHxsX5ruw1oQ=; b=jnvfq5lm6rByiYpDYDTz7Ej7DLULIWc4RcLXhwKRV3Mr4595wBmMKLNlcjWmpr79p0 dTqZ5M+7YVRA1SlCo+7yalgg9+NuesooxCasynpXoQy1BU2HDgnoyK2qs8U/C3coFeMl WdvSyt1HujGnDBpad1JRahKUNHeK8h6YNPJWhq4yQFJba8e7T2I33RP2otECmiuqkNFN WyXywWHgclMs/ZfI4ya/+UJf23W9hYnp5+KJILddhIxWEDFYOSlHCobhhoNKyX37DKfd lmT7Sajvq1BdbMK4OEbZ8FsgKKp/Hr8qPRsHD638oCX8VhnZJLSMGhGvFyfvwQQCFhkH aMVw== X-Gm-Message-State: AJcUuke/E2EtCsPNthmJ9FOXFByOdWzlfUZukbQT8Oxz2EbunbJ/Ihpf 7FPoZYBBxAY1bRyOCF2A5UufjMmS X-Google-Smtp-Source: ALg8bN7YvRgIJbK6KoQMhPcYpp8TBCNC3qI0FVJUoIGw8zqZp6/RsVn0THqYfauvjK2n02PGQAwP7g== X-Received: by 2002:a1c:85d2:: with SMTP id h201mr7445545wmd.151.1548440562095; Fri, 25 Jan 2019 10:22:42 -0800 (PST) Received: from ?IPv6:2003:ea:8bf1:e200:fc07:c732:1a36:65ad? (p200300EA8BF1E200FC07C7321A3665AD.dip0.t-ipconnect.de. [2003:ea:8bf1:e200:fc07:c732:1a36:65ad]) by smtp.googlemail.com with ESMTPSA id e27sm128629327wra.67.2019.01.25.10.22.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Jan 2019 10:22:41 -0800 (PST) Subject: Re: WoL broken in r8169.c since kernel 4.19 To: Marc Haber Cc: "netdev@vger.kernel.org" References: <20190112200831.GB20268@torres.zugschlus.de> <20190113160149.GG20268@torres.zugschlus.de> <04cbac76-e0c4-dc97-4a11-0dc7d85be276@gmail.com> <20190122161005.GA27062@torres.zugschlus.de> <3c3249f8-6e09-43a7-e4e2-f4fc2b9531ab@gmail.com> <20190125055919.GB27062@torres.zugschlus.de> <6ae02156-8903-70fd-675f-a5aee9c452b4@gmail.com> <20190125120210.GC27062@torres.zugschlus.de> From: Heiner Kallweit Message-ID: <548c1682-ad7c-3a0a-b2ea-2207f328b070@gmail.com> Date: Fri, 25 Jan 2019 19:22:36 +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: <20190125120210.GC27062@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 25.01.2019 13:02, Marc Haber wrote: > On Fri, Jan 25, 2019 at 07:49:56AM +0100, Heiner Kallweit wrote: >> thanks a lot for the detailed analysis. That this ethtool sequence >> >> ethtool -s wol d >> ethtool -s wol g >> >> helps makes me think that the following patch should help too. >> Could you please test? > > That patch didn't apply cleanly because the rtl_init_one in kernel > 4.20.4 is missing the INIT_WORK call at this place. > > And it doesn't change the behavior, the two ethtool calls are needed so > that the host wakes up from suspend to ram on a magic packet. > Then I'm slowly running out of ideas. New in 4.19 is a check for invalid WoL flags, but usually the caller should warn if -EINVAL is returned. Nevertheless, could you try the following and check whether the warning is triggered? --- drivers/net/ethernet/realtek/r8169.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 04c403539..a27cfc6e7 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -1491,8 +1491,10 @@ 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); - if (wol->wolopts & ~WAKE_ANY) + if (wol->wolopts & ~WAKE_ANY) { + pr_warn("invalid WoL value: 0x%08x\n", wol->wolopts); return -EINVAL; + } pm_runtime_get_noresume(d); -- 2.20.1 > Greetings > Marc > Heiner