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 DF851C001E0 for ; Wed, 2 Aug 2023 16:32:10 +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=gjdOhIP0ySgf6qmrik8e0KsnqNzc+uKKCsN/LtTdoM8=; b=vD3QTZzX2M7x0+ gUe3dssI+KNdPNVbV3sRygUhDzg9RqBaw6YgLLF4x1bwvSQmvVPXm/8HgsDlXOPeU4XmfN5bXTPzk yC20t40/0juCWd+80zSdFyIW3rrvLG/pKRrqxC3s3SmbxuO+J/Wyi5lc3+LlYYPJo0ZmdImEgeSsb Q6oVGlI6dqvAx5yl9TijxppiJQ/X83iMnVYOU1PsRb/V0X+0DUzDugH+cLPLG6I2dftssLnDzBfNO cKV65MRcArdXZtib1L1f1uSxEodiwqSmyRJhuFDNDDcYDEjdBxn/sRRBUCM0d2NfUDVTJWoHGLvRh 4UtV8IpBSwFlxWnlwOHg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qRElE-005M3w-0t; Wed, 02 Aug 2023 16:31:44 +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 1qRElB-005M3M-2e for linux-arm-kernel@lists.infradead.org; Wed, 02 Aug 2023 16:31:43 +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 1467A619D7; Wed, 2 Aug 2023 16:31:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 347FDC433C8; Wed, 2 Aug 2023 16:31:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690993900; bh=0lpVhKDUd7Tnt1pOBSUzHZtuD1Oebkn4+PkPwpT2kKs=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=j0r8Vw0e00dzFIZouvGCpEl3w6wxJOtu5r+oKgbEEIllcsLcOgwkF+oW74VmuJJBr gXosxOrbTcwzjl6Ri2+Vpvwaj+dLrnCki/kBmQADQLYHTqjK1iBIe0nH+4h3waSf4r M5D19Z0MEPM1/zXyX7/FVkLek5okoT7aKTw3f7d3T0A6x3xJp4N5+9kQoMj3Om7XEg o4mGK6UbzNe388NZKfrgdLIRcayKsqL+xqLQhVUYoEmA3lv84UP4bfn656s9Lv9ldl QzrI/ZsQwszGGQoAl5MCHtteyeekqY7TOFtRf2V5B13p4QR5qccuN6FUyqNfPADYIn dtQWeEO7uAhyA== Date: Wed, 2 Aug 2023 11:31:38 -0500 From: Bjorn Helgaas To: Frank Li Cc: mani@kernel.org, bhelgaas@google.com, devicetree@vger.kernel.org, gustavo.pimentel@synopsys.com, imx@lists.linux.dev, 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, lpieralisi@kernel.org, manivannan.sadhasivam@linaro.org, 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 v7 1/2] PCI: dwc: Implement general suspend/resume functionality for L2/L3 transitions Message-ID: <20230802163138.GA61043@bhelgaas> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230802155748.212377-1-Frank.Li@nxp.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230802_093141_898323_91C0B896 X-CRM114-Status: GOOD ( 13.89 ) 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 Wed, Aug 02, 2023 at 11:57:47AM -0400, Frank Li wrote: > Introduce helper function dw_pcie_get_ltssm to retrieve SMLH_LTSS_STATE. s/dw_pcie_get_ltssm/dw_pcie_get_ltssm()/ > Add callback .pme_turn_off and .exit_from_l2 for platform specific PME > handling. > > Add common dw_pcie_suspend(resume)_noirq() API to avoid duplicated code > in dwc pci host controller platform driver. > > Typical L2 entry workflow/dw_pcie_suspend_noirq() > > 1. Transmit PME turn off signal to PCI devices and wait for PME_To_Ack. > 2. Await link entering L2_IDLE state. > > Typical L2 exit workflow/dw_pcie_resume_noirq() > > 1. Issue exit from L2 command. > 2. Reinitialize PCI host. > 3. Wait for link to become active. > > Signed-off-by: Frank Li > --- > Change from v6 to v7 > - change according to Manivannan's comments. > fix sleep value 100 (should be 1000 for 1ms). > + * PCI Express Base Specification Rev 4.0 Section 5.3.3.2.1 PME > + * Synchronization Recommends 1ms to 10ms timeout to check L2 ready. > + */ > + ret = read_poll_timeout(dw_pcie_get_ltssm, val, val == DW_PCIE_LTSSM_L2_IDLE, > + 1000, 10000, false, pci); Thanks for the spec citation. Can you please reference the current spec, i.e., "PCIe r6.0, sec 5.3.3.2.1". s/Recommends/recommends/ It would really be great to have a #define for this since the bare numbers are not very meaningful and they're not specific to DWC so a #define would let us find similar situations in other drivers. Bjorn _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel