Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9648187rwp; Thu, 20 Jul 2023 07:53:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlFNE2Wo62m++D5V98+9B0QyKECLMa/eVAxv6q5e5RYlEQQLYkYagxLzFmMMW2F7ZCUCGQr3 X-Received: by 2002:a05:6a20:48a:b0:121:c2f7:df3e with SMTP id 10-20020a056a20048a00b00121c2f7df3emr5278026pzc.12.1689864824846; Thu, 20 Jul 2023 07:53:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689864824; cv=pass; d=google.com; s=arc-20160816; b=Jiy+P8CB8pWsH0i6dnGZ4YkZ37RyuTzwAi4R0mSzcbdbeZY3xMTkCNd4EN9vnBWoOs qv88Ic8FiezH22tbnKifZpA0G8o19RGX2B5Pf9yCiaivZOcpS8/wfOew6DY6m4X/x2uX +kLXqMPg9o+StEaoRbmr/gpESCqkgzRVCbJIUsihthZUIViYZgufwTJc3tsKjR4XnE2D BFbkhZgQUKimf2U80lZVdzS9OnFHXjg8INqJRVAGiTeWusYRrWtATAWuaHQG+NAAA3vJ 5KEjBr54BzC2Lk49R/EzFO9GDfsCht44Em7NFXWngrlEnIqgnyFr08VF0TuEjt6gSPwC sEZg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to :content-transfer-encoding:content-disposition:references:message-id :subject:cc:to:from:date:dkim-signature; bh=8az8gR3DmDYfQJ+G9Kvddl/2g/jlbfQop/VK4ZbJbdU=; fh=EH361QAJZU8M+uvNL425TiuWp89jLvYqsX0kI9IBYs8=; b=taLRPC+frTlhmWATIv9td+gpeF7RE6JJKHNJoUpRAsa3t7/wvjI6/xHUfA0BZyRz84 sXT/dG6/d60zvFOkIkGJRbXHr3SgJZT4K/QrMKjiPrkkHj38sWqWbarQgkPWwq6aQFd+ VaOjSxD+vToUwLSpoFmY7zUJdR8HnfxjuvFQ6QdN61mISPZJ1aLYcXdyj761dbbcCggk Af6hXDwDRVgseSsNSriBC/xhR98E7aCJRzz1dAm05/7O78Pnz98fmiJwZ3VkDEMDMLKn abujWcZvx2Sf1i4tXWIXSO98aWL7R/P8LDmZpfpZ/U4KodbVJkzKfD8RcyziaNLwNyd+ uW3A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Y24TqXrP; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z12-20020aa7888c000000b006821425440bsi1102068pfe.279.2023.07.20.07.53.33; Thu, 20 Jul 2023 07:53:44 -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=@nxp.com header.s=selector2 header.b=Y24TqXrP; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232288AbjGTOiJ (ORCPT + 99 others); Thu, 20 Jul 2023 10:38:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232291AbjGTOhz (ORCPT ); Thu, 20 Jul 2023 10:37:55 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2066.outbound.protection.outlook.com [40.107.20.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6CB026AE; Thu, 20 Jul 2023 07:37:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LVTteGAzLp8VDSvnkYWex/Gzm/uQrXoDT5pAhiWIaxnQFFx6wyzOERBT/psQgoPR4/gvxZQ6JiiQOhnsuchg7/VIzbt6Hs2S0IOOa8k9i3G84OMbcS76usmoDA1KviLCzp0PKyhRC/+O52Gt75R5AlDLnDHK/iTJs1YkdYH8XXKcX9B8C8Q8u0J28aPUo88jwL8nZ3F88HdASXz0X+bVZmH5qxhxqNHuWb4TcRwi3Mwr5gnRtiT/y/EP9IZ6QD4vM9vtQXYOJCtWKQzSr959p6CNCygJh/s7uyJ0gMR64EZdiKe6UK4oQw/2rHN5utayvPlN/ILN06z2ZJESC9S1Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8az8gR3DmDYfQJ+G9Kvddl/2g/jlbfQop/VK4ZbJbdU=; b=N3bT1/iSFPFrv36RtFBIRh0pRbHN5QOCqPdA1PK1xMAWCDmTLsHr42VXmsd5kGtK5yZjXTXmjS4zf3TU9TQtSGGbPzJyVDiLNvD+jKFzDaA921vVcTWc9OYGyhV01iJs5foQMthqR0dv/59ZW1ZuKa5itkZ+PbZ+lDdYyUEG3VO0kaTmtlmD3TmRmawxSA/VZO1nCdcmROUAvW6fONXAvSuA1qGohh+dqU3J+Dlp/RlxsAcqlpPRKE5scFs9w+iacCMB75eiNKmzmf9XNoKULC2tZlFsjnQiVftESZ5qCWiGxY12ihHOCqeRoJZEz4CR5lX0TYYwSTVhvqsy+38i6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8az8gR3DmDYfQJ+G9Kvddl/2g/jlbfQop/VK4ZbJbdU=; b=Y24TqXrP+CVl6EliiAKlOzeUUZqAlpaT7w2sioRJjBxjKZX8EwFBFVLOdQUusPq69Lr87N/Wmk0A7MSLp8q8f0MscMzcJ2RKoQBlfWmW6MtXf5LaXVQDmZKmBCxxsYHOBdg4Ke3tJs3swpe1lmFLItWZsNCJ0ZgfCownEefvCF4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by PA4PR04MB9247.eurprd04.prod.outlook.com (2603:10a6:102:2a2::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25; Thu, 20 Jul 2023 14:37:50 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::d0d5:3604:98da:20b1]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::d0d5:3604:98da:20b1%7]) with mapi id 15.20.6609.024; Thu, 20 Jul 2023 14:37:50 +0000 Date: Thu, 20 Jul 2023 10:37:36 -0400 From: Frank Li To: Manivannan Sadhasivam Cc: Manivannan Sadhasivam , helgaas@kernel.org, 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: References: <20230419164118.596300-1-Frank.Li@nxp.com> <20230717164526.GC35455@thinkpad> <20230718100400.GB4771@thinkpad> <20230720142509.GB48270@thinkpad> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230720142509.GB48270@thinkpad> X-ClientProxiedBy: BYAPR07CA0084.namprd07.prod.outlook.com (2603:10b6:a03:12b::25) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|PA4PR04MB9247:EE_ X-MS-Office365-Filtering-Correlation-Id: 28e2a077-432d-4af1-ebb2-08db892ee4a9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dFE02nqwz+pplkfRcsIZ1YoTWrWsMhKu3RAJ23Hepjz6ImhgHeHqoLuutaLEAEva5recr3ML28/yFsSmWotigJW1Yit6Lv6Ch+av/c19vsJtRBhxTbuYAm846f8hpveONK8rHh2xSEr5vpKgkCaDeuFkKriPsBmpPFXXxJQCiyHt4bGWPvAk5NHQd/UTDmkXZLIpAYOSRUtbel2wgVv7YdTG17O4JXw5HaD6pGc/yVjF2tZxzICZPn5ZwKjfwOFrM0FAUqEh0Sd1u3RLK+ObsMO4bLK0F28wtr5r8106jimPnlRO8VrmQF9Z0kZWEF9Xa0u2KLKMqn65RVLe6pvxMhWA0BsEAsktBYQ4nqhpIWwBguna8szad4XcBTaPSR3+Y9r2BuH27+vBx2n60xg0oSYAeUlam39o1lcCENofzWlMJlrr60lankr0bhRdYs1BmfhYa4+pY6bzDAt7pt/UkIMZrgZRsUKuRwonIC7prw7NQKmxZBmEoyjKBFkwcDDFb0Nt4CngORIwQ3bWb9PzwitJY7wXtcv7s3YkZqSzvGynAODLUIjm2Z7fL3zuIS6/NbysLpsN5Byh9CqAAcUhOb2wsZ+nakxH08hEEpJorc6Bd28N3ui1MksHb4+cQ8tO X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4838.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(7916004)(4636009)(396003)(346002)(39860400002)(366004)(376002)(136003)(451199021)(33716001)(6512007)(478600001)(6916009)(52116002)(6486002)(316002)(66556008)(86362001)(66946007)(41300700001)(66476007)(4326008)(6666004)(186003)(9686003)(83380400001)(38100700002)(38350700002)(6506007)(8676002)(2906002)(8936002)(5660300002)(26005)(15650500001)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Y2ROQ2pzODdldTFGWU5pUStLTmtSUU1YUmdPNG1obGZydkZRYzZkYmw5K3p0?= =?utf-8?B?UXFoalV5c0NKZXdoV21IdnllMHRzNnRzRkROWDZCR2d6VElvMEN0d1ZHSGY2?= =?utf-8?B?VklUMTVyd3BiU2k0OGtBbExmemUybGhYSXg2bnUwQ0R4WW9UekduOE9Wd1BY?= =?utf-8?B?NHIyVUpHcUQzZmRjVkplSytPbEE3VHZkMjVtMFlIeDUxT1hVYTRyd3RGd1ho?= =?utf-8?B?Q1V3YkF4WFNBK2FRczlQT0dRRjRKVWw2enJ6NUhud0VobmtLVWVheCtqWG96?= =?utf-8?B?em5KTno4SXBZUzZINmdxeTVKVzhZNll5MjMrVXZTUTMzdnNvRGo2a3lxVW9h?= =?utf-8?B?dGVGcStCQ3N3SXRZM3YyVzJHaXhHNHh0NXg2cU9QY1BCVUs5aG8zMGZPT28w?= =?utf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a9 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2023 14:37:50.2332 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: YH02jsokC5Usyp+NSNrcSJM5KpNky9GJIOtlIzowTvKyQUjUPvvo6AqmZOdP/csRw/MfMVuSwbml83ACJ2AWUw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB9247 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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 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 loose 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. This API help remove duplicate codes and it can be improved gradually. > > - Mani > > > -- > மணிவண்ணன் சதாசிவம்