From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 322D2EB64DA for ; Thu, 20 Jul 2023 16:20:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=v+VUi8CinxOCr2o91dwyWG5vyd0w5hirX7nmkdhrjXc=; b=EXE8cDCDw7S2wF wHHGf3i/ZkOjdFxxDNywkbD030Lm/pCXzGwikts/0OJLsFrL0l0VYtjhUh13quaql23LADl54284E eLyTXtCZ01zyxgxan6A5h65U0jvgJxOY7kxJXALMka2K2pRqBvHufHLwLKIwob4ZhojkwAj9lj+Nh X4RrHEnFivF2oXOi1GGMIuZPsRW05rcp9ovhK/Xfa1pITBpLregHyJgoNjSMaRpHv/vIwX4KAdCsF teHwZSc9T5JatNq1UTlY2tXuQisoRBcukBkbpECppYvvjriweRcOtAFRXMB+jJoJyx5oI3t9gGOJ8 av/ACFqK7fWUALvFpU0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qMWOG-00BelJ-23; Thu, 20 Jul 2023 16:20:32 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qMWOE-00Bekt-1V for linux-arm-kernel@lists.infradead.org; Thu, 20 Jul 2023 16:20:31 +0000 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 E36C561B19; 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-Disposition: inline In-Reply-To: <20230720160738.GC48270@thinkpad> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230720_092030_614384_D1D7DC37 X-CRM114-Status: GOOD ( 26.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel