Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp962888pxu; Wed, 2 Dec 2020 07:42:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJzIsazc6ju228ERvwpelGDrwUXyL3p1qV+AbeSEoEbLefk2dPZlG4buxr7qg/bEjwfyXJtt X-Received: by 2002:a17:906:90d6:: with SMTP id v22mr394059ejw.88.1606923767034; Wed, 02 Dec 2020 07:42:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606923767; cv=none; d=google.com; s=arc-20160816; b=m9KDon/WTG5yQme3gArKKfg4RtA1U0V6U/h6DjXIjmlLemBwpjvljmDoTTc8zxaL+4 mxsrACf4zCSvKrOupHVefkC4NV803+EsdRKcsmoqbXX63OZfCYAZkzxBN3a3+8HlUFfd +8jHgAtcBKk/KQ/O85sQ0DRVrsDAVVXn7nISZHC9rzMLMbVrO9ZHxKTMMbWvR23ZZXdn Y3XGoOYf02QWSDYhUd4qiTlPb8pSyLmo7SfzbR+Bz6lWYuvbSfgUMhZ66sJs+w/qf3bw oczTjkg5PV0wQg1BGLY5YYP4bK9418SdIo4Es+mYwex6Gu0G6nR22LsUAbCfKnwjh3PX ZSPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=LrZ0VsXvudr8Kpqd+68T3tZBJJjoOP3hPp5j23HPahg=; b=uGAeu3GzZV/Wftkko4Cu6fB83Fg+8cKIWBEK8mEtPEbOrKahAlqzjUh29TN5W39/o2 bRYfxTHW6+1bRoUNC8Cva40XSmAskUfHULujzER5Uga6EVCI7OENn4wx/gihHEjEtx/c 7T3Je54PgywKvyeTdCuQcNFkf5VuqO1TkWIV/E4UiRM0FaaLz6DfbrjYHs3M3a+pHGph 7Dx5qhnxGlWB8xk3MqqITIZgBJZNQUiqsiFmqpJAybTimdPQ1XRShchr5xp2B1BDdefy pcmD5sN4z1RIT/rLBUrvLsRd7liZOBbihRfw9pdKNLreo+fvKAX5FKdFlK3Y0t0YJM0S AyTA== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v8si192788ejj.305.2020.12.02.07.42.23; Wed, 02 Dec 2020 07:42:47 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730524AbgLBPin (ORCPT + 99 others); Wed, 2 Dec 2020 10:38:43 -0500 Received: from mga03.intel.com ([134.134.136.65]:39502 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727699AbgLBPim (ORCPT ); Wed, 2 Dec 2020 10:38:42 -0500 IronPort-SDR: awMpY4ry1V1+L8ZkH09QbH3MXispx3mbQlfMLQtb3yoSOZrliD7gj4ho99Cc7T/Dlgi0ih8JsH sdeCMwFOu1Ig== X-IronPort-AV: E=McAfee;i="6000,8403,9823"; a="173132249" X-IronPort-AV: E=Sophos;i="5.78,387,1599548400"; d="scan'208";a="173132249" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2020 07:38:00 -0800 IronPort-SDR: ug/EuDJ5RuAzG+MVKRDo3eqBUamL0BzqxYq9Qqm+l+QXBJOeXqOgDlDaGzOi+kNFnWnZKrFvpA Tx6DOD6g1mcQ== X-IronPort-AV: E=Sophos;i="5.78,387,1599548400"; d="scan'208";a="550104523" Received: from chenyu-office.sh.intel.com ([10.239.158.173]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2020 07:37:57 -0800 Date: Wed, 2 Dec 2020 23:40:46 +0800 From: Chen Yu To: Kai-Heng Feng Cc: Jesse Brandeburg , Tony Nguyen , Jakub Kicinski , Paul Menzel , "David S. Miller" , "Rafael J. Wysocki" , Len Brown , "Neftin, Sasha" , "Kirsher, Jeffrey T" , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Brandt, Todd E" Subject: Re: [PATCH 1/2][v3] e1000e: Leverage direct_complete to speed up s2ram Message-ID: <20201202154046.GA17693@chenyu-office.sh.intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kai-Heng, On Wed, Dec 02, 2020 at 09:06:19PM +0800, Kai-Heng Feng wrote: > > --- > > v2: Added test data and some commit log revise(Paul Menzel) > > Only skip the suspend/resume if the NIC is not a wake up device specified > > by the user(Kai-Heng Feng) > > v3: Leverage direct complete mechanism to skip all hooks(Kai-Heng Feng) > > --- > > > > - dev_pm_set_driver_flags(&pdev->dev, DPM_FLAG_NO_DIRECT_COMPLETE); > > + dev_pm_set_driver_flags(&pdev->dev, DPM_FLAG_SMART_PREPARE); > > This isn't required for pci_pm_prepare() to use driver's .prepare callback. > pci_pm_prepare() is likely to return 1 even if driver's prepare() return 0, when DPM_FLAG_SMART_PREPARE is not set, which might cause prblems: if (!error && dev_pm_test_driver_flags(dev, DPM_FLAG_SMART_PREPARE)) return 0; > > > > if (pci_dev_run_wake(pdev) && hw->mac.type < e1000_pch_cnp) > > pm_runtime_put_noidle(&pdev->dev); > > @@ -7890,6 +7897,7 @@ MODULE_DEVICE_TABLE(pci, e1000_pci_tbl); > > > > static const struct dev_pm_ops e1000_pm_ops = { > > #ifdef CONFIG_PM_SLEEP > > + .prepare = e1000e_pm_prepare, > > How do we make sure a link change happened in S3 can be detect after resume, without a .complete callback which ask device to runtime resume? > The pm core's device_complete() has already done that pm_runtime_put() in the end. Just talked to Rafael and he might also give some feedbacks later. thanks, Chenyu > Kai-Heng > >