Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1338219yba; Thu, 9 May 2019 15:02:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBcJcFKSIljGi0VgcYNhLN2N176Qm67jh0IvcXScxU8SnWu+9SCXoWND8KJZFqYQ9QR9/P X-Received: by 2002:a62:2805:: with SMTP id o5mr8750715pfo.256.1557439320361; Thu, 09 May 2019 15:02:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557439320; cv=none; d=google.com; s=arc-20160816; b=mm/bIoYPyY956n8Q2UoqPA4mo5tQmT8FxPQ20VzB/c22L3SezcgFXz5ZOYT0x3F5NJ ZQNuYOc2KOCWv1c7eQRb7jUDtPADfMIvqHX7BE7kW4BIuXjTG73Hmbl3V4wH9aHuFPfU dNS6A94aZj+GOl7F1e4a3MY7+bssEqlNpca54pB84y2JzCRRVONBosYi8iTd/eeX1m4z jskGhj2m7IAUPCVvgrhZhOawU48mRN+l8BJAjUPsGZFBTgzBujoRDB1FEL8uDOqumPxf 3+FZ+KRs6s1HH1ibQQ2D9aie1/nYAE2rjTp5DmDhHdkYcDBo840umkqDvD1ID1nh7ej5 utwA== 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=zVfZ+LdSJO1YF1+s40wHJ3ISBu0fzAFNSIG5Gxr8JWc=; b=dsiGZcQ2d5kJ4lqx3SnSP/8i8JPVubqEWdvSFvIpROdbaLj1aGTgRRCwThiraL2FYp eLZEt+RkX91cqxhCag1I5p8rZ14eKrIol6u01OZUoobeAQ1GMe673Hqu4SBE5o7GktyZ mWk4nb+1FiCO6jFrlSY1JaURQc2Lc0/OBkPMIJvpvDm5B/6E/z6uxUtxAmxSpLiHxuZE ZMiIrw5VXT0wu/OY12Qobr8yMbFj2QNpqyUhyh5mnjCRsOa/eaZQLud/JBZ5BnH94e/6 Z4bQrOw0HjPakU38KqNHtLa5vdr44OMAWxhVVdN8HtAykeAr8WbsjnSkitRMU3DTs6Xm mLDQ== 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 x28si4965758pff.104.2019.05.09.15.01.43; Thu, 09 May 2019 15:02:00 -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 S1726865AbfEIV7k (ORCPT + 99 others); Thu, 9 May 2019 17:59:40 -0400 Received: from mga07.intel.com ([134.134.136.100]:36128 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726701AbfEIV7k (ORCPT ); Thu, 9 May 2019 17:59:40 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 May 2019 14:59:39 -0700 X-ExtLoop1: 1 Received: from unknown (HELO localhost.localdomain) ([10.232.112.69]) by orsmga007.jf.intel.com with ESMTP; 09 May 2019 14:59:38 -0700 Date: Thu, 9 May 2019 15:54:09 -0600 From: Keith Busch To: Mario.Limonciello@dell.com Cc: kai.heng.feng@canonical.com, hch@lst.de, axboe@fb.com, sagi@grimberg.me, rafael@kernel.org, linux-pm@vger.kernel.org, rafael.j.wysocki@intel.com, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, keith.busch@intel.com Subject: Re: [PATCH] nvme-pci: Use non-operational power state instead of D3 on Suspend-to-Idle Message-ID: <20190509215409.GD9675@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> <7a002851c435481593f8629ec9193e40@AUSX13MPC101.AMER.DELL.COM> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7a002851c435481593f8629ec9193e40@AUSX13MPC101.AMER.DELL.COM> 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 09:37:58PM +0000, Mario.Limonciello@dell.com wrote: > > +int nvme_set_power(struct nvme_ctrl *ctrl, unsigned npss) > > +{ > > + int ret; > > + > > + mutex_lock(&ctrl->scan_lock); > > + nvme_start_freeze(ctrl); > > + nvme_wait_freeze(ctrl); > > + ret = nvme_set_features(ctrl, NVME_FEAT_POWER_MGMT, npss, NULL, 0, > > + NULL); > > + nvme_unfreeze(ctrl); > > + mutex_unlock(&ctrl->scan_lock); > > + > > + return ret; > > +} > > +EXPORT_SYMBOL_GPL(nvme_set_power); > > I believe without memory barriers at the end disks with HMB this will > still kernel panic (Such as Toshiba BG3). Well, the mutex has an implied memory barrier, but your HMB explanation doesn't make much sense to me anyway. The "mb()" in this thread's original patch is a CPU memory barrier, and the CPU had better not be accessing HMB memory. Is there something else going on here? > This still allows D3 which we found at least failed to go into deepest state and blocked > platform s0ix for the following SSDs (maybe others): > Hynix PC601 > LiteOn CL1 We usually write features to spec first, then quirk non-compliant devices after.