Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp747112ybg; Tue, 28 Jul 2020 18:38:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKt4/gbfN5JYY+0ph08swVojlrx8PkAAe0CED7McMgsjKF05ZDQQcepXel5Jxmi/2pDR6n X-Received: by 2002:a17:906:f24c:: with SMTP id gy12mr20910830ejb.275.1595986682041; Tue, 28 Jul 2020 18:38:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595986682; cv=none; d=google.com; s=arc-20160816; b=q8LWR53LBZbpHfXVPhpEHKg0v+YwZieKyXQad37WTK1yTNmrgpW6uNaiSX2gZ62xKq HzjkevtVWeo9Nt3DVP//5k9QhC9uZPrP6WHhSVvZn+IYAyagFSOUqmUMGNDk8tngzgoc d4uARkr5scxHXRV006ebBXydHsPKhpMva8GBPzraGskpG1hXFyFsRvldwLAL3wbC0qe3 fJsIl6OLsDIc2uwZVt0OA+xjwhRmb10f93MICYImATjOMQ990lvavNmNHHkyvclUIEpx 6I6c7ZgV2/lg8lKkp8I1i2tmkQQAXoRHMNVc61P0RdQVc6SJKSXaxdccHYbT0vDE8yIW dscw== 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:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:ironport-sdr:ironport-sdr; bh=Y08QnswQ9SrBbrWXU7qIHKg62rZd4OjvM+68xdfTsO0=; b=IithNI/l9qWFL72mMbIePH8a7SEEa7ZtQaPIl8ye33UZbKtE/x1lpw23AoWdIIipYx bl9q6O1crTMpJfsN0hOKaX4xVy8ddhBv05TQAsStx0TPlom3D1f3HKSd0zEFAX1I5G+4 SEYhKT90tWpj+g+f0oQpHy2VRW5y5NSD4alNQhgFCnCdd1685dl1/PfxV1bmstvtvLo1 eWZYz3Z3vyj/bGSxBnPvguecWA8gmAkPyvwHha7kYCx8MG1E3d+LNPuVOHBahI8m96Z7 sI+QWezxhtABC9Hslz1rfNlDzM7rq1+YBYw0UqYSJzBlNi8rWf6j8qsQNmJWAka0rCe0 ecBw== 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 bv17si143268ejb.263.2020.07.28.18.37.38; Tue, 28 Jul 2020 18:38:02 -0700 (PDT) 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 S1730346AbgG2BfT (ORCPT + 99 others); Tue, 28 Jul 2020 21:35:19 -0400 Received: from mga14.intel.com ([192.55.52.115]:6431 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730117AbgG2BfT (ORCPT ); Tue, 28 Jul 2020 21:35:19 -0400 IronPort-SDR: J6nrg5ZV2i6tp/dHjEMSSHNElqWo7VGGnMQhLFr63+4a7knAxY8SZsTdLqaEpE9rjypcNQUqHf oWvzaH2YXCPQ== X-IronPort-AV: E=McAfee;i="6000,8403,9696"; a="150512010" X-IronPort-AV: E=Sophos;i="5.75,408,1589266800"; d="scan'208";a="150512010" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jul 2020 18:35:11 -0700 IronPort-SDR: YNsFNSmhqfBBgmI35x/2O7/pNXoR+a/bwag1n6Mwd4MKRcnT4XpSjxN7jGO6jeRF7/XLdB/SmJ NIW6+0gsiTZw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,408,1589266800"; d="scan'208";a="364700282" Received: from vverma7-mobl4.lm.intel.com (HELO localhost6.localdomain6) ([10.254.21.148]) by orsmga001.jf.intel.com with ESMTP; 28 Jul 2020 18:35:09 -0700 Message-ID: <25cb1c0c35d2ea2aa233c1db726abd86dadc54c0.camel@intel.com> Subject: Re: [PATCH v3 10/11] PM, libnvdimm: Add runtime firmware activation support From: Vishal Verma To: "Rafael J. Wysocki" , Dan Williams Cc: "linux-nvdimm@lists.01.org" , Pavel Machek , Ira Weiny , Len Brown , Jonathan Corbet , Dave Jiang , ACPI Devel Maling List , Linux Kernel Mailing List Date: Tue, 28 Jul 2020 19:35:09 -0600 In-Reply-To: References: <159528284411.993790.11733759435137949717.stgit@dwillia2-desk3.amr.corp.intel.com> <159528289856.993790.11787167534159675987.stgit@dwillia2-desk3.amr.corp.intel.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.3 (3.36.3-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2020-07-27 at 14:37 +0200, Rafael J. Wysocki wrote: > On Tue, Jul 21, 2020 at 12:24 AM Dan Williams wrote: > > Abstract platform specific mechanics for nvdimm firmware activation > > behind a handful of generic ops. At the bus level ->activate_state() > > indicates the unified state (idle, busy, armed) of all DIMMs on the bus, > > and ->capability() indicates the system state expectations for activate. > > At the DIMM level ->activate_state() indicates the per-DIMM state, > > ->activate_result() indicates the outcome of the last activation > > attempt, and ->arm() attempts to transition the DIMM from 'idle' to > > 'armed'. > > > > A new hibernate_quiet_exec() facility is added to support firmware > > activation in an OS defined system quiesce state. It leverages the fact > > that the hibernate-freeze state wants to assert that a memory > > hibernation snapshot can be taken. This is in contrast to a platform > > firmware defined quiesce state that may forcefully quiet the memory > > controller independent of whether an individual device-driver properly > > supports hibernate-freeze. > > > > The libnvdimm sysfs interface is extended to support detection of a > > firmware activate capability. The mechanism supports enumeration and > > triggering of firmware activate, optionally in the > > hibernate_quiet_exec() context. > > > > Cc: Pavel Machek > > Cc: Ira Weiny > > Cc: Len Brown > > Cc: Jonathan Corbet > > Cc: Dave Jiang > > Cc: Vishal Verma > > [rafael: hibernate_quiet_exec() proposal] > > Co-developed-by: "Rafael J. Wysocki" > > IMO it's better to change this to > > Co-developed-by: "Rafael J. Wysocki" > > and please to add > > Signed-off-by: Rafael J. Wysocki > > to it as per the development process documentation. Thanks Rafael, I've fixed this up in the branch I've prepared for the pull request: https://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git/log/?h=libnvdimm-for-next > > > Signed-off-by: Dan Williams > > --- > > Documentation/ABI/testing/sysfs-bus-nvdimm | 2 > > .../driver-api/nvdimm/firmware-activate.rst | 86 ++++++++++++ > > drivers/nvdimm/core.c | 149 ++++++++++++++++++++ > > drivers/nvdimm/dimm_devs.c | 115 +++++++++++++++ > > drivers/nvdimm/nd-core.h | 1 > > include/linux/libnvdimm.h | 44 ++++++ > > include/linux/suspend.h | 6 + > > kernel/power/hibernate.c | 97 +++++++++++++ > > 8 files changed, 500 insertions(+) > > create mode 100644 Documentation/ABI/testing/sysfs-bus-nvdimm > > create mode 100644 Documentation/driver-api/nvdimm/firmware-activate.rst > > [..] > > @@ -464,6 +466,10 @@ static inline void hibernation_set_ops(const struct platform_hibernation_ops *op > > static inline int hibernate(void) { return -ENOSYS; } > > static inline bool system_entering_hibernation(void) { return false; } > > static inline bool hibernation_available(void) { return false; } > > + > > +static inline hibernate_quiet_exec(int (*func)(void *data), void *data) { > > This needs to be "static inline int". > Yep I got a build warning for this and also fixed it up. Thanks, -Vishal