From patchwork Fri Aug 4 18:06:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13342157 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3F41C001DE for ; Fri, 4 Aug 2023 18:08:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229482AbjHDSIP (ORCPT ); Fri, 4 Aug 2023 14:08:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230020AbjHDSIJ (ORCPT ); Fri, 4 Aug 2023 14:08:09 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2061.outbound.protection.outlook.com [40.107.21.61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AE5849F3; Fri, 4 Aug 2023 11:07:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NdLoa2o6kP1R6n3Omu2UrT1dp1Hr113GsdeuD3IBoW9Uh0bQtOwVofuUk5GnIyj79IZMVG0w2fUrawUs6sFQfqGWNp4fyiYHHEGUateHKhk9+x7CGrnWIMWXN3z6vrO18zUgFN/AiezG9Aqcsf6NgjYHAwCJv56gfmJif/0ca9whP1H8RW53uGkwRsLZWM6CK+++5s+Dc7ccTY/17LDXsyRvSNHP8xSEmvy0/y6e4Mpefi9THWtUHVhct2uKq0CRYiBaJ40PIFpPjt4srRyMdmkASkx1azje4uOTEm8dXjxF2VPyOYVDIzQmsUpl+f3rTglh+vXII38a7E9eyAsY1w== 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=dtVqdYZfmsrnwaU5mI/76vuCYFsj2AIx8nykMKAiWCw=; b=hd1s7q5KE0QKLLqlsSDDd7FdJHjiMkxCPEWivC7EoWPtiWN0/MiyoF6v3YpK8SRhAfGyFRHKfxBk3br4kuRcRqBe7CE00ZV+6giyUbDX2VPKRPwbKFxzTDY3KyT4yzc1OzNDdRYsSNFicqFz0fli3B/uJj2B62sqG/DkxJAlyora0sPB+F6pYly+ear8P39jzhlcoBzDGe/KncDlaN7CmR7MZBISDZpQDQsfU2Nxdduqe7b7YJN6TiVyyHcL02VRbULsm/4oVD010UHgDQ8wcLkDfltvdYr5ftG5flN65JczF08j5TbN6dqi2TRGKOU7N6szsEElx8O5tRrxNk+N6g== 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=dtVqdYZfmsrnwaU5mI/76vuCYFsj2AIx8nykMKAiWCw=; b=dbjg14hZYEUQ2y2WJFaculcNfeCQRx887nRYvrtQBuEM2d7C5fAJDcYDx5UXvlIcU3/kfqQ/iYonRX+uf/rMVYUxAiLUWgtwu3ydf7LhvOQnUqjOS7c4sF5SOYZ96Faj//gtiVm1f2inbXwVkm97TT2HSAr3tUMV8JEdCosaxuc= 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 DU0PR04MB9273.eurprd04.prod.outlook.com (2603:10a6:10:354::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.47; Fri, 4 Aug 2023 18:06:59 +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.6631.049; Fri, 4 Aug 2023 18:06:59 +0000 From: Frank Li To: helgaas@kernel.org Cc: Frank.li@nxp.com, 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, mani@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: [PATCH v9 0/3] dwc general suspend/resume functionality Date: Fri, 4 Aug 2023 14:06:34 -0400 Message-Id: <20230804180637.462573-1-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: BYAPR05CA0051.namprd05.prod.outlook.com (2603:10b6:a03:74::28) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DU0PR04MB9273:EE_ X-MS-Office365-Filtering-Correlation-Id: b61ce3f4-ea47-4497-5b47-08db95159874 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cxAbUpJuS2rkVMSM9vJonxOyIx+ZXERw1Ci4HlHn7VlmKgDwfAR541FPUmBKhUQLPZiu8zzcjEEQP8L8yWQHQg6HXPmc8mSf1IqTKZ288OMdMtSX7Z1yELG8T/yHVKAfpO0ooD0Q5TtCi+uzX5YyE++K7KNRuq7OCLFZeDpiSnRSBP5FQ1MCcbvgQ+n1Q818rDKPWCBwLis6mWBMCuT/VZoRrqmxvLIlnSNi3RjfdxqoG0y7G1agz+sVLnE490jAEkE/6jef1oXS32ZB+3icgKgaAflRvrkKdCRIgYRJt2kaCM2lg9bRdDLDa37E0yTH1svr+9LbCJ0Lpj6ak6/rQA67s0+ZreSAAqcQXAika3fl79fHqJEnPdyUAOqfZUuLzbBRRROOJVQt5Z82MNWhMZFPw1RHlHTqeUkZLEq7WupYpkRsOKgHwxW4eFAfG2zl86uUJue/e35YnszZ4H35eYvtFQ7hNGbpSSukDAfmVE/sdZGQmEKwtG4FlsKDDflpijOy0AWveD/5SYcbZvWw9eoL0AMA/FOvl9xpOsumpnOyZFrZbOn+m3wajhu3291UcCycyhtBqykhSpmiHqVCgpePuPem4ClXjGal1f+5u6KGiAh/Pg8wKRDm1MN2AEZP4pZHGWOjtWTwr/5gttQPDg== 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)(4636009)(39860400002)(136003)(346002)(366004)(376002)(396003)(451199021)(1800799003)(186006)(83380400001)(1076003)(2616005)(26005)(6506007)(8676002)(316002)(2906002)(66556008)(5660300002)(66946007)(66476007)(4326008)(6916009)(7416002)(41300700001)(8936002)(6486002)(15650500001)(6512007)(6666004)(966005)(52116002)(478600001)(38100700002)(38350700002)(36756003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: lz3rS8CJbAg+9Piu/a7tQrHtHh4UHPkecOBwGc3m1+Q2LKFsAqeOxjy5Z6P3yt+f0HCZqB7n9hE5fK1cqiyIr5jHqJ0eS4NQ3zbAEpU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AHZcwll7ftpJ4tc5I4SULDmPntoN79X0U2LNBgTTo1Dqsnrrz1CoZI/Op84nYdyeMHyWLF6zGojj6FnSZpwro3hB3rj95FS0bIUrxEC5azlksCyPGycycqYPvY9wpQ9h4nlOeISRNKEx61Mz4SZL6lV0653B/75op+A0ob00gq1T+jTjKttHcNOpiEoMxAui7wphE55jH+bmG+KTk9eRfyqH2L0fTPkH0j7sSR8ZiC+Vu52DwpLwFkxbuAt5ahOpa6oLY7SSj8uf59UBzttrzUF3pC0tJcZV/4CszvKhhXJmGVQYzA43+WA5auy4gzMbHZjCFer7acdIfY1AjISqx14gRrAFUeSO+MIA2MuH57g3wqwN6YpNq6XEEdiFHDQ6zouHb4OKMyqkudc= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b61ce3f4-ea47-4497-5b47-08db95159874 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2023 18:06:58.9855 (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: O9qobV2kvf9prqG5dgEbFDmABLbt04y9Fr9xTukuchMXe21a3kx2Mtywwgs0jfGacwGEVTyJzvFIaNMU1AKe7g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9273 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Change log - Change from v8 to v9 Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202308042251.yGAFqeDw-lkp@intel.com/ - Change from v7 to v8 Add new patch to add common PCIE_PME_TO_L2_TIMEOUT_US define. timeout value using PCIE_PME_TO_L2_TIMEOUT_US. - Chnage from v6 to v7 Remove local varible struct dw_pcie *pci = pcie->pci Change according to Manivannan's feedback remove unused lut_off and lut_base fixed 100 to 1000(for 1ms) using dev_err for timeout refine commit message fix sleep value 100 (should be 1000 for 1ms). use dev_err when timeout - Change from v5 to v6 change to NOIRQ_SYSTEM_SLEEP_PM_OPS to remove #ifdef PM_CONFIG refine commit message change according to Manivannan's comments. remove reduncate step dw_pcie_set_dstate() return 0 when .pme_turn_off is zero call host_deinit() in suspend check .host_deinit and .host_init point before call. - Change from v4 to v5 Closes: https://lore.kernel.org/oe-kbuild-all/202307211904.zExw4Q8H-lkp@intel.com/ - Change from v3 to v4 change according to Manivannan's comments. - change at v2 to v3 Basic rewrite whole patch according rob herry suggestion. put common function into dwc, so more soc can share the same logic. Frank Li (2): PCI: Add macro PCIE_PME_TO_L2_TIMEOUT_US PCI: dwc: Implement general suspend/resume functionality for L2/L3 transitions Hou Zhiqiang (1): PCI: layerscape: Add power management support for ls1028a drivers/pci/controller/dwc/pci-layerscape.c | 130 ++++++++++++++++-- .../pci/controller/dwc/pcie-designware-host.c | 76 ++++++++++ drivers/pci/controller/dwc/pcie-designware.h | 28 ++++ drivers/pci/pci.h | 6 + 4 files changed, 231 insertions(+), 9 deletions(-)