From patchwork Mon Aug 7 16:52:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 132324 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp1645730vqr; Mon, 7 Aug 2023 11:57:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZPlb9RpAAjUOf3zUUGLBo3XKXRRacX+wzS1/J8jh4Yfdz0D1lVJI0KoO6YxG0/S56+wLf X-Received: by 2002:a05:6a20:a129:b0:132:86ea:4725 with SMTP id q41-20020a056a20a12900b0013286ea4725mr10076779pzk.45.1691434656650; Mon, 07 Aug 2023 11:57:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1691434656; cv=pass; d=google.com; s=arc-20160816; b=yfvY+kRaA1VpWoFqdfmyurcm0Bu5iaNxKqwQvhYWLowcAmzfNXvhyE2EfKqB/Jxjyg hp4EwIrrP0LOTgu8HZ5XO+pb36hW648vroXOtcey38mXdLiuQn1LJHgQCtzaj3au2ZyM 9E4OtxLtVCEzy5da3PbakKN2IuYAq/wyhS7FT3VXOK6jGV1lpJnm6ORedDeKYrzDfFIw zGn2NyC77+NuohX9trBbBqXFcqM9FM7ffgLC122znIbJuOMh7kTCXyzMmvu7V3758n5m zAc+TBuYcDXiQQ9MWUa+pSKU/BQ8o9cgWEFjIz7WCK4eWVqjnQS2nd6C+5+UI7fS4RUx M/Dg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kjyxhbW06JhrkrTCJL7QM3CGDyh+FD/nRHJUcFll8aA=; fh=LKnVPWvEa61PHnZAI3RMnA9ofhnPlVAAdbaNfQif9xk=; b=wHE1lG+qe0O96bwDEI+TjWJHG1vCrK/py6SRMcvooai11cNFn9bSPoRFhtN61UzQcR reNx/ITfibfCg4WcTIWUlqPnw4Ic5dADil//6/SCZFve/BfCE4ngP3hVGL3hfqZXPhIB cSSj4ryO7+O71waBgWJl5xiOv5XbyqjIOllH9MF/Reiv0c6zuhl+wYueUQX5ayXLKn7c c7AFRFWXLczcOIjM3V/hxuUuV5R5qZ/mH6pnr1tGEzEVpVbDAy7sGuPhXjKZsicOMh1o pclSjKTgkcI78krYg5P4C84ZGtEEaK+qtIDu4C9fEHZASCRd+r8/X8ZbAqw7fFFMuWu1 6hQg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=KscFYe5x; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f1-20020a631f01000000b005641697e82bsi5849788pgf.435.2023.08.07.11.57.23; Mon, 07 Aug 2023 11:57:36 -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=KscFYe5x; 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 S231913AbjHGQxM (ORCPT + 99 others); Mon, 7 Aug 2023 12:53:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230389AbjHGQxJ (ORCPT ); Mon, 7 Aug 2023 12:53:09 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2072.outbound.protection.outlook.com [40.107.7.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47261A6; Mon, 7 Aug 2023 09:53:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mOLHl6IW1pZ7w6BevtM/P3dMTxHjnV095m3KKGMLxakVGTf/XH1WHmM3EMgIeLmy4bGJmgjM13K0GJ6ymld24XSp5gwIN3eKuMwDpJORjZbWylGmFysfTwOCN23KYRJ7MeJ9BtC/TSwuqqKqyHyn6X9Kw3lXXqmvWI+JCc6smX00l+O/Vmhxc7yugJ2RosTBP+Ylg8JjRDB2RjYOzoCDVMuYMTJeza94uIAk26+dxGcSeQKgiIxXbnP6mqlRBolacb70jOBjVjxH+87E5X9y7qapOnRcd0cmbyEbcPS2jt7j78PwMXhKUgzdXL/9lX4rJFO7SGruKFR+iMJug/2EqA== 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=kjyxhbW06JhrkrTCJL7QM3CGDyh+FD/nRHJUcFll8aA=; b=d+k5Nv1aFghoIHVktSSkd9Eh1z5PWS3FsWZJTrB5fLs7t0AOOGggKGhVR0SUT3xpoGiytLvFl2JfuG7Nb9gzYgUUCAjqwnwhphAP8Ee+qVQOX6X2FZdja0na4Buzp1d7bV5hOP4jNGtwaDylGSdgMa/Gwj5LfhQoGoxW7e0hJ0lDwnrLu5mfoCrO1PI4YpAhTTE3ao+sX/LeH/NnvPUYjBIpgAgNoErxKZB7wNsvwLltkQJ6dbWez5Qfj+gQrSFC3yzNqITGGyp7COiIm8jaEv5s7K1AnL1FwZYej8GyB9EQSgPnmb/S+IX81jurxFlgwjEkpLB/VBpSaDtxGsOmHw== 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=kjyxhbW06JhrkrTCJL7QM3CGDyh+FD/nRHJUcFll8aA=; b=KscFYe5xeTmr2CHLHVZ6075dR9UuknXiCLco72RcbMvfMO1tuA7Lu6sqtHL4k1vfmgcsde8zh49EsS5EYMumagu2jk9yRJD3fUbd0T1aeEXMwvBnSB7Ig8ndLOiYERxObYLHa4DEsBGmJPGJYgpgc4ubS1ASp57A0QceQhV28Vs= 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 DBAPR04MB7318.eurprd04.prod.outlook.com (2603:10a6:10:1ab::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.26; Mon, 7 Aug 2023 16:53:05 +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.6652.026; Mon, 7 Aug 2023 16:53:05 +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 v10 resent 1/3] PCI: Add macro PCIE_PME_TO_L2_TIMEOUT_US Date: Mon, 7 Aug 2023 12:52:36 -0400 Message-Id: <20230807165238.569297-2-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230807165238.569297-1-Frank.Li@nxp.com> References: <20230807165238.569297-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR05CA0093.namprd05.prod.outlook.com (2603:10b6:a03:334::8) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DBAPR04MB7318:EE_ X-MS-Office365-Filtering-Correlation-Id: 2d55efd5-9710-433c-3383-08db9766c528 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jbiVzTsGrBXWeGxV17qDRtvsFvnybDeb5bU9PKGN9R8QIpktJhQPxPIdxXghJo04bOQKz7ZYEFfsrHghKg1JIXtueoRbeGf7VpayOSihgk9GfjYJ51ruHw4TQvgfXOzeJ8q0ox7iuCaC8MhqhJ8CgVQyn3VT79OAwmFosvRNWu8dpAHVDW4VmBpS5i3vcdK2aBenwKw9qh16n5TDBmWnUGTdgSQZYyW1uWgyTC3QsC9Xl+Y6QUTzBMPijIOZk7Ad6sHThR0wxcT7QKUiWzs1icQ1K5EUwoZClQ8hkSk83JYv9GvPt/iMAd3Zaf1FmBu1D+4PdT/VBM5WTJ6k0nx4C9xKIZ6GFZ5+CN3ioZnp4r3kwmzraGKchtcFFMDXGi1XC4LSnuk1duESDw4RFkhSW90cCMJYZO0BJVjRT12Sw9CgFHfynCglFIlnG61nEk1EMI1vLrnlcGcoakTxh8aqsbW3Gum3Q13gw8i84BwenuXDQxAhbklD4UfjQOAubxnH6VEaYhfUePdW8BB50HOj67Dx14LxpcW7fRUGFRSDqHJ3f59cZC/mumShLW8dkUNnXkAdKKNhqpIDjtw1ATPihSRsVXpnu31WKbmdYAfzsasRAvNWQVM42nZ1fo1zq+CH 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)(396003)(366004)(376002)(136003)(346002)(39860400002)(451199021)(186006)(1800799003)(2616005)(36756003)(6512007)(4326008)(316002)(6916009)(86362001)(478600001)(38350700002)(38100700002)(52116002)(6666004)(66946007)(6486002)(66556008)(66476007)(6506007)(41300700001)(1076003)(26005)(8676002)(8936002)(4744005)(2906002)(7416002)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: lxdE+7iBNCXY6W6a1Z1DrfMMI52XCAtkgbxCjB1cZnaIQop4IUuW3LkCl1348K+rMONcA4lNKYYwTBSNtgXPwgyd84WpfasYzFhCEB9mcu8k7VmhcIuUFPjP6ZzJ6F2k3w0T6EOlOvd+ZbfzKBJM6KtKptuDpF3OP9He0bKhVj7zZ2ujSCYNR5NVdBs5hyRNacEVvQ5XzxCeFXAVnBM//7tFKV7d7GWhB1RzydGlj2NOYjTVpVl7J2I2q7Ui2SZmJj/4EYJMsdlcJVDDe0DGQghm/ZWU8sKdppqhhz05dKetGlEPUMaIkfMHRAfgc5FZKPOuk5Lp8U35Yg39kZquxf2o+ioNtwPMQlqDK32YNRmkr4SJM6JvQuEqtH0thXeDrIKPiHNxpK4CG/g93+gCgBBVgsQXEOzfzMdRQZeEw8RghnmqOFQ5Kl4idQoa4Qw9hKXWJfeBPBb8wINQiPigpXkzjnuFo9gwhoZN/4yRWHpgum7nwNmivnpiHyaDg1H9Z5O78LR1Ev5sY13HMAHJ3Tyah+bprXGgf96/CK05yhAKUjJeAQXkJuMllYP+Dd+3umbolaxd8mrhTqjMRMAfs9XLCZo/Zss736zt0cUq6DQfLj+1wyBj6EC+28D93QPsr0oWEj7RjBlRe0jKuPwpMPKFhwCzCAn55NrZEjKvDTct7u2r3z8XjvJt4YRAF/lrsVAQTCUzwwSezzMwIm6/35UpfrGwAWGSJ0wmvPijAbcnfgZBC8fGQ4TqVtcrohk88riDdG9HI6epvrM5+9seD8x0ValhMA+Ajy/RZOD1rBQ6+RXAwy4CuH8AmFmJDH3S1pFcbKgtgVD0ki+h9yjjJ2F30B5/Q8TM1wx5c1sc7qX+y39BCqfSwzjAr919/3Ru7/B0LKMfnz5BlHy9HhL3+2buMqfKye1OessiF3FV7IR2W0tEXFkFmtKJdOdZXq/zM1JOaUAp1tjz/Xmav+TIg22HKCRgEy/UIRjgO3BnefGH4bq2VhwfzcgPIuAdmXnNbMi97V1F5C3yTt3HITti45FVL/rSoMbnwrm9gfFj+R+vuC0BddS6MM7CBlSBmwQd0Ng4RIs0+8BJzexG+OUbuCP0r/NAiER7Qi5XiILaA26mNgsAWaHJOVk4TPbWgWo7EKsk1UlMzUy78IFuPKJrLcJaejKSVSVwTJQ/xVtihn+QSF3Kdh2smOPiO5fKpbgqRF83FJAkO8Ll1ps8qvXVWECXEQ80NJcTvLQu8c/gY1z/HUIvlWJbEKoYToLasjnv0drwEE53KVwWXQ5tyQfyDRG2ubCijfNNuX5IW/TynRTsVaUS92YpUL2MwQy26tLyTzxv/9dMM7CFIuWtXBiXHesBM3I21teS/9DcOUV4bgWHRj92pEAX9/3BgcSZy+dXbpmiIOQXQ9UN9YY4ZhkS75oHZrpbUjSh3tm8eW3O0US5NjmsAzuDzEZ/SqcGWv+8pndXA79YhPiGl8SaaAlPGbnshc56CT64Wpx8aWoImQj4iM+jjv+ze7e9pDyJ2w9/28iqOkhrZz87n0nUPKeRxT68+nt0fepOlHN+U7zyeCKR3kdvX10vZ9pHfDbRekp8 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2d55efd5-9710-433c-3383-08db9766c528 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2023 16:53:05.6846 (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: DKgL6SAOmvu4MPjKGmV0uP5im3fNEIK00h0Kkb60TfVMNcvoC5HRofASkbCh+FXq9xnYWjTLTBzKJOsfzRbyFA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7318 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 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773597786448398889 X-GMAIL-MSGID: 1773597786448398889 Introduce the PCIE_PME_TO_L2_TIMEOUT_US macro to facilitate checking the L2 ready timeout in the PCI subsystem. Acked-by: Manivannan Sadhasivam Signed-off-by: Frank Li --- drivers/pci/pci.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index a4c3974340576..da8156663c825 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -13,6 +13,12 @@ #define PCIE_LINK_RETRAIN_TIMEOUT_MS 1000 +/* + * PCIe r6.0, sec 5.3.3.2.1 + * Recommends 1ms to 10ms timeout to check L2 ready. + */ +#define PCIE_PME_TO_L2_TIMEOUT_US 10000 + extern const unsigned char pcie_link_speed[]; extern bool pci_early_dump; From patchwork Mon Aug 7 16:52:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 132316 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp1640625vqr; Mon, 7 Aug 2023 11:45:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IENbVF3h4qY6DKMZTNPSkr8C1sVf2w+DyH33lAd1iEA0c0FPCvXeJ0KACybNWgOZBT04yXF X-Received: by 2002:a17:903:124d:b0:1bb:961e:dfbc with SMTP id u13-20020a170903124d00b001bb961edfbcmr13290809plh.20.1691433901002; Mon, 07 Aug 2023 11:45:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1691433900; cv=pass; d=google.com; s=arc-20160816; b=PvM5iIRZwJTda6JKOkTmSWR99SHrqelv5vnCrk2wwPvEWQ/hAzO8H1j05AN0UdXOvo enpw8re5cLP6fhRLXTO5Upe5A6qlKEkEuJNmEZEkRGGT4u8e0s2Kik1/tVasKjMgYdxL tW2j81hZAVEC4kGWgU9n0XJUB1fHDvgwaFUEde7bUdhotLVg910IKZs0bzJOEewWaznb KxFIH7wVzsD4d5Q/XifBbQkD+AVweMRc46w6lARv4qrpRGERVgC9Kn05Bv+MhlZv5hBV +HYG3Gns6FUdXzx96xPtjB6a1IjuUzd93kQE6Y5CQ/qmN8Yz2g/nlYBHvffOqVSRhRub dQvw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RuZYozsszV04m9+f6PLw4EoD1EIVUX6sjonI35T2M80=; fh=LKnVPWvEa61PHnZAI3RMnA9ofhnPlVAAdbaNfQif9xk=; b=d0XFRKwcXhOz4A5veiVSoeudxnc90MVEN5BsNGiS5PRKprkAFul2HuBge0Nn/4cy+y hjkA5OrFVCzCOeQM3alf1/lc51GS/iqifgkA2tu/eeN2K224Pzn6aIGOn5Co68BpeakB fu/+UnAtsqELmNXfgzTppM5IpGKRB1hVOcs/hmnFXA7uvGqKpRBR+USoGNXu++tJiTww kLsb5in9Zg1q2T/R83byqNhuRr7amZt7L5qfj0kMt4ICsYaYMbXexzGfV0tbmVCWBxfT ejeXoET7COZc+Na18ch9Q/5BIfU9C9eHa40xZkynbylXgQGvEnWkE814jAHJRXXw2uex uvxg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=J2BS3BK0; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f13-20020a170902684d00b001b876cb3e53si5565738pln.211.2023.08.07.11.44.47; Mon, 07 Aug 2023 11:45:00 -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=J2BS3BK0; 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 S230389AbjHGQxd (ORCPT + 99 others); Mon, 7 Aug 2023 12:53:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230142AbjHGQxb (ORCPT ); Mon, 7 Aug 2023 12:53:31 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2053.outbound.protection.outlook.com [40.107.7.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B9D6199B; Mon, 7 Aug 2023 09:53:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nbypGh2ifn42PATn/cTQsOjk56kcTY+yatxoUOvGyocjWeoJg8ae4/GGRhw96AuwBeKeCR19oV3E8r/xW1XXUIntYP5WexRywjNL0ksjaYSCHaiQqbpWDzLjQpfhSWvnsZmLPlPq8/h1fH76aihH3v2w0MVptMUZAtsZBu71USHy6jS7wuJ9PrK3z4zgYNzd8ijxXieyHWc1Azuh21d+MhF/VN9wWfxOshxIZBjc7Q/BzjrZAAOQzcxpqS7gdWG5otHtA5HbmxWWECwHUeYnNEVGlD2RvZctXAgN3cBBh2+jC5KvWhEWfdcXWfp6QBPlm5i0jAczyOGAW3o54TDiqA== 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=RuZYozsszV04m9+f6PLw4EoD1EIVUX6sjonI35T2M80=; b=UjMzYmLkaXd9rp05de9D8B1GPCuUFeJi+kQPkV5H5ximlDSwdF31iMvlIOBLC2Z0O8FTAH0SCDnoRmsJ+pdtZprVVeIKVAlCrCFQBD6j40GSxRkzMPr96BUnEN7c9U+11n1souXsERM/x72eoidQgg03BIJBj4SeCNEILlVIKcr+jqs5v/r2oefQ6SeLHgLzlaAQ1m96X5HMdSMXA+AlCWzDdFsT4ctF3Fqzh+ay6gY4gnGDOplHcpbsGuiVIgurtTd8MIQyak0AtR1pVKw+hoIYhRuQ27zufoGsK30sfub4asMbkhFjkWyfU5UdNkDSeYYqUqKGF/y/kbNchvGQFg== 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=RuZYozsszV04m9+f6PLw4EoD1EIVUX6sjonI35T2M80=; b=J2BS3BK0PJAdK64OO/WJIVZGJ6ByKnpELstcH0cC1J0Q2VQSLKOZpqHDLqvBWxQ8mHMgGJSP6lv7CcXMUY2BoS3Kv3FgcBJiW1Xmo6PPRVwHN6mTfRReozg70EpqOb2Yp5TYMiZs0jhFGVspMH+wocWbpwSR7MEvF+Bm7MLI+JU= 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 DBAPR04MB7318.eurprd04.prod.outlook.com (2603:10a6:10:1ab::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.26; Mon, 7 Aug 2023 16:53:11 +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.6652.026; Mon, 7 Aug 2023 16:53:10 +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 v10 resent 2/3] PCI: dwc: Implement general suspend/resume functionality for L2/L3 transitions Date: Mon, 7 Aug 2023 12:52:37 -0400 Message-Id: <20230807165238.569297-3-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230807165238.569297-1-Frank.Li@nxp.com> References: <20230807165238.569297-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR05CA0093.namprd05.prod.outlook.com (2603:10b6:a03:334::8) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DBAPR04MB7318:EE_ X-MS-Office365-Filtering-Correlation-Id: f8d9c33d-8e95-452a-4da3-08db9766c85c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H23mEj2AqHxZfXvxN+PXsaMR6s89DekiariWrqQQFkIobgOaCsZ4IoQi10HmSgRhdZJO10lRApoClv2OdAv8TOEuP1UE2gpKi7xG9X1FXuHR8IOaahn9HZxFe1jiFl2EnSufapqZDoqVkeuh2eWx/DwxDIiGuQNqzgFO3MwO/kJ3CUrUlDtuClubBJA1EJV2MMDazw0Vq/QB4oqWx5IUw1066UkkSENlx8nsAG6Yam5FsBMb4uimcCY2YSs1A1f9iX/PEVOE5lMcKnJAsPepJWGIAhUa5z/KnK3lESXLH+TmZQRGeXKhoGB0JIVzYixuHc3m9UCC1d6vQ4GFHakcM7fEDLyz18gKbaDmKj5Z9HDxM+AOa7o6G3gTTaxw0Yt45tu9Xz06yJfMeZlwlatqu5wCEtXNcRGr0DuUCN0zNnVGPvnfoh8AByRJa5so5bKCuZyuEtLI076SOctmnlEli//4IzadnQXQ7esU9MADjHrs6pE1c2V1bs0WhDa2YrBEsIkNl5CYscXnEnz4/+qD/MjaeK9rmZEq3BEzeY64g5J15J5DiMWiDyLPqQCfh6eTeda4QwOfo7Lh9Utg+B0V+/kRoMrn159xAtQpdlFAwnTH7g//RMtw3kR/dEwrPMad 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)(396003)(366004)(376002)(136003)(346002)(39860400002)(451199021)(186006)(1800799003)(2616005)(36756003)(6512007)(4326008)(316002)(6916009)(86362001)(478600001)(38350700002)(38100700002)(52116002)(6666004)(66946007)(6486002)(66556008)(66476007)(6506007)(41300700001)(1076003)(26005)(15650500001)(8676002)(8936002)(2906002)(83380400001)(7416002)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uWRGKrNdA5nFq+yG7cWX4RTbzyJLx9i5F//VkNFpT8pmntaZHn4ImsvXxRE8SDUX7C0CyjS0MrDocovKDC43lEX1cOZyoCDGePYHLy9Yl6N5QWSgQ8uhCQTQYtxfouEBc9nsvJaOB7Fpy2UwXuI9yp7I1HAOHHrn4hamtGvK/EMVKxDom+DL0jtr4dJRK9UfrQSVaTBgF+B1y2qTDmbnidZKdrv9kbySipne2ItThVo4uh8/xPBrJNb29KPCXYQroqYduULutKn8sTlxbSRZ/LN80KLmf42QS4ZXprZxKcko34cLgwtSh/yu54VYJFDnUhLgQs9XfX+T8kwNxAXvI6qyv+kJ5phZT/MYdb0rAm6/41cDOH/fa25EOAW/yPuCf2QLjDWZgQXDwVYtRVtKyPSGHAgCKNYOx2rWVA0gVwIIR4QLCchkWQI1bpNXQE523e2tY5i5Nez6KTll8PpsegBw1yeI4I9oxizMTbgRKTs5LP6+UhCKu4Cq4v8MEUxmzXvOXfJ6GkvdKkIx/cXpInlZZW6544H39cU4rbHGlw+3fuC3UwFXypSCfZE3s9LSsmYgXoaLZTIyzLGX6vIURUqhioqNSM9VDUu9p5TwfWXV2TGByS7sT41yaa3MOvOeFwdS4HDDIKFN0p/kNtHpiz0/18fRJBsi08KPKkPBYdXYx7bS43pc5HK/3JSBC5Xnx583Qm064AqxIik4HEXgztYCV6ZJ4VPqZH6GHWezyOpimkD7c/lUohdhkNV4dUChWK5WRIXrjKeoDPJwyLGc9QvynrL6sGV4bNOXxRpWLgz0Cq+YoD40/uJUoIE5BfNtthFPZku8U51/obIIoEw6ulxG9Zum8N8n5OfFagfVhBlxzz+7FsgUQGnIeM3KxJXkdGw0DWTBEPIAvsE+2lzJKxe4A5jAHYSqBWSx75B/kbcLfeBApsAm4ePw2nToHQhgq6blnBokccz6kziTadNoABFJL+V/GkeSKlx0Ermv8jvAl6vQMIYLKe0fvqH1whXc9G9yHDAr2LdRM8k1UuSpuNd/g1ekb0CZC3Nt/Ms0eRfGd1vI2iGDIsneMu0BKgEU3Une/ltIVPHdruFUxWf2ZNnHZx53sc6Gr710TITIk1pOexvkahsGVVLith9m10PcwdYJlIpJhchRlflx0mKMDCaRnIJWn5ajUhNzvPGclPpuFjz3k2pS8gc8uq3hGO23w3NtizqlKZ+HLWqxStYlqoaTKSAkoDyqnu0eeP25vrmPttpWrzdRUmOeKAQKrvJ/97v+OKmEoJwxpswQVuArDdY55nxdr7uilLWa2vCLuo8pkFRCvJKFFhaiXo65e662x0oYWPVw/p4aKhn88KsQAs/74FIRv1n8xaafICRyHvqZVY+cGOUYRg08pSaJS5zyCqHVijnDT+iBgte16B6kOajNCragm73HyFIpfpK/4ms8NR+ZlbMmVEDR+fgykQzpa/EW/XkOLr2V3WXJIP72QANtLnx4wYfV3Z14kakiJMw1KsrdDCim+6YDPcTZdj8tBbjubfHfOf3iGCUaZT7wbXwXHmxIH+Lq4ViCxOzRFzP+0jnuED9Br9vDBg0st+HA X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f8d9c33d-8e95-452a-4da3-08db9766c85c X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2023 16:53:10.9174 (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: UZth4JX3e6mbGoA65CjkAodlKni2Rv+KVHm2EFcmsxRZsEpzJWFNR7RKqjIWK3fbSpr4OGaf0qnIYjeVvbIcOg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7318 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 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773596993972205986 X-GMAIL-MSGID: 1773596993972205986 Introduce helper function dw_pcie_get_ltssm() to retrieve SMLH_LTSS_STATE. 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. Acked-by: Manivannan Sadhasivam Signed-off-by: Frank Li --- .../pci/controller/dwc/pcie-designware-host.c | 76 +++++++++++++++++++ drivers/pci/controller/dwc/pcie-designware.h | 29 +++++++ 2 files changed, 105 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c index 9952057c8819c..cdbff11a7d00e 100644 --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -8,6 +8,7 @@ * Author: Jingoo Han */ +#include #include #include #include @@ -16,6 +17,7 @@ #include #include +#include "../../pci.h" #include "pcie-designware.h" static struct pci_ops dw_pcie_ops; @@ -807,3 +809,77 @@ int dw_pcie_setup_rc(struct dw_pcie_rp *pp) return 0; } EXPORT_SYMBOL_GPL(dw_pcie_setup_rc); + +int dw_pcie_suspend_noirq(struct dw_pcie *pci) +{ + u8 offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP); + u32 val; + int ret; + + /* + * If L1SS is supported, then do not put the link into L2 as some + * devices such as NVMe expect low resume latency. + */ + if (dw_pcie_readw_dbi(pci, offset + PCI_EXP_LNKCTL) & PCI_EXP_LNKCTL_ASPM_L1) + return 0; + + if (dw_pcie_get_ltssm(pci) <= DW_PCIE_LTSSM_DETECT_ACT) + return 0; + + if (!pci->pp.ops->pme_turn_off) + return 0; + + pci->pp.ops->pme_turn_off(&pci->pp); + + ret = read_poll_timeout(dw_pcie_get_ltssm, val, val == DW_PCIE_LTSSM_L2_IDLE, + PCIE_PME_TO_L2_TIMEOUT_US/10, + PCIE_PME_TO_L2_TIMEOUT_US, false, pci); + if (ret) { + dev_err(pci->dev, "Timeout waiting for L2 entry! LTSSM: 0x%x\n", val); + return ret; + } + + if (pci->pp.ops->host_deinit) + pci->pp.ops->host_deinit(&pci->pp); + + pci->suspended = true; + + return ret; +} +EXPORT_SYMBOL_GPL(dw_pcie_suspend_noirq); + +int dw_pcie_resume_noirq(struct dw_pcie *pci) +{ + int ret; + + if (!pci->suspended) + return 0; + + pci->suspended = false; + + if (!pci->pp.ops->exit_from_l2) + return 0; + + pci->pp.ops->exit_from_l2(&pci->pp); + + if (pci->pp.ops->host_init) { + ret = pci->pp.ops->host_init(&pci->pp); + if (ret) { + dev_err(pci->dev, "Host init failed: %d\n", ret); + return ret; + } + } + + dw_pcie_setup_rc(&pci->pp); + + ret = dw_pcie_start_link(pci); + if (ret) + return ret; + + ret = dw_pcie_wait_for_link(pci); + if (ret) + return ret; + + return ret; +} +EXPORT_SYMBOL_GPL(dw_pcie_resume_noirq); diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h index 79713ce075cc1..629bccfa92ddd 100644 --- a/drivers/pci/controller/dwc/pcie-designware.h +++ b/drivers/pci/controller/dwc/pcie-designware.h @@ -288,10 +288,22 @@ enum dw_pcie_core_rst { DW_PCIE_NUM_CORE_RSTS }; +enum dw_pcie_ltssm { + /* Need to align with PCIE_PORT_DEBUG0 bits 0:5 */ + DW_PCIE_LTSSM_DETECT_QUIET = 0x0, + DW_PCIE_LTSSM_DETECT_ACT = 0x1, + DW_PCIE_LTSSM_L0 = 0x11, + DW_PCIE_LTSSM_L2_IDLE = 0x15, + + DW_PCIE_LTSSM_UNKNOWN = 0xFFFFFFFF, +}; + struct dw_pcie_host_ops { int (*host_init)(struct dw_pcie_rp *pp); void (*host_deinit)(struct dw_pcie_rp *pp); int (*msi_host_init)(struct dw_pcie_rp *pp); + void (*pme_turn_off)(struct dw_pcie_rp *pp); + void (*exit_from_l2)(struct dw_pcie_rp *pp); }; struct dw_pcie_rp { @@ -364,6 +376,7 @@ struct dw_pcie_ops { void (*write_dbi2)(struct dw_pcie *pcie, void __iomem *base, u32 reg, size_t size, u32 val); int (*link_up)(struct dw_pcie *pcie); + enum dw_pcie_ltssm (*get_ltssm)(struct dw_pcie *pcie); int (*start_link)(struct dw_pcie *pcie); void (*stop_link)(struct dw_pcie *pcie); }; @@ -393,6 +406,7 @@ struct dw_pcie { struct reset_control_bulk_data app_rsts[DW_PCIE_NUM_APP_RSTS]; struct reset_control_bulk_data core_rsts[DW_PCIE_NUM_CORE_RSTS]; struct gpio_desc *pe_rst; + bool suspended; }; #define to_dw_pcie_from_pp(port) container_of((port), struct dw_pcie, pp) @@ -430,6 +444,9 @@ void dw_pcie_iatu_detect(struct dw_pcie *pci); int dw_pcie_edma_detect(struct dw_pcie *pci); void dw_pcie_edma_remove(struct dw_pcie *pci); +int dw_pcie_suspend_noirq(struct dw_pcie *pci); +int dw_pcie_resume_noirq(struct dw_pcie *pci); + static inline void dw_pcie_writel_dbi(struct dw_pcie *pci, u32 reg, u32 val) { dw_pcie_write_dbi(pci, reg, 0x4, val); @@ -501,6 +518,18 @@ static inline void dw_pcie_stop_link(struct dw_pcie *pci) pci->ops->stop_link(pci); } +static inline enum dw_pcie_ltssm dw_pcie_get_ltssm(struct dw_pcie *pci) +{ + u32 val; + + if (pci->ops && pci->ops->get_ltssm) + return pci->ops->get_ltssm(pci); + + val = dw_pcie_readl_dbi(pci, PCIE_PORT_DEBUG0); + + return (enum dw_pcie_ltssm)FIELD_GET(PORT_LOGIC_LTSSM_STATE_MASK, val); +} + #ifdef CONFIG_PCIE_DW_HOST irqreturn_t dw_handle_msi_irq(struct dw_pcie_rp *pp); int dw_pcie_setup_rc(struct dw_pcie_rp *pp); From patchwork Mon Aug 7 16:52:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 132319 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp1643112vqr; Mon, 7 Aug 2023 11:50:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEzsy2qQlTJPHdgovGfJ5yvqyZge2U7dvuYUAL1nWDmEF7JSoYqkphWCWS2eilTQtDZpq2Z X-Received: by 2002:a05:6512:10d4:b0:4fb:93db:fff3 with SMTP id k20-20020a05651210d400b004fb93dbfff3mr7353282lfg.16.1691434248511; Mon, 07 Aug 2023 11:50:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1691434248; cv=pass; d=google.com; s=arc-20160816; b=BGI0cee3GFghXbGK9vmea5hXiFh4U2DqsRSHQNqpEwilwy+jYURVulavcsWu+neoLv PYdtDC65EV+OYiSM9kNMN0MDUypNFrcoUe/KQ1LCh6grz4z9RXmljj850h65BY3IFbzK kHG8Nc6gc49JCP2bUZ52fitttBOtK0XUDU0frzYBkJq3sp6hlCIFgDGK0vdRWZCfJOm8 45FMkJmKjEGU84kPCwpVHygiODRCdh/1nINWHD+WBLk3DB/cUz/Ha9cJ9KFh7Sk6rZCR nLrckA3asx8qaFQJsxXBbcylG2ptqCTw9vG5OkfDAyPOH2FBNFR2DXqme4lOnTygDE3W +w7w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cemv0o+A4B4UVs6IecKdz+P02Zgm4E8Y/XAvJfrdSkY=; fh=LKnVPWvEa61PHnZAI3RMnA9ofhnPlVAAdbaNfQif9xk=; b=yurp2Pf6NWELmQCO6i2ha7T5bkYkAfF1Z5Z0dIoLScFLc3P4XYmXgTvBKX+/edj2uR VAza4kZSy+JO6UpFRl5W+Bqf9paDAXDY1PB/yBkpjhp+t3HxZKtgT4WLeccYjQdr6VY9 5zpHNHSEzZIlXIWgPo63mP1Yr8duzmXNMvgKgm0A9lGprDmKa8XpS8Fb9rsgvD/kZxvN TQizhjdGaoYjwYth06Njzha7TucoN5wn4PAcQWF0a7jkUJeqbK9G6DaAsCvqD/id+XZc Ofh5viBPpCjIkC/cAHcqCUTp3VGncNtGmfB9OdMfYQShRARR9NfA+7SpKtCvta6hlLEN 5aXg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Hffa5q+i; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d23-20020a056402517700b00522ab2a485dsi4588607ede.579.2023.08.07.11.50.23; Mon, 07 Aug 2023 11:50:48 -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=Hffa5q+i; 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 S231926AbjHGQxm (ORCPT + 99 others); Mon, 7 Aug 2023 12:53:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230142AbjHGQxk (ORCPT ); Mon, 7 Aug 2023 12:53:40 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2053.outbound.protection.outlook.com [40.107.7.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B30710DC; Mon, 7 Aug 2023 09:53:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KF/mu/qe8zrO8dYJab6q6yLaqeM/8JdD5LYoB4pPEqPvFRK0p1PPpPD0Ai8U9GZceKf2lugURobD4qwVT+ix2mdZ3BbRpMLSsMvdLGK9rwbJS9eXNAWUqPgtASxv2YaED9lBVH0JLl6YgRTxVGNB7VpsQnzb7ZGA1Kw2tq0qNR+nfTfHKU1zQPjgJ/vBuP6pgXhqxtxPrTFodrBTnfgw9e3AwGEhT6wdqY7MoPZ1mXsfOSzcNAO8iS2MhyS9Rl/58AkoX89k/q9y42m8Uz5LJDOwjJ0Djodc2TvtRyQQ4DJ5fpTdcww/q3Y9KQtLtEa1PDc8ncYXJoTK93/TuAemww== 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=cemv0o+A4B4UVs6IecKdz+P02Zgm4E8Y/XAvJfrdSkY=; b=BXOzEDC/X08AtGjjGZFDFisD63PanY6o30BlzitttXGt16L2KfbLRO//iCBbxzeHXqLT87wzHj+N0+8CMlU2uM7UDohROUB/09dZMpE21PfmTpilecvqlX6nx2i4jZ2suWd0xSPWhsacktm/TPP+XZ6nk+CeNDXLvyLULe7Hc3Jf8kGHaZk33KZv2kXt2bcjL6xGX4Gv3qn/TttZUwUCQ4AvBk8FIUtX4iq+YAbA+TKDOEi3EX/3Flt1nP8QzcxVQHP/HEONGRMwJxKkjbrXAHkAgpCQCUPIciVoKodfHm5BY+kbTva8dXfu0/cQPnqcYwrKNtbldr43UXbx+NfN+w== 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=cemv0o+A4B4UVs6IecKdz+P02Zgm4E8Y/XAvJfrdSkY=; b=Hffa5q+iHh2OWWWflBehs03zPcgBO+Iwd0etP8/6QaIGdh2ULLDS5L2USWOW9KjIZklVJrjvhOySv2eljvtCzWeR0btT6oiKtSyMBn6xWma2ZCpS3ZOediarm2Sc7j/sFotL6Z7Y2uOWvmMgQNatUwA9FNb8U8IbbDQCE5UYmcY= 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 DBAPR04MB7318.eurprd04.prod.outlook.com (2603:10a6:10:1ab::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.26; Mon, 7 Aug 2023 16:53:20 +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.6652.026; Mon, 7 Aug 2023 16:53:20 +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 v10 resent 3/3] PCI: layerscape: Add power management support for ls1028a Date: Mon, 7 Aug 2023 12:52:38 -0400 Message-Id: <20230807165238.569297-4-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230807165238.569297-1-Frank.Li@nxp.com> References: <20230807165238.569297-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR05CA0093.namprd05.prod.outlook.com (2603:10b6:a03:334::8) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DBAPR04MB7318:EE_ X-MS-Office365-Filtering-Correlation-Id: 04b26cf6-2fb2-42bf-406b-08db9766cb89 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Mt32X455/BmZ20SL5kXiUrgvVLt4uL77e1CpCgvQ9ibkcbGEDx+GRCguMmQBFqsN8SwBVeTaUPaAY7NTeIJ+6qTi45lc+UwdM3286dXX2W+x1T1Pp5/mjTsU0hd0i8M4eVj6cCeCrW6XkFg12dKnMVPCRsJrgzOpFFA8GU9sJ5g+vWZEJEJPjpEpuvI/vh39lVETtXdwUCVpM6I7z9mPSMYHe2fRPLkNbGfqAliio8gUXlPK7j3UAkVRXxBgeOEEBkfWI5hRfNanTdCCOz57dv570p584TVkU27jDlEwKjq2mhnpQEVDln0IRoMlNEne8psbinV1YCXKv6erHWaSfRiP1BOmb8kYl2J2suIl4KE5cnA6gP0dB28iBk5M255Z/BPF3WR+VDuCzHOoCg3ev1QMMT6Z+MRzcPdCz+PSy51xYxd7WGTVxuiLJXZFZLrvBHA3kXSGk8AhZVv45BoFjhbnyX1n0zeKiNRPL0mfwSgYTV7Ixudg3bfXqSuSiXjjlXp4hnO09CgM7llrZtyU0hs5zqhazugajDnYdf98jumSo6YXd2SmoLTO4aYfMguHFcMR6H4sN0U/IROK2lnau9cOcOoJbG+UrGxKTU5Twn914C4qptvmC65vxKpv+jUC 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)(396003)(366004)(376002)(136003)(346002)(39860400002)(451199021)(186006)(1800799003)(2616005)(36756003)(6512007)(4326008)(316002)(6916009)(86362001)(478600001)(38350700002)(38100700002)(52116002)(6666004)(66946007)(6486002)(66556008)(66476007)(6506007)(41300700001)(1076003)(26005)(8676002)(8936002)(2906002)(83380400001)(7416002)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1xb4FY5j72g4E1UMCfJhzo9mi65o4RFzZoHyhfE7xa/toNLVfb4f+7zJdQo6S/WonHOOb38J1wq8Vctyw8lNn5pSN/FCY/FWMlvlYx77bY1pjeLs1nclW66f3aBS/QgqhPgyAJHTe1nIC2bSTXbXmCGYFwgGXW/GT6TD0Im1YkgRvVwf0+d2oO0Fqjwx0OrS3QG9sVaXKHKTRUes1EyHiDtkcSJ+tQiFT2z7k8cK80oNr5BQ0/ltlvazgFflvGOPeQ92RWVQYHjQuh+En6wxEAz3ky9s9g+0XCzryWiqyYjkxr1QkoFSsov5t+Q0kH5WjWWYAYEZzOHl8XjU05Sxg+ELEWx7lRCpTAKJ/efuMF3JS2spKc25hi2HthwVjLYuytBAeWA3dTlfqxzLWyCsnOGU+aKzebjwG6yJXdM+/vrAmuTwBY6IADrFETQ49hb/cuuewhsfmo8FVbQfWaSO1YIlG6cxIWe7eyz4HITHtHEGmHu66n3lDV+A0aLIz254NxK4YuuEsMQK+fLDnw1AJR9X3U+KrhRP41Jd0mJTB32JoZdr8+VeFQ1eFMDk672EdrjMQxRXgm4Uke3wgEVd8WSu4xFIZtIz5pUMvSlIDPUUS3hzUW4zw5/j0rpk7ysFSvCfmP0/Ve/RhqGs6M4B4C6bKGJyQeZ5e69zmqncNQ4R3SCTONS+DoGvQ2JJ5o4qqsnK+dr63NNSuLmP+rGdjw0C9+vhfDAIsvHnJhrd1D7E7us/0e9zrSXvrGtxMJUc4J1IOQpl79pIBZA2mW/56lcJphabdMuecjFP+hWApB6ikPKoym9DJCVhIvw5q2vY6CXrvUZyv/OGptNYGgBeUZHEECbroVPBxO4gqZhn1j3ADeTkfYsXuapiQuveURFNutup357LIUJgnoq0txNVF0QpHX04sB4OPXusRt6XAqd+fe2eXBBmmqok+0tcx0ZXel9RlRv+EclEB+6b7SzWLPYKn9wtSJ1s9YegbeRKcWGRMFL1OgN3NXQ2S7jdWSrIFzYoaEbFg7sQAHH6hGPKCCh5u9J35oDEqRoOvqKxaY9ypFFxs6mG/doOhcQImRIqbhVe0E/TMDQlv092P8SUgp5mIjpJPv9+B+JSjO08PlU0tAaSBG5LHb9pnvNBE/YKMTcL532OjdzQq4esLb75lHODkdW26ULif5HfaQ/SU4PjF3kwmMJGzlesU5ak7wb92U8vqvsV3Xk1N0vhlLZvaDzRmLzY9mF5UKiRvfZF1c00qUd3OkeWwNIdrf46Vn0YChD944Icc+sssmSeMgX/rVC7vF4Eg9Cl+M8NPjppkPEElu3jJrezADKSlO3sQGDeQ7SAZI3249BHCCYodQzHdN6qtDNmkmX4krkRfh1qbJ7OVGWokkWWCaRCpYZzcFdwBEYn+TAS9kx6P6PZApG6FO0pOHAqdeg8hljM10SSSpLdIxVH774nQ35ZdOhPC14OHpD0GQYPm84ceeG2d2wRBGd7FW9YQyegtFlVvsks1fTqvCPPhuIIdv3Gyh5/Y8/QwUoUSZPdutqKBIUh0amdqYqV+vplvDHWbk9e6nCJlykatGhm/tQ4bCxz/PAaEwFT X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 04b26cf6-2fb2-42bf-406b-08db9766cb89 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2023 16:53:16.2129 (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: +nB5tuuYPGj40ADKuOYngV2xeRLskmvVDXWsmvPRL9kqFduJK5mOeg8fJnoLGVRupyRj5vzL6FbF/L8zPUsTxw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7318 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 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773597358723103224 X-GMAIL-MSGID: 1773597358723103224 From: Hou Zhiqiang Add PME_Turn_off/PME_TO_Ack handshake sequence for ls1028a platform. Call common dwc dw_pcie_suspend(resume)_noirq() function when system enter/exit suspend state. Acked-by: Manivannan Sadhasivam Signed-off-by: Hou Zhiqiang Signed-off-by: Frank Li --- drivers/pci/controller/dwc/pci-layerscape.c | 130 ++++++++++++++++++-- 1 file changed, 121 insertions(+), 9 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-layerscape.c b/drivers/pci/controller/dwc/pci-layerscape.c index ed5fb492fe084..7586aece769b2 100644 --- a/drivers/pci/controller/dwc/pci-layerscape.c +++ b/drivers/pci/controller/dwc/pci-layerscape.c @@ -8,9 +8,11 @@ * Author: Minghuan Lian */ +#include #include #include #include +#include #include #include #include @@ -20,6 +22,7 @@ #include #include +#include "../../pci.h" #include "pcie-designware.h" /* PEX Internal Configuration Registers */ @@ -27,12 +30,26 @@ #define PCIE_ABSERR 0x8d0 /* Bridge Slave Error Response Register */ #define PCIE_ABSERR_SETTING 0x9401 /* Forward error of non-posted request */ +/* PF Message Command Register */ +#define LS_PCIE_PF_MCR 0x2c +#define PF_MCR_PTOMR BIT(0) +#define PF_MCR_EXL2S BIT(1) + #define PCIE_IATU_NUM 6 +struct ls_pcie_drvdata { + const u32 pf_off; + bool pm_support; +}; + struct ls_pcie { struct dw_pcie *pci; + const struct ls_pcie_drvdata *drvdata; + void __iomem *pf_base; + bool big_endian; }; +#define ls_pcie_pf_readl_addr(addr) ls_pcie_pf_readl(pcie, addr) #define to_ls_pcie(x) dev_get_drvdata((x)->dev) static bool ls_pcie_is_bridge(struct ls_pcie *pcie) @@ -73,6 +90,60 @@ static void ls_pcie_fix_error_response(struct ls_pcie *pcie) iowrite32(PCIE_ABSERR_SETTING, pci->dbi_base + PCIE_ABSERR); } +static u32 ls_pcie_pf_readl(struct ls_pcie *pcie, u32 off) +{ + if (pcie->big_endian) + return ioread32be(pcie->pf_base + off); + + return ioread32(pcie->pf_base + off); +} + +static void ls_pcie_pf_writel(struct ls_pcie *pcie, u32 off, u32 val) +{ + if (pcie->big_endian) + iowrite32be(val, pcie->pf_base + off); + else + iowrite32(val, pcie->pf_base + off); +} + +static void ls_pcie_send_turnoff_msg(struct dw_pcie_rp *pp) +{ + struct dw_pcie *pci = to_dw_pcie_from_pp(pp); + struct ls_pcie *pcie = to_ls_pcie(pci); + u32 val; + int ret; + + val = ls_pcie_pf_readl(pcie, LS_PCIE_PF_MCR); + val |= PF_MCR_PTOMR; + ls_pcie_pf_writel(pcie, LS_PCIE_PF_MCR, val); + + ret = readx_poll_timeout(ls_pcie_pf_readl_addr, LS_PCIE_PF_MCR, + val, !(val & PF_MCR_PTOMR), + PCIE_PME_TO_L2_TIMEOUT_US/10, + PCIE_PME_TO_L2_TIMEOUT_US); + if (ret) + dev_err(pcie->pci->dev, "poll turn off message timeout\n"); +} + +static void ls_pcie_exit_from_l2(struct dw_pcie_rp *pp) +{ + struct dw_pcie *pci = to_dw_pcie_from_pp(pp); + struct ls_pcie *pcie = to_ls_pcie(pci); + u32 val; + int ret; + + val = ls_pcie_pf_readl(pcie, LS_PCIE_PF_MCR); + val |= PF_MCR_EXL2S; + ls_pcie_pf_writel(pcie, LS_PCIE_PF_MCR, val); + + ret = readx_poll_timeout(ls_pcie_pf_readl_addr, LS_PCIE_PF_MCR, + val, !(val & PF_MCR_EXL2S), + PCIE_PME_TO_L2_TIMEOUT_US/10, + PCIE_PME_TO_L2_TIMEOUT_US); + if (ret) + dev_err(pcie->pci->dev, "poll exit L2 state timeout\n"); +} + static int ls_pcie_host_init(struct dw_pcie_rp *pp) { struct dw_pcie *pci = to_dw_pcie_from_pp(pp); @@ -91,18 +162,28 @@ static int ls_pcie_host_init(struct dw_pcie_rp *pp) static const struct dw_pcie_host_ops ls_pcie_host_ops = { .host_init = ls_pcie_host_init, + .pme_turn_off = ls_pcie_send_turnoff_msg, + .exit_from_l2 = ls_pcie_exit_from_l2, +}; + +static const struct ls_pcie_drvdata ls1021a_drvdata = { +}; + +static const struct ls_pcie_drvdata layerscape_drvdata = { + .pf_off = 0xc0000, + .pm_support = true, }; static const struct of_device_id ls_pcie_of_match[] = { - { .compatible = "fsl,ls1012a-pcie", }, - { .compatible = "fsl,ls1021a-pcie", }, - { .compatible = "fsl,ls1028a-pcie", }, - { .compatible = "fsl,ls1043a-pcie", }, - { .compatible = "fsl,ls1046a-pcie", }, - { .compatible = "fsl,ls2080a-pcie", }, - { .compatible = "fsl,ls2085a-pcie", }, - { .compatible = "fsl,ls2088a-pcie", }, - { .compatible = "fsl,ls1088a-pcie", }, + { .compatible = "fsl,ls1012a-pcie", .data = &layerscape_drvdata }, + { .compatible = "fsl,ls1021a-pcie", .data = &ls1021a_drvdata }, + { .compatible = "fsl,ls1028a-pcie", .data = &layerscape_drvdata }, + { .compatible = "fsl,ls1043a-pcie", .data = &ls1021a_drvdata }, + { .compatible = "fsl,ls1046a-pcie", .data = &layerscape_drvdata }, + { .compatible = "fsl,ls2080a-pcie", .data = &layerscape_drvdata }, + { .compatible = "fsl,ls2085a-pcie", .data = &layerscape_drvdata }, + { .compatible = "fsl,ls2088a-pcie", .data = &layerscape_drvdata }, + { .compatible = "fsl,ls1088a-pcie", .data = &layerscape_drvdata }, { }, }; @@ -121,6 +202,8 @@ static int ls_pcie_probe(struct platform_device *pdev) if (!pci) return -ENOMEM; + pcie->drvdata = of_device_get_match_data(dev); + pci->dev = dev; pci->pp.ops = &ls_pcie_host_ops; @@ -131,6 +214,10 @@ static int ls_pcie_probe(struct platform_device *pdev) if (IS_ERR(pci->dbi_base)) return PTR_ERR(pci->dbi_base); + pcie->big_endian = of_property_read_bool(dev->of_node, "big-endian"); + + pcie->pf_base = pci->dbi_base + pcie->drvdata->pf_off; + if (!ls_pcie_is_bridge(pcie)) return -ENODEV; @@ -139,12 +226,37 @@ static int ls_pcie_probe(struct platform_device *pdev) return dw_pcie_host_init(&pci->pp); } +static int ls_pcie_suspend_noirq(struct device *dev) +{ + struct ls_pcie *pcie = dev_get_drvdata(dev); + + if (!pcie->drvdata->pm_support) + return 0; + + return dw_pcie_suspend_noirq(pcie->pci); +} + +static int ls_pcie_resume_noirq(struct device *dev) +{ + struct ls_pcie *pcie = dev_get_drvdata(dev); + + if (!pcie->drvdata->pm_support) + return 0; + + return dw_pcie_resume_noirq(pcie->pci); +} + +static const struct dev_pm_ops ls_pcie_pm_ops = { + NOIRQ_SYSTEM_SLEEP_PM_OPS(ls_pcie_suspend_noirq, ls_pcie_resume_noirq) +}; + static struct platform_driver ls_pcie_driver = { .probe = ls_pcie_probe, .driver = { .name = "layerscape-pcie", .of_match_table = ls_pcie_of_match, .suppress_bind_attrs = true, + .pm = &ls_pcie_pm_ops, }, }; builtin_platform_driver(ls_pcie_driver);