Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1145050pxu; Fri, 27 Nov 2020 00:20:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzfBkBQTVHRP09tXVMvrAVbMmwtKAD8kH7QYP5+GS9raqQLLM25weIsME+v2oBIs8cajQHl X-Received: by 2002:a17:906:b745:: with SMTP id fx5mr6299907ejb.103.1606465248856; Fri, 27 Nov 2020 00:20:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606465248; cv=none; d=google.com; s=arc-20160816; b=oAnBlJo7fxGjjzP9lWP0hKuy/F9LgBev9pCPR397lIUc1W8Bp9g6ifbBKnPAVN7UF6 NQG6czxT2ahjuiWXHA+O1ArzYy4rddYByr0TEPwhxpWIs0hXseURYlq+qFogiAZfy9tQ 9e1AdCGb8TYPYouC/1dHeKNj+AFQtliuY2Dy1Lu6KVkT8sNorInmrhh0DrG2qIF2q4SC /p5W0GqcuEYnQJO7h0Q0MSYPp7tUyJqx7kulcZ1IHahU3ThxGx0+H1BNMbqf8xejt6tr bvEzY+kLBRUwVXKPCRyrN270P9vYiuiUcu8p93vL+uIS98FyL8IHN04cLlYMQNcaj+aR vJuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=zePcHK4ti1wEDKzVHag7oZPymYOFXDvp22j+0vFPkyw=; b=zI2SRhIQDoVlZwdrPU6Nivrfcei0U5cS38YVaxkaUFZkHblF16Pbx4Ww7vyJ4xKO+i ZwPV1k0euf1MER2X7KaVF4c7vZLBGduljXo2D76RFI5FH4m3ssA9CegWxfXxLrxiWBsF /p31Pv7OF04ctd57UaEueeLkpZS7LUoPQ79W0scpfouPE9zW43G28oa2yIGtkWS7+yCx vLMoiw+m0nVcxfBDjedda/R4AMNuTmbT6XSFR3FzSSaGPKnzG5Az0POlhdmibVIiNUq9 cpBfCtmEP8yxidr6PESRV6OH0pz11U6f6EOUpexyDX66aVJpctg2aZpQ/NQA/Y/uzPJU uMGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f5si5014913edt.134.2020.11.27.00.20.26; Fri, 27 Nov 2020 00:20:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388447AbgKZMFO convert rfc822-to-8bit (ORCPT + 99 others); Thu, 26 Nov 2020 07:05:14 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:43034 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728495AbgKZMFN (ORCPT ); Thu, 26 Nov 2020 07:05:13 -0500 Received: from mail-pl1-f199.google.com ([209.85.214.199]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kiG1Q-0002qS-3H for linux-kernel@vger.kernel.org; Thu, 26 Nov 2020 12:05:12 +0000 Received: by mail-pl1-f199.google.com with SMTP id e11so1423168pld.0 for ; Thu, 26 Nov 2020 04:05:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=2wQOqkLciXhZSa/eX0rv+nPfiTXpG5hQx1UgN703x9c=; b=EDwkTIfdtFyt4w5nEG2N96LFjw92zb0hxRYCF47Sf8k+puZtu3VNQPT4GhQjCHqtSv BheYIyqPfRUNipBBnm226LdWtg+5+X0wJcXCc+r3nNc4T8+bdB4fvB35vamLOlMi6Uvp JCrbblzV05mvYvXI25b8WsAA4Tn19hJInXYplOf0x4f3lwS/CR0DPHqQLi9Tap1oSZw5 sU1r7svS1xyiJ7b8A9BeigA3rHVB2gDeS+sQq5awr88zJnIMIkOIz38O19+8B6R/DaKV 9UMY8WwE1SFAJcOj7ZKqouJq58TAc8aOaXSJ7w8J74Ox74TMem2iSjnuJL3ZDl2vLVvC CC/A== X-Gm-Message-State: AOAM533L8jQu4faGx0aPyOz686O94lsyRjzZWSxxsPF+g4Vae47DAbsb 57dnTqsIvgBRKnl4TS9LLF5OSSBFNJ6iKMF+G8K9uM1j3FBmQoH13HnXoMtOZaz+QKcKGlFo2rZ pEPQ9S2OHYv1iKSWXWfvZ+WFYvA40d5D6B2m0Kgy7Dg== X-Received: by 2002:a17:902:778e:b029:d8:d024:a9a with SMTP id o14-20020a170902778eb02900d8d0240a9amr2482624pll.12.1606392309252; Thu, 26 Nov 2020 04:05:09 -0800 (PST) X-Received: by 2002:a17:902:778e:b029:d8:d024:a9a with SMTP id o14-20020a170902778eb02900d8d0240a9amr2482519pll.12.1606392307554; Thu, 26 Nov 2020 04:05:07 -0800 (PST) Received: from [192.168.1.208] (220-133-187-190.HINET-IP.hinet.net. [220.133.187.190]) by smtp.gmail.com with ESMTPSA id oc13sm6089197pjb.5.2020.11.26.04.05.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Nov 2020 04:05:06 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.20.0.2.21\)) Subject: Re: [PATCH] e1000e: Assign DPM_FLAG_SMART_SUSPEND and DPM_FLAG_MAY_SKIP_RESUME to speed up s2ram From: Kai-Heng Feng In-Reply-To: <20201126111053.GA15841@chenyu-office.sh.intel.com> Date: Thu, 26 Nov 2020 20:05:02 +0800 Cc: "Rafael J. Wysocki" , Len Brown , Tony Nguyen , Jesse Brandeburg , "moderated list:INTEL ETHERNET DRIVERS" , Linux PM list , open list , Sasha Neftin , Jeff Kirsher Content-Transfer-Encoding: 8BIT Message-Id: <43247451-BA44-4958-A921-2BD0FF5FA5BA@canonical.com> References: <20201124153221.11265-1-yu.c.chen@intel.com> <8BA4D1E1-DACF-4E84-A5B8-75A7CEA65F98@canonical.com> <20201125103612.GA17700@chenyu-office.sh.intel.com> <20201126111053.GA15841@chenyu-office.sh.intel.com> To: Chen Yu X-Mailer: Apple Mail (2.3654.20.0.2.21) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Nov 26, 2020, at 19:10, Chen Yu wrote: > > On Thu, Nov 26, 2020 at 02:36:42PM +0800, Kai-Heng Feng wrote: >>>> >>>> What about plugging ethernet cable and using WoL after system is suspended? >>>> Commit "e1000e: Exclude device from suspend direct complete optimization" was to address that scenario. > [cut] >> >> I don't think this is right. >> Isn't E1000_WUFC_LNKC already set for runtime suspend? >> What if WoL doesn't have it set? >> > After re-taking a look at your description, please let me elaborate more about the scenario. > With this patch applied, and with sysfs wake up disabled, the expected behavior is: > > 1. If NIC is not runtime suspended: > 1.1 s2ram suspend -> wufc will be set to 0(no WoL settings), suspend(), suspend_late(), suspend_noirq() > 1.2 s2ram resume -> NIC resumes normaly > > 2. If NIC is runtime suspended: > 2.1 s2ram suspend -> wufc set to E1000_WUFC_LNKC, skip the subsequent suspend callbacks. Is it safe to keep E1000_WUFC_LNKC enabled here? From commit 6bf6be1127f7 ("e1000e: Do not wake up the system via WOL if device wakeup is disabled"): /* Runtime suspend should only enable wakeup for link changes */ if (runtime) wufc = E1000_WUFC_LNKC; else if (device_may_wakeup(&pdev->dev)) wufc = adapter->wol; else wufc = 0; So it has different wakeup settings for runtime suspend and system suspend, either device_may_wakeup() true or false. Or maybe e1000e devs can confirm E1000_WUFC_LNKC is a safe for system suspend? Kai-Heng > 2.2 s2ram resume -> skip the subsequent resume callbacks. > > If between 2.1 and 2.2, the cable is plugged, the user is unable to use WoL to wake up > the system. > > But if the sysfs wake up is enabled, the code logic falls into the old path, and > the user can wake up the system via WoL by plugging the cable, and send packages to the > system. Or do I miss something? > > thanks, > Chenyu > >