Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2142394yba; Fri, 10 May 2019 06:58:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqyKkx6CcnnWFmWNVQI/kgIJ3jGAtJFKDoQj0950SwyDzNuR/rDQ1UN4XGxxQIP8QTt4AhXq X-Received: by 2002:a63:1e0c:: with SMTP id e12mr13145624pge.218.1557496721935; Fri, 10 May 2019 06:58:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557496721; cv=none; d=google.com; s=arc-20160816; b=RtQQRTpXW5dPjV3ZgekDvl3S0qK0twtXIyT5lEHNaRGim460YAiBjwLTYV3tmBSgVg 6AHWofVxb2uH3DksjOLjfbpHOACMW0fAsleJnFRskSdTP5RO2BAF7tO3N8hia3biBD0G Tadc21hx4E69wjFcVGe8VwJ4NN8Zk/ggy8fqCU5e4xkKp95pOfPS6EvDwYjV2FyblkWl bI096v0/f1JXDH8iw6hlZwRT665a9Z2pHaShK+v+vHSDBi7E9yH9saIs8rhhg5haU1gB S+IdIJDXjKV/OpSF343bxWDjycO6LmT+58xVwUvM3U47KJXq488SFhiF+q5bfXuNTW8+ IUdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=923Rkn4PUKJ+U7EimcMl5zuqtYidkNKi6d4oTyRj/X0=; b=OwKTFDWv4PG4emdkoph9oIrWdVaeELlKcbizn9Inwf97FE+kBbBeLota57SMoJFAKj 8+K8LkFsUZuunA86LwrXNGoO58ebUECcxUmkg8gvwyh94KQm9//2aXHWwZPWiaDmoEiW qbgfLITzUavZMP48n+wLA7w03it8tqEMRL9cNY36J9yARmediCMkoKXS7TDhv8mSe8/D C+/25uj9WVo7EraH8+jSHcSbopMBAJ5Sd0Svan6QRJvqwIPaXlcmIQepyinOVe00971y Nah3Jq36Qg3IT/GYd78BUscKT1hHEyBWB7xMH5NDrAXLEnXFx7WAoiby48B62ujTVCM+ bnSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a4si7340219pgt.9.2019.05.10.06.58.25; Fri, 10 May 2019 06:58:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727826AbfEJN5K (ORCPT + 99 others); Fri, 10 May 2019 09:57:10 -0400 Received: from mga17.intel.com ([192.55.52.151]:52402 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727425AbfEJN5I (ORCPT ); Fri, 10 May 2019 09:57:08 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 May 2019 06:57:08 -0700 X-ExtLoop1: 1 Received: from unknown (HELO localhost.localdomain) ([10.232.112.69]) by fmsmga007.fm.intel.com with ESMTP; 10 May 2019 06:57:07 -0700 Date: Fri, 10 May 2019 07:51:39 -0600 From: Keith Busch To: Christoph Hellwig Cc: "Mario.Limonciello@dell.com" , "kai.heng.feng@canonical.com" , "axboe@fb.com" , "sagi@grimberg.me" , "rafael@kernel.org" , "linux-pm@vger.kernel.org" , "Wysocki, Rafael J" , "linux-kernel@vger.kernel.org" , "linux-nvme@lists.infradead.org" , "Busch, Keith" Subject: Re: [PATCH] nvme-pci: Use non-operational power state instead of D3 on Suspend-to-Idle Message-ID: <20190510135139.GE9675@localhost.localdomain> References: <064701C3-2BD4-4D93-891D-B7FBB5040FC4@canonical.com> <20190509095601.GA19041@lst.de> <225CF4F7-C8E1-4C66-B362-97E84596A54E@canonical.com> <20190509103142.GA19550@lst.de> <31b7d7959bf94c15a04bab0ced518444@AUSX13MPC101.AMER.DELL.COM> <20190509192807.GB9675@localhost.localdomain> <20190510053052.GB3654@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190510053052.GB3654@lst.de> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 09, 2019 at 10:30:52PM -0700, Christoph Hellwig wrote: > Also I don't see any reason why we'd need to do the freeze game on > resume. Right, definitely no reason for resume. > Even on suspend it looks a little odd to me, as in theory > the PM core should have already put the system into a quiescent state. > But maybe we actually need it there, in which case a comment would > be helpful. I wasn't sure if suspend prevents a kthread or work queue from running. For example, if the device sends a namespace notify AEN during S2I, does the nvme scan_work run? Since I wasn't sure, I took a paranoid approach to ensure nothing was in flight, but I'd be happy if this is unnecessary. > > + if (!pm_suspend_via_firmware()) > > + return nvme_set_power(&ndev->ctrl, 0); > > Don't we need to save the previous power state here and restore that? > For example if someone set a specific state through nvme-cli? Sure, we can do that. It would have been super if the spec had this set feature command's CQE DW0 return the previous power state so we could set the new and save the old in a single command, but two commands is just a minor inconvenience.