Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9783424rwp; Thu, 20 Jul 2023 09:35:17 -0700 (PDT) X-Google-Smtp-Source: APBJJlGHSETMwbqN7+WpyW7Ct/345WRAR9KmU2D/wl3RALHkgl4XGcMWjZWxPvVmWOGhAmN/vONR X-Received: by 2002:a05:6512:224c:b0:4fb:957b:4b20 with SMTP id i12-20020a056512224c00b004fb957b4b20mr2715529lfu.59.1689870916676; Thu, 20 Jul 2023 09:35:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689870916; cv=none; d=google.com; s=arc-20160816; b=k8wR5CdUw4ix3+4QujDQ2D+71KL1cAEiQe9CHJW7FyuCWzjci2cGSVqwsXXYlD4m0m kk1KPHgANG/lR1IxXwDYEyRkgXBeKWeqfD+LeCeXwMMOkmn6//vKvDnp0YBsQhpxVeCh BbhaT3aZNQry1nIU68vVwNA4iiYQkufi+NDQIKE6M+5YK3RWqOHLCRUiIHX9uzmnM2lV rcZymz2ECIhcjI7hv7hHxuZSiAfOrQm9QTrztTzWv8ZtAKR80XdGQ8T3ewg9jMK8tbb+ WyPuvKpFYoGwBXl80NMreTxx7rkqoBdyxJdY9Y+LxTM0n2uvL5fK1ZWiAsQkvts3b/ys WhFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=F3G0vSh3ax+ISpz7fUcqUjhrXEZHgGGWHWDDER5W73Y=; fh=pH5bcWSD0pRMMinzKHl2JKoiw2MoEo0PBnWHi/INSK0=; b=H332lSsi6y+qldzgDasoCacdyPFqxhk7BHWWBAPbASRJGZV/fBZswtOhVmyQa1gdTQ 7W5aApRetTzgTIW7RvsZouaPD/bGIMpaorYlkJ1Hq7XmnyiZ0khOTZOzPlStH+PY5x0s LX+JzQCCKJLu/Z725lZOLCOPJ/ajxQ2N6460rgLtN2QfapQ/DQsHdH23oRDX4gmAgp9l GZ3WsoV2x1i2h0ctZpJScfij8PEEuzbQ8PV1xk9Yf56RnKSrNZZFcOiUT/0JqbPvO43I ZuPH2RTvDBT/h5K+ssBXuiYdczll6HNeqGm+mGNHcdQiC5Y15u7pfsjVs5MIQXQCLVNB a7PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WrU6CN3w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w9-20020aa7da49000000b0051878e08975si965374eds.441.2023.07.20.09.34.51; Thu, 20 Jul 2023 09:35:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WrU6CN3w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229926AbjGTQUc (ORCPT + 99 others); Thu, 20 Jul 2023 12:20:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229683AbjGTQUb (ORCPT ); Thu, 20 Jul 2023 12:20:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 562AF9E; Thu, 20 Jul 2023 09:20:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E8FFF61B5F; Thu, 20 Jul 2023 16:20:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10097C433C8; Thu, 20 Jul 2023 16:20:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689870029; bh=pOFUaQTLHFO4dGld1P/bsoc75HqYdjzgZCqUvQTq3bU=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=WrU6CN3wSIaR+XSqSUU6ICevbrO1rjEyiZlAQ632RHiN9jHdLkXL5wngNkcZWEiEf 9mxjulCjKP5rMBYZlLwIhs8FJmLe2wn4p7KyJeF3VuPoFOGZcN7xwBhxZZpjjzPxh0 DXcZcO65iqjDEPdFVYbtoa5Ynhzv1ieMHTqtFPP2LxXQyxV1L6W7p7G0H1/3r9BUEo e3gK2PnnugeYBDbsXr2v3Gf2LC/REZ+oNAgKdLNdGvQSLb8NaxoSCEqyh48pjqHGM0 tCQDMqhY2UhvIbiqBmBlYPBWIhY3dZ+A4iCl4fhEsOmWjEUrm+gWgKCnS5iPBdZyhU 4XZcowL5ejdWw== Date: Thu, 20 Jul 2023 11:20:27 -0500 From: Bjorn Helgaas To: Manivannan Sadhasivam Cc: Frank Li , Manivannan Sadhasivam , imx@lists.linux.dev, bhelgaas@google.com, devicetree@vger.kernel.org, gustavo.pimentel@synopsys.com, kw@linux.com, leoyang.li@nxp.com, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, lorenzo.pieralisi@arm.com, minghuan.lian@nxp.com, mingkai.hu@nxp.com, robh+dt@kernel.org, roy.zang@nxp.com, shawnguo@kernel.org, zhiqiang.hou@nxp.com Subject: Re: [PATCH v3 1/2] PCI: dwc: Implement general suspend/resume functionality for L2/L3 transitions Message-ID: <20230720162027.GA527307@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230720160738.GC48270@thinkpad> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 20, 2023 at 09:37:38PM +0530, Manivannan Sadhasivam wrote: > On Thu, Jul 20, 2023 at 10:37:36AM -0400, Frank Li wrote: > > On Thu, Jul 20, 2023 at 07:55:09PM +0530, Manivannan Sadhasivam wrote: > > > On Tue, Jul 18, 2023 at 03:34:26PM +0530, Manivannan Sadhasivam wrote: > > > > On Mon, Jul 17, 2023 at 02:36:19PM -0400, Frank Li wrote: > > > > > On Mon, Jul 17, 2023 at 10:15:26PM +0530, Manivannan Sadhasivam wrote: > > > > > > On Wed, Apr 19, 2023 at 12:41:17PM -0400, Frank Li wrote: > > > > > > > Introduced helper function dw_pcie_get_ltssm to retrieve SMLH_LTSS_STATE. > > > > > > > Added API pme_turn_off and exit_from_l2 for managing L2/L3 state transitions. > > > > > > > > > > > > > > Typical L2 entry workflow: > > > > > > > > > > > > > > 1. Transmit PME turn off signal to PCI devices. > > > > > > > 2. Await link entering L2_IDLE state. > > > > > > > > > > > > AFAIK, typical workflow is to wait for PME_To_Ack. > > > > > > > > > > 1 Already wait for PME_to_ACK, 2, just wait for link actual enter L2. > > > > > I think PCI RC needs some time to set link enter L2 after get ACK from > > > > > PME. > > > > > > One more comment. If you transition the device to L2/L3, then it > > > can lose power if Vaux was not provided. In that case, can all > > > the devices work after resume? Most notably NVMe? > > > > I have not hardware to do such test, NVMe driver will reinit > > everything after resume if no L1.1\L1.2 support. If there are > > L1.1\L1.2, NVME expect it leave at L1.2 at suspend to get better > > resume latency. > > To be precise, NVMe driver will shutdown the device if there is no > ASPM support and keep it in low power mode otherwise (there are > other cases as well but we do not need to worry). > > But here you are not checking for ASPM state in the suspend path, > and just forcing the link to be in L2/L3 (thereby D3Cold) even > though NVMe driver may expect it to be in low power state like > ASPM/APST. > > So you should only put the link to L2/L3 if there is no ASPM > support. Otherwise, you'll ending up with bug reports when users > connect NVMe to it. Can you point me to the NVMe code that shuts down the device if there's no ASPM support? That sounds interesting and of interest to other drivers that want to do suspend. Bjorn