Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp561982yba; Thu, 9 May 2019 02:22:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqxSwRJ70LukJwKngFOreZh8LhTDAfLs4rTk9v3BXu9jNa2Ui5SDV6+AtrgIt+dTCAs4mlIr X-Received: by 2002:a17:902:b410:: with SMTP id x16mr3484008plr.174.1557393731250; Thu, 09 May 2019 02:22:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557393731; cv=none; d=google.com; s=arc-20160816; b=wdc3p3ZOEfGu+1AanZTE6q1mtW/j3t/WvZs5CbkSqQATe//XdXmn1hDzhysOxsDxiK SJyWZd978BPtG/cq1FbgKoIf9M/AgyIwzMrCmSBLDWuEKmhURmwbf+ISJuZ4NeXTCd1r aeQ5CAozwtlCkKd6AAaaLUg2q7IEAy8yvOTkXuEjcf4OAmtIJE5KCOOf+c37ao0f3jQX 85PD5hWo6ykv49+u4TMeLS0kxgIp2RHg6xoVS4zQdxMYNqOsprbguBdJpcqr+iNW40Bq sD8tqAfy5ZlnLjOT+pITTZ0BnegV8sr1e+cDWiDFEbZiUBCh3CFHXSka5SQJ8k3lgGzc HqWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=QyP+zc0g7bog0AYk3je1JrjwNT3GExuQ+2KqtL8yxdA=; b=Z3RCuwEKP0XcUqaUQ4DA3hdJAJsU9EgMLf/SEhyNTgLSzPrMEPb8he4jiiOE3CSpV5 B0/xLMtCxYs1ImoWmknmpB0sv/rVxLzfy05I0M1gXs3AzXNGK26cKpVHpAAcIz6kgrOh Ju1/SNnQmkCU2qKx2FPQbCIu42tSuhJXQY3gSjksT4UQk5F7awjssyGlgTTnDMkUogCs AKw6PYp1Qc+Dn0m/YTfz54vNl6Jz87tu8wjM7E7SOFgneLoB6fJZ7zgohYPNRCNEl203 uXIXJONyPxS40OG0rODXazN68DfIlOBs+yyki4VneBWKMydF2ktMwNIN6AdN6X4VdzVX u3YQ== 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 133si2082590pga.130.2019.05.09.02.21.54; Thu, 09 May 2019 02:22:11 -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 S1726179AbfEIJTt convert rfc822-to-8bit (ORCPT + 99 others); Thu, 9 May 2019 05:19:49 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:39656 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725826AbfEIJTt (ORCPT ); Thu, 9 May 2019 05:19:49 -0400 Received: by mail-oi1-f195.google.com with SMTP id x16so1368672oic.6; Thu, 09 May 2019 02:19:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=4keILsDdqaPQc14jyFTpZX6LIK4odMSSe93jLxQHABU=; b=W/XbgC50ALdwluJg8m1rzMozunxBIpTUeZbRPKhhgiDg1S1AU+MvbVsXsAkrVGNi1t pvgyT9rSbhHEHQQUKrbnW407KD7h2u6gcZTXp/oPHSvGDOp5IzmFdAW0RSwTyjctqdhl X8wyCJdQDWR/wIRpgBZWcQ0F9uepetkkSUwhxilL+um7KqtDWPiCdP+CGvuVWY+CP/eV 72K2dCXFCu/cTGnWh4/4cIdUXZ9XV9iNjcFwGyOacM0SvcpRjBiP00YDTOxxsmePvl/F dkWvf5zKSBgorncu5wkgACPcqjsBVBeJlOZ4yE75/AX0XJvalJhcXS1l9/PFSdJ4OR4i YZYg== X-Gm-Message-State: APjAAAXDK50venox4rqDpyXyK/J05ryQeHj23XYLjG/s0+JYvCu7yE8o 81jMfuW3/EpLUUL97YzuSV8g7wCzWbrh9X91H7I= X-Received: by 2002:aca:f444:: with SMTP id s65mr777412oih.115.1557393588629; Thu, 09 May 2019 02:19:48 -0700 (PDT) MIME-Version: 1.0 References: <20190508185955.11406-1-kai.heng.feng@canonical.com> <20190508191624.GA8365@localhost.localdomain> <3CDA9F13-B17C-456F-8CE1-3A63C6E0DC8F@canonical.com> <20190508195159.GA1530@lst.de> <20190509061237.GA15229@lst.de> <064701C3-2BD4-4D93-891D-B7FBB5040FC4@canonical.com> <20190509065223.GA15984@lst.de> In-Reply-To: <20190509065223.GA15984@lst.de> From: "Rafael J. Wysocki" Date: Thu, 9 May 2019 11:19:37 +0200 Message-ID: Subject: Re: [PATCH] nvme-pci: Use non-operational power state instead of D3 on Suspend-to-Idle To: Christoph Hellwig Cc: Kai-Heng Feng , Rafael Wysocki , Mario Limonciello , Keith Busch , Keith Busch , Jens Axboe , Sagi Grimberg , linux-nvme , Linux PM , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 9, 2019 at 8:52 AM Christoph Hellwig wrote: > > On Thu, May 09, 2019 at 02:48:59PM +0800, Kai-Heng Feng wrote: > > Not really, for hibernation pm_suspend_via_s2idle() evaluates to false so > > the old code path will be taken. > > > >> > >> And more to the points - if these "modern MS standby" systems are > >> becoming common, which it looks they are, we need support in the PM core > >> for those instead of working around the decisions in low-level drivers. > > > > Rafael, what do you think about this? > > Including this patch, there are five drivers that use > > pm_suspend_via_{firmware,s2idle}() to differentiate between S2I and S3. > > So I think maybe it’s time to introduce a new suspend callback for S2I? > > We also really need something like that to avoid the PCI_DEV_FLAGS_NO_D3 > abuse - that flag is a quirk statically set on a device at probe time > to prevent any entering of D3 state. I agree that PCI_DEV_FLAGS_NO_D3 has to be avoided. However, IMO introducing a new set of suspend (and resume) callbacks for S2I would not be practical, because (a) the only difference between S2I and S2R from a driver perspective is that it may be expected to do something "special" about setting the device power state in the S2I case (the rest of what needs to be done during system-wide suspend/resume remains the same in both cases), (b) the new callbacks would only be really useful for a handful of drivers. > >> per definition, although they might not be too useful. I suspect checking > >> APSTA might be safer, but if we don't want to rely on APST we should > >> check for a power state supporting the condition that the MS document > >> quoted in the original document supports. > > > > If Modern Standby or Connected Standby is not supported by servers, I > > don’t think the design documents mean much here. > > We probably should check if the platform firmware really supports S2I > > instead. > > That too. As said this really is a platform decision, and needs to > be managed by the platform code through the PM core. I'm not what you mean by "platform decision" here. > Individual drivers like nvme can just implement the behavior, but are the absolute wrong > place to make decisions on what kinds of suspend to enter. Right, the choice of the target system state has already been made when their callbacks get invoked (and it has been made by user space, not by the platform).