Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2272598yba; Fri, 10 May 2019 08:51:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwv82ozjmAk0r3IMvi25khQYxST9Sh6zY687uUqs4lYN+4YysFfop+FLXuRxqFNhRiQ9pGv X-Received: by 2002:a63:5c25:: with SMTP id q37mr14962810pgb.263.1557503513012; Fri, 10 May 2019 08:51:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557503513; cv=none; d=google.com; s=arc-20160816; b=ENuwET+mJswlEoGVY2kc0YKdAfbhOJfRtTadT5KL1J1VS2V8TS325QQb/3/udnwoj1 SgO8CDIHPG6GxvfEwmXIgTmEriEIf5xC4wH80+TGOjd5vO+oNA00k7HSrF4xkGiZteWm 8JezjLOfvfUvZosKkcwUBuOXsKdR/M749wGceUfx5tHXfvPcMjuG1GfTjDL1kV2GaRyO O+qs9Tv69r+iAo2DnVl/b+fikWAfNhZHXsibCDDTdo0+uSOmcOCZqSqQyQKRt1vwCZSh gf9yhL7kgjSV7PFjVdAEzCq2BHaW9Ex2cTzAQXXmqmDYP8zHtnNsbR1UhHvc1kNc/ZQv Irtg== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=pwy2R1wuHBGpDMonP0sSwdrVbqpvERs3GUYVdV6QQiU=; b=BBC5lvnR8TIiKzpeNvX4H/exvee06DiVsuq83aW55JxeaClml5MRwDNuKvB6DlJ1vj u9u/sa+rKVicMnIvDQ1kLLLtHYm2GK3ttzDjUjzutb3q4UQynRnfRa51fUg3VyH0jh6G 9VCD8+/9mmJ73sLPx2h1h4RLtX0FPdynPRaczOMVVNzxRyhuv7YGzvnSNT/Z8l7Yrzjm VPkttxROLOAwUCpdpHALihO69ftwHpkQVCHwhPayz9inUEYcWUqilkF6U7DclVvf7PDJ MFWAP3j61stKafFspw+yZW2R3RLN47fbI7acinQQ5IFXi0CY5LqAL7J/PtE6TdxvHPDE iEmw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay3si3041190plb.298.2019.05.10.08.51.36; Fri, 10 May 2019 08:51:53 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727657AbfEJPt0 (ORCPT + 99 others); Fri, 10 May 2019 11:49:26 -0400 Received: from verein.lst.de ([213.95.11.211]:53257 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726930AbfEJPt0 (ORCPT ); Fri, 10 May 2019 11:49:26 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id 19EC3227A81; Fri, 10 May 2019 17:49:05 +0200 (CEST) Date: Fri, 10 May 2019 17:49:04 +0200 From: "hch@lst.de" To: Kai Heng Feng Cc: Keith Busch , "Mario.Limonciello@dell.com" , "hch@lst.de" , "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: <20190510154904.GA31649@lst.de> References: <20190509103142.GA19550@lst.de> <31b7d7959bf94c15a04bab0ced518444@AUSX13MPC101.AMER.DELL.COM> <20190509192807.GB9675@localhost.localdomain> <7a002851c435481593f8629ec9193e40@AUSX13MPC101.AMER.DELL.COM> <20190509215409.GD9675@localhost.localdomain> <495d76c66aec41a8bfbbf527820f8eb9@AUSX13MPC101.AMER.DELL.COM> <20190510140209.GG9675@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 10, 2019 at 11:18:52PM +0800, Kai Heng Feng wrote: > > I'm afraid the requirement is still not clear to me. AFAIK, all our > > barriers routines ensure data is visible either between CPUs, or between > > CPU and devices. The CPU never accesses HMB memory, so there must be some > > other reasoning if this barrier is a real requirement for this device. > > Sure, I’ll ask vendor what that MemRd is for. I'd like to understand this bug, but this thread leaves me a little confused. So we have a NVMe driver with HMB. Something crashes - the kernel or the firmware? When does it crash? suspend or resume? That crash seems to be related to a related to a PCIe TLP that reads memory from the host, probably due to the HMB. But a device with a HMB has been told that it can access that memory at any time. So if in any given suspend state TLP to access RAM are not allowed we'll have to tell the device to stop using the HMB. So: what power states do not allow the device to DMA to / from host memory? How do we find out we are about to enter those from the pm methods? We'll then need to disable the HMB, which might suck in terms of latency.