From patchwork Thu Mar 25 07:26:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 12163289 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7312C433DB for ; Thu, 25 Mar 2021 07:27:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B504C61A17 for ; Thu, 25 Mar 2021 07:27:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229764AbhCYH0b (ORCPT ); Thu, 25 Mar 2021 03:26:31 -0400 Received: from mail-co1nam11on2068.outbound.protection.outlook.com ([40.107.220.68]:3489 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229812AbhCYH0W (ORCPT ); Thu, 25 Mar 2021 03:26:22 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZYPhB3xQlZbAsPOQeEUG32I686xVDi+9xrdMTvB9PC+R2rzv8IArO4q6D/z8yqLe61V9pzOih8vNv6Lg3xMEnSi5XoUiAZ7L2EtFjU0UtC1ZTguq/9+g25XN1GWG3jL+su985NLg+cNWTYtEK+PWfPIGm8lGJgpGLa2sRVGF/0FZ/vLH0tKIMUqHxmL95zoyNIj4834flhezwRDEOy/Dvds4Hm3yG15RmBryMMNK/Bupx+x3TBBrxV27rRHLkASTljexp2rP1aAq2IpcMJ/9a8YMbMjFsfQdR5YgHaHvOIQYhEOgzgKkQUsDJPjQNnV5PbKSQgqAZVkDq5erxS4U+g== 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-SenderADCheck; bh=eFfFITAfcgY0T99BUQwmg4+ZcfrE3lO9uJXnKMO6/tM=; b=HVr6tE7WGOjNiNcSBL19ibwalyFs/R4B6il9SvUtWOV13SH13nFR0ZtcNpgbmgOVx9VYrELc7YW2SMN/aJnw78chEveRnqhpbgNcsDmIDnfF5Pto/Y9cevxyYWJMGXGQ8KyykXUAi8654V89RW9s8KIT08fKVwa+Fz7Xy+yYE6GuPmFz06jrql2gvyVwte57TOGwIt6mBWqZQ3hWG7PHq4FGZyn3ypSRumfUyHa0olpKXS7IbVt+A6dEMMULoVRrcSkLdfLE78pYw33lIBfN6c6QB9eUMxyk3rxGgYjWLIL9VSMaZx2s3Y5f8YfPcGPJFimVosmMhHy1tdTsmPNpeQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=synaptics.com; dmarc=pass action=none header.from=synaptics.com; dkim=pass header.d=synaptics.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Synaptics.onmicrosoft.com; s=selector2-Synaptics-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eFfFITAfcgY0T99BUQwmg4+ZcfrE3lO9uJXnKMO6/tM=; b=j2y1CQcI68JQzGcAdAXETkMfYYrwTh8fsnjuhmfozR2Iry9yaTrWivgBG3b3y2/PMS5vtI1DzTc6uLofKFLlMhj42G95Ycw0jElQHMqLQAY2ir0u+Rxz5zhUaHQUIiY3K+FAJehVMo2hJATreCDLToNpVu5+Z7p66dGlP+6KxHU= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=synaptics.com; Received: from BY5PR03MB5345.namprd03.prod.outlook.com (2603:10b6:a03:219::16) by SJ0PR03MB5920.namprd03.prod.outlook.com (2603:10b6:a03:2d6::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25; Thu, 25 Mar 2021 07:26:17 +0000 Received: from BY5PR03MB5345.namprd03.prod.outlook.com ([fe80::8569:341f:4bc6:5b72]) by BY5PR03MB5345.namprd03.prod.outlook.com ([fe80::8569:341f:4bc6:5b72%7]) with mapi id 15.20.3955.027; Thu, 25 Mar 2021 07:26:17 +0000 Date: Thu, 25 Mar 2021 15:26:04 +0800 From: Jisheng Zhang To: Bjorn Helgaas , Jingoo Han , Gustavo Pimentel , Lorenzo Pieralisi , Rob Herring , Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3] PCI: dwc: move dw_pcie_msi_init() to dw_pcie_setup_rc() Message-ID: <20210325152604.6e79deba@xhacker.debian> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) X-Originating-IP: [192.147.44.204] X-ClientProxiedBy: BYAPR11CA0053.namprd11.prod.outlook.com (2603:10b6:a03:80::30) To BY5PR03MB5345.namprd03.prod.outlook.com (2603:10b6:a03:219::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from xhacker.debian (192.147.44.204) by BYAPR11CA0053.namprd11.prod.outlook.com (2603:10b6:a03:80::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.24 via Frontend Transport; Thu, 25 Mar 2021 07:26:14 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1751da76-824e-42e1-1724-08d8ef5f4723 X-MS-TrafficTypeDiagnostic: SJ0PR03MB5920: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:510; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: G+8TfUqIJfuvxr6ebItq0jJiPPeI/p04MsYJ33GrE0aJtf7V/Drmjlfrwpxs7lf4hb4zGmBeXkcXEAp6+tV1yYcW6V6NYlrtUZQPzNZ+O8VJkoFZHWPExZBSDfxfWmdqZNaGETbb7fAylGVWCI/emAHmxGcmCqHgvWUzph3ZOcUrZG/N7zt/h/mkgxyLPIWHkkGlznvN9sb54FA7xtUDvSOs0D53dstIkRKgSpCw8mRQ7prJh7RxZaY9Fj1WxA7FBnSVu0Q44lPHiVsDqdJ8knjMLb2XKs74IOcJA0q+xCkKIJ/QFuoXt9OPUK+t7cNn1gg9F+w/Y2fizkRTgdADysUq57j2wn1AIkR0ACfTSAw8a+dlK5EYTr+h6rkEoHG3qhGC5Tz43PpQucr6RFho6s5YkpPNJHmrqn39zaimBxQpno9KD5eD1G5VWB1DXxm8BmJ0Agmz1oXNTGO0IB6C08jnsbNCP9yzVOaDi1IXk7zINj3EiawrDSqNRvcmu3dbZ4/JWnTBLkwblUHU4fPIWmDpAn7PQL/gPDmMIEysNDXjuazH+r41N+DsRDFTx+jBd5DLKXCLlLX/GEaVnpTsfRYaOtOVbw89/ogpuQkAczuP/pBvaOIF3hkH8mHexQE/MvDawgNgKYhVkrb64SX+1bGYsae4gPbAsfhK0Yxvnqw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR03MB5345.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(376002)(136003)(39860400002)(366004)(346002)(1076003)(316002)(83380400001)(4326008)(8676002)(8936002)(5660300002)(110136005)(478600001)(9686003)(6666004)(956004)(26005)(66556008)(66476007)(55016002)(6506007)(52116002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XY2Wk+ECuheN5UntiZBdaWs/xamRRfjZC7tvT30ZqgdAywbauWDdmD/1HiH6CKprvqZ8U8L831eaFxSvIlsYa1WsY+l6jxs87jV0rcsSClNR74P3wVDHigbwggfA3d2MhNSOVYQvrK/TgyEqpf1MT8f55bsOTsvU94Emh4z9gYE0Pf/gfQOZC6oIhvZb4jsO252YGx7/KZfFbygkkba34Trwq9BgpHeNtKkmRETSfUwIvj35X/OEVaMbr2oen1DekakDm4dYRaPyZgKFrSzF9JfDeDwc1lK9dGV3k/4/C6qSLDzyAfsVXYX9L6CkPCCic6AH3qBmxQXCdhNQGMZNw3l X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1751da76-824e-42e1-1724-08d8ef5f4723 X-MS-Exchange-CrossTenant-AuthSource: BY5PR03MB5345.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2021 07:26:16.9061 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Ivg0Bp9Ttl/0uMIEsEaTBrWkgq9b4I5LoQxImP5+VPYvoep9aqDoKPOMykIYeunIGcJw85DeYuqDrobSIL+Zig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5920 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org If the host which makes use of IP's integrated MSI Receiver losts power during suspend, we need to reinit the RC and MSI Receiver in resume. But after we move dw_pcie_msi_init() into the core, we have no API to do so. Usually the dwc users need to call dw_pcie_setup_rc() to reinit the RC, we can solve this problem by moving dw_pcie_msi_init() to dw_pcie_setup_rc(). Reviewed-by: Rob Herring Signed-off-by: Jisheng Zhang --- Since v2: - rewrite the commit msg Since v1: - collect Reviewed-by tag drivers/pci/controller/dwc/pcie-designware-host.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c index 7e55b2b66182..e6c274f4485c 100644 --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -400,7 +400,6 @@ int dw_pcie_host_init(struct pcie_port *pp) } dw_pcie_setup_rc(pp); - dw_pcie_msi_init(pp); if (!dw_pcie_link_up(pci) && pci->ops && pci->ops->start_link) { ret = pci->ops->start_link(pci); @@ -551,6 +550,8 @@ void dw_pcie_setup_rc(struct pcie_port *pp) } } + dw_pcie_msi_init(pp); + /* Setup RC BARs */ dw_pcie_writel_dbi(pci, PCI_BASE_ADDRESS_0, 0x00000004); dw_pcie_writel_dbi(pci, PCI_BASE_ADDRESS_1, 0x00000000);