From patchwork Mon Sep 19 18:33:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vidya Sagar X-Patchwork-Id: 12980957 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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 C861BECAAD3 for ; Mon, 19 Sep 2022 18:34:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229746AbiISSeT (ORCPT ); Mon, 19 Sep 2022 14:34:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229540AbiISSeS (ORCPT ); Mon, 19 Sep 2022 14:34:18 -0400 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2084.outbound.protection.outlook.com [40.107.101.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C7E036DC8; Mon, 19 Sep 2022 11:34:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hm8++MXOFCCVpBe7J6kHQarXJ/CZL7afsVCj2miURr+ppH+4kwCzRDWj9JPh9eInkQak74CCih4Sb9GBQPG4cn0ZCVz5hOkZYSEes++knPo86YMGUUfqyOOi+N6h8WHo0yQ39UELGLCCc/J8FEXhrULOM2m1uUYzgRJmWniJTByAknUuyqlLFWIyE5TvE2wzqZOERGD+1nTMYVMqdyjsKDlyXNdA71eGIg2dxvVY9HG4oW4abV01nl8rRCEb2/0Kvz+aMoHjiake8LkrevSavEN8A6yUgCseA5Xkw3PEMHYp4jhvHgGyPYFiXCdM/6px3+ljD4i9UDCNqgd/17BMlA== 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=xyrZSZ1OeaWo83FMCyuGKkzVaHYRHndXZkpE8cMp81Q=; b=mFLh1uWGzzqjeOvmRriFgOw6u7UgKKYKhweGS+7p0pC1GhzeWC+fmT8+AIMZ+A02j6cpgJxk2+Rr9vHcEGZJKUBTOCBxtAP/OdMl+E2WJ6z4006hlygFcltdD0pb4KKFlK3GfoxB542yesKfeBS55DZFL9OpH00Wwu9TesY7M118ZDAasw/ymKRwU973DCEyZJLtHwMm7zjH3ElwP9lneciyr3kg3rz+D974tqv+pctpcv3cf5w5CzadymEd/KFyZWUuKcAJxsXpNCVojdiM8I4qemIAeJTw+A0DwEztcCpjhjOdeeidiXF5ik6XRnH5cMGEfTL6W9uq+dONVn7siA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=gmail.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xyrZSZ1OeaWo83FMCyuGKkzVaHYRHndXZkpE8cMp81Q=; b=jC7HRpaPNG8eBnh2nfb8lcMun6eQYz05QHZpidXcXddvNE3bZXRqa/3lFeSQajzvgisHXfE66St1++xXE0M9RIdOvlWbcRDQv5bc/E9yMgom9ITQeH25nR0FzzRKp3N3d3hVXK/1n4+VqnXEeab0BNXXKkHCnJdHp11kA6LN4CUa9KuytRYGqe9E1vtlGM0sz3t2VOXdfokyeHz5kgFet8+oWXzvBZzuBKdIV0H+PXEiorLYr2jt0NiYAzqsTHJymlkbmLK3KcMDrht2FJeKgxn5lIkHVDrFL56MfKx9fSzi7v9St/DxyTjS/KX+3b3/w5fzTPi18fvs5KMmqZSLqQ== Received: from BN8PR15CA0040.namprd15.prod.outlook.com (2603:10b6:408:80::17) by DM4PR12MB5087.namprd12.prod.outlook.com (2603:10b6:5:38a::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21; Mon, 19 Sep 2022 18:34:14 +0000 Received: from BN8NAM11FT059.eop-nam11.prod.protection.outlook.com (2603:10b6:408:80:cafe::a) by BN8PR15CA0040.outlook.office365.com (2603:10b6:408:80::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21 via Frontend Transport; Mon, 19 Sep 2022 18:34:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BN8NAM11FT059.mail.protection.outlook.com (10.13.177.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.12 via Frontend Transport; Mon, 19 Sep 2022 18:34:14 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Mon, 19 Sep 2022 11:33:58 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 19 Sep 2022 11:33:57 -0700 Received: from vidyas-desktop.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Mon, 19 Sep 2022 11:33:53 -0700 From: Vidya Sagar To: , , , , , , , , , , CC: , , , , , , , , Subject: [PATCH V4 1/3] PCI: designware-ep: Fix DBI access before core init Date: Tue, 20 Sep 2022 00:03:40 +0530 Message-ID: <20220919183342.4090-2-vidyas@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220919183342.4090-1-vidyas@nvidia.com> References: <20220919183342.4090-1-vidyas@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT059:EE_|DM4PR12MB5087:EE_ X-MS-Office365-Filtering-Correlation-Id: c7edc755-fa26-4413-66ef-08da9a6d8d87 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h0rgEyydnhNS+9p98SXjWVXsnmb3NfzMZH922H8Awpiw523d+SGPdXJO9zD7/CKKWkPKz9qcxQaLlEThRddLPzupOHqoN395HZ38AdIHaAktFwCTFUtzMx2vH2nG8HnRW8E2HtTEOzMryNVuZtNED3lFc6ePcTdxGcjphXTv0mx8AjhZXqXpZpSueXeBIysp6es8XS3ssdpDrF8t6qWsy1Pbbs8PuemDOpI10FXTrMvU01BhkazWzoiXqTXjnYM/pzLrfb1d6LV0K4W3PeOJXfvBNR8K7gepg2nBewP4OcTbBm9aEyf9gzvnHao9s7IvhE0d1qNqDPqFBfsO0onIgXQoNI9e8nkrxN2hR2oypK5CU6pAPDDzu6bfTHkxc5T9zJcTdENKeKioupgVOngayhjWuEu1W4GxA4W3j59g9YvJZybXDfiNYMaumv4YB85JiPZFMWhZfkULRCl/ezuCQ3Wddl36QvLcfyndftQJhM7QSLr9FDDuREUf8GUExSQS5M+iiP7qUgpVaXyqqQ/B5u6Q34JyP2wo/t7Fdv+Mz9G4lqL9WR7M5/SCxA5BH+mc5Gm9wUGnS//bjtEGbf7vm+8Pdlcc1Kmz5wAbOVhUH/IlGutlCd0X50q6pZVlBdO1GNv20KUXbFaJLPs/r7QxWcHmViiAzuFpnBX9ccrOByenfiV/aAAE0FmjjF7STKrCsFePVldniphEdxIKNJ3r8Qe+w7C3bWtU+jwWBrZ3gFf44CHqNaATPtCQtFCbpfB/FzbUWFyWrneEGUzhHfDOp2QpMFqLF+w6fmaBOg5dnQE= X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(136003)(376002)(346002)(396003)(39860400002)(451199015)(40470700004)(46966006)(36840700001)(26005)(7636003)(82740400003)(40480700001)(6666004)(8676002)(4326008)(2906002)(2616005)(356005)(41300700001)(36860700001)(921005)(7696005)(47076005)(86362001)(82310400005)(186003)(7416002)(5660300002)(36756003)(478600001)(8936002)(110136005)(54906003)(426003)(70586007)(70206006)(336012)(83380400001)(316002)(1076003)(40460700003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2022 18:34:14.0733 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c7edc755-fa26-4413-66ef-08da9a6d8d87 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT059.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5087 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Platforms that cannot support their core initialization without the reference clock from the host, implement the feature 'core_init_notifier' to indicate the DesignWare sub-system about when their core is getting initialized. Any accesses to the core (Ex:- DBI) would the core being ready result in system hang in such systems (Ex:- tegra194). This patch moves any access to the core to dw_pcie_ep_init_complete() API which is effectively called only after the core initialization. It also introduces .ep_init_late() ops hook to be used for any post init work that platform drivers may have to do. Signed-off-by: Vidya Sagar --- V4: * Addressed review comments from Bjorn and Manivannan * Moved dw_pcie_ep_init_complete() inside dw_pcie_ep_init_notify() * Added .ep_init_late() ops to perform late init tasks .../pci/controller/dwc/pcie-designware-ep.c | 112 ++++++++++-------- drivers/pci/controller/dwc/pcie-designware.h | 10 +- 2 files changed, 68 insertions(+), 54 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c index 83ddb190292e..095fb0291ec9 100644 --- a/drivers/pci/controller/dwc/pcie-designware-ep.c +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c @@ -23,14 +23,6 @@ void dw_pcie_ep_linkup(struct dw_pcie_ep *ep) } EXPORT_SYMBOL_GPL(dw_pcie_ep_linkup); -void dw_pcie_ep_init_notify(struct dw_pcie_ep *ep) -{ - struct pci_epc *epc = ep->epc; - - pci_epc_init_notify(epc); -} -EXPORT_SYMBOL_GPL(dw_pcie_ep_init_notify); - struct dw_pcie_ep_func * dw_pcie_ep_get_func_from_ep(struct dw_pcie_ep *ep, u8 func_no) { @@ -640,12 +632,17 @@ static unsigned int dw_pcie_ep_find_ext_capability(struct dw_pcie *pci, int cap) return 0; } -int dw_pcie_ep_init_complete(struct dw_pcie_ep *ep) +static int dw_pcie_ep_init_complete(struct dw_pcie_ep *ep) { struct dw_pcie *pci = to_dw_pcie_from_ep(ep); + struct dw_pcie_ep_func *ep_func; + struct device *dev = pci->dev; + struct pci_epc *epc = ep->epc; unsigned int offset; unsigned int nbars; u8 hdr_type; + u8 func_no; + void *addr; u32 reg; int i; @@ -658,6 +655,40 @@ int dw_pcie_ep_init_complete(struct dw_pcie_ep *ep) return -EIO; } + dw_pcie_version_detect(pci); + + dw_pcie_iatu_detect(pci); + + ep->ib_window_map = devm_bitmap_zalloc(dev, pci->num_ib_windows, + GFP_KERNEL); + if (!ep->ib_window_map) + return -ENOMEM; + + ep->ob_window_map = devm_bitmap_zalloc(dev, pci->num_ob_windows, + GFP_KERNEL); + if (!ep->ob_window_map) + return -ENOMEM; + + addr = devm_kcalloc(dev, pci->num_ob_windows, sizeof(phys_addr_t), + GFP_KERNEL); + if (!addr) + return -ENOMEM; + ep->outbound_addr = addr; + + for (func_no = 0; func_no < epc->max_functions; func_no++) { + ep_func = devm_kzalloc(dev, sizeof(*ep_func), GFP_KERNEL); + if (!ep_func) + return -ENOMEM; + + ep_func->func_no = func_no; + ep_func->msi_cap = dw_pcie_ep_find_capability(ep, func_no, + PCI_CAP_ID_MSI); + ep_func->msix_cap = dw_pcie_ep_find_capability(ep, func_no, + PCI_CAP_ID_MSIX); + + list_add_tail(&ep_func->list, &ep->func_list); + } + offset = dw_pcie_ep_find_ext_capability(pci, PCI_EXT_CAP_ID_REBAR); dw_pcie_dbi_ro_wr_en(pci); @@ -676,13 +707,28 @@ int dw_pcie_ep_init_complete(struct dw_pcie_ep *ep) return 0; } -EXPORT_SYMBOL_GPL(dw_pcie_ep_init_complete); + +int dw_pcie_ep_init_notify(struct dw_pcie_ep *ep) +{ + struct pci_epc *epc = ep->epc; + int ret; + + ret = dw_pcie_ep_init_complete(ep); + if (ret) + return ret; + + if (ep->ops->ep_init_late) + ep->ops->ep_init_late(ep); + + pci_epc_init_notify(epc); + + return 0; +} +EXPORT_SYMBOL_GPL(dw_pcie_ep_init_notify); int dw_pcie_ep_init(struct dw_pcie_ep *ep) { int ret; - void *addr; - u8 func_no; struct resource *res; struct pci_epc *epc; struct dw_pcie *pci = to_dw_pcie_from_ep(ep); @@ -690,7 +736,6 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep) struct platform_device *pdev = to_platform_device(dev); struct device_node *np = dev->of_node; const struct pci_epc_features *epc_features; - struct dw_pcie_ep_func *ep_func; INIT_LIST_HEAD(&ep->func_list); @@ -719,26 +764,6 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep) ep->phys_base = res->start; ep->addr_size = resource_size(res); - dw_pcie_version_detect(pci); - - dw_pcie_iatu_detect(pci); - - ep->ib_window_map = devm_bitmap_zalloc(dev, pci->num_ib_windows, - GFP_KERNEL); - if (!ep->ib_window_map) - return -ENOMEM; - - ep->ob_window_map = devm_bitmap_zalloc(dev, pci->num_ob_windows, - GFP_KERNEL); - if (!ep->ob_window_map) - return -ENOMEM; - - addr = devm_kcalloc(dev, pci->num_ob_windows, sizeof(phys_addr_t), - GFP_KERNEL); - if (!addr) - return -ENOMEM; - ep->outbound_addr = addr; - if (pci->link_gen < 1) pci->link_gen = of_pci_get_max_link_speed(np); @@ -755,20 +780,6 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep) if (ret < 0) epc->max_functions = 1; - for (func_no = 0; func_no < epc->max_functions; func_no++) { - ep_func = devm_kzalloc(dev, sizeof(*ep_func), GFP_KERNEL); - if (!ep_func) - return -ENOMEM; - - ep_func->func_no = func_no; - ep_func->msi_cap = dw_pcie_ep_find_capability(ep, func_no, - PCI_CAP_ID_MSI); - ep_func->msix_cap = dw_pcie_ep_find_capability(ep, func_no, - PCI_CAP_ID_MSIX); - - list_add_tail(&ep_func->list, &ep->func_list); - } - if (ep->ops->ep_init) ep->ops->ep_init(ep); @@ -793,6 +804,13 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep) return 0; } + /* + * NOTE:- Avoid accessing the hardware (Ex:- DBI space) before this + * step as platforms that implement 'core_init_notifier' feature may + * not have the hardware ready (i.e. core initialized) for access + * (Ex: tegra194). Any hardware access on such platforms result + * in system hard hang. + */ ret = dw_pcie_ep_init_complete(ep); if (ret) goto err_free_epc_mem; diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h index 09b887093a84..7222717afa33 100644 --- a/drivers/pci/controller/dwc/pcie-designware.h +++ b/drivers/pci/controller/dwc/pcie-designware.h @@ -254,6 +254,7 @@ struct dw_pcie_rp { struct dw_pcie_ep_ops { void (*ep_init)(struct dw_pcie_ep *ep); + void (*ep_init_late)(struct dw_pcie_ep *ep); int (*raise_irq)(struct dw_pcie_ep *ep, u8 func_no, enum pci_epc_irq_type type, u16 interrupt_num); const struct pci_epc_features* (*get_features)(struct dw_pcie_ep *ep); @@ -467,8 +468,7 @@ static inline void __iomem *dw_pcie_own_conf_map_bus(struct pci_bus *bus, #ifdef CONFIG_PCIE_DW_EP void dw_pcie_ep_linkup(struct dw_pcie_ep *ep); int dw_pcie_ep_init(struct dw_pcie_ep *ep); -int dw_pcie_ep_init_complete(struct dw_pcie_ep *ep); -void dw_pcie_ep_init_notify(struct dw_pcie_ep *ep); +int dw_pcie_ep_init_notify(struct dw_pcie_ep *ep); void dw_pcie_ep_exit(struct dw_pcie_ep *ep); int dw_pcie_ep_raise_legacy_irq(struct dw_pcie_ep *ep, u8 func_no); int dw_pcie_ep_raise_msi_irq(struct dw_pcie_ep *ep, u8 func_no, @@ -490,15 +490,11 @@ static inline int dw_pcie_ep_init(struct dw_pcie_ep *ep) return 0; } -static inline int dw_pcie_ep_init_complete(struct dw_pcie_ep *ep) +static inline int dw_pcie_ep_init_notify(struct dw_pcie_ep *ep) { return 0; } -static inline void dw_pcie_ep_init_notify(struct dw_pcie_ep *ep) -{ -} - static inline void dw_pcie_ep_exit(struct dw_pcie_ep *ep) { } From patchwork Mon Sep 19 18:33:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vidya Sagar X-Patchwork-Id: 12980958 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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 92546ECAAA1 for ; Mon, 19 Sep 2022 18:34:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229822AbiISSep (ORCPT ); Mon, 19 Sep 2022 14:34:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229790AbiISSeb (ORCPT ); Mon, 19 Sep 2022 14:34:31 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2078.outbound.protection.outlook.com [40.107.94.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3079D1DA; Mon, 19 Sep 2022 11:34:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZtWQQR/gHStcAFme8k8GKnmmFYsyGqSlXFlyBcArVnZt2CzXxNqvd2BcVB+DlZWdnHhoyzf3ka2qFhRcZdymmsn26/j6EfozFvusTnizimTXLebi6Wfpe1LNEQncdSgO3Ndu3HqfZUfOUw8nJPsW0cYBdgvNvniIRJaSLVwbv509XcUc0mGOBArAOsNKC+EYlrdmspJiJUDslNehVuYiYIH9ArQQKzdZUOh7mK9bU70WCaeGaY36OmoAWrBUM5Rq/1eESPf+/cPDAt6KiSQLE1vaXhrN/yNS2mAKg+zDe4+hCYXFN7P/LuUbihjx/Oq7hICsVeKDkc116cpR2ScaQw== 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=q6Lr/s4hxz5Zi4JMyQTAfhWJhlC4WnK//aCSV9R/sN8=; b=UIt4xTC6zy3qcqT6gur7kg+o42sEtM52zCYRVzqsCM738cL+S4QsWsKWnDOdnY+p8If+17sEs0yGzkDb9fvRrXwglsO41PnY2pz943g/ij3kdqfC2gXfxYzKRUDLpFwhjj7lYNoJXp+X2wN0oq9tPV8mrSnEqEFrEC9D2fPTBgSkxe3SVnTH0Vbzb0QAL7r0AoNKOtbNtpZcZ2TPndK7jLxhYyy44Df5LIExxngqJ0V4HrquZLLY0NSTsljpqlkJ6hjJs8f9zt2VfNnKgWKMvLl7Xa+fSZp6KVd+1iwVd2uoadQn9kV1+juMNE9t2859XAK4gQ+m+h0M7b5FND75qA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=gmail.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=q6Lr/s4hxz5Zi4JMyQTAfhWJhlC4WnK//aCSV9R/sN8=; b=Dl5pEgIgFDGOI0zZcD4t1A2QESkIMQ2OSDFyWYQd16OvVaiadY6TYxLByM8IE+i9N49TvJuxc6ZXQWTxMDSMhU8qWbfUz43DeUwc8ZQq31zkKBLMrCx9pR4xlfoozQ7FGVdo39eAs9ZKOKhl4cSbKxEZWK+d9YF+C4xGWnsMnf3dlITDNqGsSM9Nn3Xd6ytJNgNUEhUWA5HR4zywXJQVQRCJDDiTxRNDqT1YZlpN5QT2Vu1caJvw0r2b1G4z1Uh57kyY7ubHJWT+uZ47wL05ynEzXmZ/jAP4ejYKFWwaIydqLm78Aumb0fF2tla5BpdcYZMOn0Ak8i9gMO6Ls/fp7w== Received: from BN9PR03CA0116.namprd03.prod.outlook.com (2603:10b6:408:fd::31) by DM4PR12MB5181.namprd12.prod.outlook.com (2603:10b6:5:394::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21; Mon, 19 Sep 2022 18:34:25 +0000 Received: from BN8NAM11FT023.eop-nam11.prod.protection.outlook.com (2603:10b6:408:fd:cafe::4) by BN9PR03CA0116.outlook.office365.com (2603:10b6:408:fd::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21 via Frontend Transport; Mon, 19 Sep 2022 18:34:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BN8NAM11FT023.mail.protection.outlook.com (10.13.177.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.12 via Frontend Transport; Mon, 19 Sep 2022 18:34:25 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Mon, 19 Sep 2022 11:34:05 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 19 Sep 2022 11:34:04 -0700 Received: from vidyas-desktop.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Mon, 19 Sep 2022 11:34:00 -0700 From: Vidya Sagar To: , , , , , , , , , , CC: , , , , , , , , Subject: [PATCH V4 2/3] PCI: qcom-ep: Refactor EP initialization completion Date: Tue, 20 Sep 2022 00:03:41 +0530 Message-ID: <20220919183342.4090-3-vidyas@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220919183342.4090-1-vidyas@nvidia.com> References: <20220919183342.4090-1-vidyas@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT023:EE_|DM4PR12MB5181:EE_ X-MS-Office365-Filtering-Correlation-Id: 4f697bc8-9217-40d0-b090-08da9a6d943c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AubVE6vaxfjll0Nbeu14bTgfu22MeXl5NmsQYqzz/BaFRgWRTeQ5iskPKhCJDGArcEGAL/+qw1njxPU+OImeVzSV4nr6DMY1LhTW/KamDmFRmDdaG2Abx67avm2jsrj6aefNsQlDHbi+rGUdOFlY+zbGvGVK81Ee0Q7/rKQgz1C/XugBGbkCs72KHTAxLg4q2UKbWXpjzrSlp6WjfI0o6loX8O40LfC0N6qplXPbJomDJnQ6tb9gXjMYkIKyPaXiLWoKQq+lg5Cbn+uilkqU7KidV2AhLFH9IFE1TTevx51vkJEuHyIrq8WeAYM5Qeq751b03UClX8+0WcRtncYnnAiPttg/S0+HdPhBNNPzqNby6BHvobXlmgDU1t0FtMGS4r8OVa8W2l+1i3xb8xrGTnDzdpLOdLi5w/EigyfVKDU0GeLJX8uqoDT/9tv43w2ssKrLMHnc21M0BROzWbstzfJC9CXtnenJcBxxnzLZhKIGTeqmm+FAxWeinIlzCsOkibqLkLcDrj3K4baIR3yA5pELnCCGbhyA31uDGD6U2l/I1F3UJAJyFu4iHVCzkhBmaLTgH7ReS5shfSVXkEUqjZKRVyz2jhPlt2bTND0lKHKCueeaHDZneWQ1Drq3s2BmnB7wf6GWsuArKEetsm+IX5FFsNHZq+i6OCe1B5YJcvza34yHDseEl/HhKycwQ+i25Pb13uVdZqBvPIHg43li/gKD3AoASwlTDvKdYb+CkkiMYlsoY7NwxSJSAPB9f4KUdKbb3inh8yFFOl4neDZdo1cwjSPCXTmGHvSE5i+fWZY= X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(136003)(39860400002)(346002)(376002)(396003)(451199015)(46966006)(40470700004)(36840700001)(70586007)(70206006)(8676002)(4326008)(7416002)(5660300002)(54906003)(110136005)(86362001)(8936002)(316002)(82740400003)(47076005)(426003)(36860700001)(83380400001)(41300700001)(7696005)(6666004)(40460700003)(478600001)(2616005)(7636003)(336012)(186003)(1076003)(356005)(26005)(921005)(40480700001)(36756003)(2906002)(82310400005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2022 18:34:25.3433 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4f697bc8-9217-40d0-b090-08da9a6d943c X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT023.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5181 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Move the post initialization code to .ep_init_late() call back and call only dw_pcie_ep_init_notify() which internally takes care of calling dw_pcie_ep_init_complete(). Signed-off-by: Vidya Sagar --- V4: * New patch in this series drivers/pci/controller/dwc/pcie-qcom-ep.c | 27 ++++++++++++++--------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-qcom-ep.c b/drivers/pci/controller/dwc/pcie-qcom-ep.c index ec99116ad05c..cc7ce470640e 100644 --- a/drivers/pci/controller/dwc/pcie-qcom-ep.c +++ b/drivers/pci/controller/dwc/pcie-qcom-ep.c @@ -361,22 +361,12 @@ static int qcom_pcie_perst_deassert(struct dw_pcie *pci) PARF_INT_ALL_LINK_UP; writel_relaxed(val, pcie_ep->parf + PARF_INT_ALL_MASK); - ret = dw_pcie_ep_init_complete(&pcie_ep->pci.ep); + ret = dw_pcie_ep_init_notify(&pcie_ep->pci.ep); if (ret) { dev_err(dev, "Failed to complete initialization: %d\n", ret); goto err_disable_resources; } - /* - * The physical address of the MMIO region which is exposed as the BAR - * should be written to MHI BASE registers. - */ - writel_relaxed(pcie_ep->mmio_res->start, - pcie_ep->parf + PARF_MHI_BASE_ADDR_LOWER); - writel_relaxed(0, pcie_ep->parf + PARF_MHI_BASE_ADDR_UPPER); - - dw_pcie_ep_init_notify(&pcie_ep->pci.ep); - /* Enable LTSSM */ val = readl_relaxed(pcie_ep->parf + PARF_LTSSM); val |= BIT(8); @@ -639,8 +629,23 @@ static void qcom_pcie_ep_init(struct dw_pcie_ep *ep) dw_pcie_ep_reset_bar(pci, bar); } +static void qcom_pcie_ep_init_late(struct dw_pcie_ep *ep) +{ + struct dw_pcie *pci = to_dw_pcie_from_ep(ep); + struct qcom_pcie_ep *pcie_ep = to_pcie_ep(pci); + + /* + * The physical address of the MMIO region which is exposed as the BAR + * should be written to MHI BASE registers. + */ + writel_relaxed(pcie_ep->mmio_res->start, + pcie_ep->parf + PARF_MHI_BASE_ADDR_LOWER); + writel_relaxed(0, pcie_ep->parf + PARF_MHI_BASE_ADDR_UPPER); +} + static const struct dw_pcie_ep_ops pci_ep_ops = { .ep_init = qcom_pcie_ep_init, + .ep_init_late = qcom_pcie_ep_init_late, .raise_irq = qcom_pcie_ep_raise_irq, .get_features = qcom_pcie_epc_get_features, }; From patchwork Mon Sep 19 18:33:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vidya Sagar X-Patchwork-Id: 12980959 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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 CF41CECAAD3 for ; Mon, 19 Sep 2022 18:35:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229879AbiISSfA (ORCPT ); Mon, 19 Sep 2022 14:35:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229872AbiISSer (ORCPT ); Mon, 19 Sep 2022 14:34:47 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2067.outbound.protection.outlook.com [40.107.93.67]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF56A644D; Mon, 19 Sep 2022 11:34:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bnH6TawPcsMNUsl1vcHmU6hhEfSAiRSdVxECbSCxg1yXlkoxfHRNYeaGP4ON5nsGdWDW3YpfHgJJX8iQ0r9PL4o4pu0oEPZMNYYDM1u+7odUXriPju0DItc3D4hkZeW57eoAqpez0CQuBMglXA3g1zhAfDZGolhnX/+Q3NBhV3N+BzLzKSlUM+1ITgkhdL357AzCbYdmPl9WGvbndXrRdMHlKHuz4t3sy8BauoRxezht4X9aqAlVOO6OvTVANwOo2h3qHwv2OmZHnzBklXIOugOfX3zvYCHqgusO+vrKS85cotQlmvj2nRmKqV+kHwrARYK7Y/0vaAvqPOvujqtx2w== 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=EHAixVAfBaOoqe0aI9ixXFTmZSRX27g0ooH2OC9M+B8=; b=BgzSMYVm6YzGifKEoqoHLoiwfivgVxYp74SAKejg2YNngVSXaZEsT1nj1fDGKNhtso1MFpnjwx3XJQ9pIJ1oq4hpRZ+NuKz9xhVyk8xXgyIIpFOVhrCDa3YwfR7841JDO3V+3QIdJs5JiLZCh/y9uBaY6smp93vNeS6SpC/TAGIBKoKUFlcbEeHRAWZnAuwAKhqlfDO+eLgUQGGpQEwX30FdfStHcOmz/7Bixpd3MSx9BSKf4oZyyCceFtqPvhg8Gh4SlUB5SjHMu1dZ4SwOp+Ad9vt6q6Af+EGzQyJRl4//YlAo4d7Wul65ggzYLvp9Jvcr0NraYV9N/Lg/6yJ14A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=gmail.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EHAixVAfBaOoqe0aI9ixXFTmZSRX27g0ooH2OC9M+B8=; b=ufswIRNrnH8or9ZA4PODbzajMnRM4onc6lP9HSWUThKfB18/tjZmueyGFVRvsPghZafb4CCu6dUfjNB09FoxqaT5dp4lnARd/7XGagSJDerSz1+O0xXHisKD9gFgziCStIMDz9Heomi19mPkgW8geJhEbLlKu3iknf7CToqlJ/qUmjk6YYXB2mJKmIuRnrBkcxl9BNNYtIYBa56mq0UbhOTr3vs80YatyMdeaWIHoGkNRxlu3yH5eIxXEajiAmDiWY4hcsf0vVFoubYNPvier+1EAMUTcRUuHM5m5GdZTTUtcXyaQRaSToMqIsQhZg8BMNlpW4xAHXPoq9mJJhkurw== Received: from BN9P223CA0019.NAMP223.PROD.OUTLOOK.COM (2603:10b6:408:10b::24) by BY5PR12MB4292.namprd12.prod.outlook.com (2603:10b6:a03:212::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21; Mon, 19 Sep 2022 18:34:35 +0000 Received: from BN8NAM11FT079.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10b:cafe::dc) by BN9P223CA0019.outlook.office365.com (2603:10b6:408:10b::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.15 via Frontend Transport; Mon, 19 Sep 2022 18:34:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BN8NAM11FT079.mail.protection.outlook.com (10.13.177.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.12 via Frontend Transport; Mon, 19 Sep 2022 18:34:34 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Mon, 19 Sep 2022 11:34:11 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 19 Sep 2022 11:34:11 -0700 Received: from vidyas-desktop.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Mon, 19 Sep 2022 11:34:06 -0700 From: Vidya Sagar To: , , , , , , , , , , CC: , , , , , , , , Subject: [PATCH V4 3/3] PCI: tegra194: Refactor EP initialization completion Date: Tue, 20 Sep 2022 00:03:42 +0530 Message-ID: <20220919183342.4090-4-vidyas@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220919183342.4090-1-vidyas@nvidia.com> References: <20220919183342.4090-1-vidyas@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT079:EE_|BY5PR12MB4292:EE_ X-MS-Office365-Filtering-Correlation-Id: 4f4290fc-cb41-4a94-20de-08da9a6d998e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lBnlY9l8sHqYH5rlker7zbIFO3qNDR5IzY6zBMnGgqEel9BYBGPVMFE9KZXj9wTkN+05ovDgab3qaBmsGEsuGsgXAxGWcH7FHSe4fR3wcnZN7JEu1EWVqI2n9LB81l2bG6o/DT1TDJKopqUSpHo18/s2EBmrWTOIWDDVQGCDO5qDAL5R2Zib96bZ2B3K0UGdDCYeOj4jmx/IX8mjw1eShrR+EVW4v/QDSggwmGq5GWJquVEotCNrOQGdeYWp+ZCza2d6N+k9BYtNUfmHZFVkikVoi/ose4U1U1ieZ6fUtfYdDs6XViMYXSNJpqUB+Q52hYOgeBEzY9jSA5NTzMZS1S9Z8rSAqTOu9OMzODxyCz+YLzDf4i3UCLmnnaAPwLQDpJ7UGQgQ8eBJuBh1DKic1GYc5x0P71D+qW9KAX7R3ohway1pV4rjGV1Tavd9JYApC/3O3zlgUIDbPuWVOTGBaydphU/s7aybAK5gdaOgrhbakZ39F+zMupKBqLi4XQ4BGZbOsPNKtBMOhLsB3t9y2u8G889kaUjZjAf1EW3BaAy7pMZEYVmgsMD8POmQOqrnAL4mRcFtbb6IrdAwI6YShFPgJu12zyFD02AkJeoTTN6ictstJF1MMeNWgh/wBDlte9pc9/Uqp3vON86ySnlR8uprbDDHSx3bW1QBqVTCkKQDI7hxr2x4g87Mb041eDqVZQwqTaMb2Ig2F/a3ga4W2/yVUsU5UoMydtg1AGZqvvFwNYHzA80V/XEgaOwZ3rjOFh+pWf8JIEqVPFyR1egc1Xsr/fCabSg+k2wSO61O7XM= X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(376002)(346002)(39860400002)(136003)(396003)(451199015)(40470700004)(46966006)(36840700001)(36860700001)(82740400003)(7416002)(186003)(47076005)(426003)(336012)(41300700001)(8936002)(110136005)(54906003)(6666004)(2906002)(82310400005)(2616005)(4326008)(36756003)(8676002)(1076003)(83380400001)(70586007)(70206006)(7696005)(316002)(5660300002)(478600001)(40460700003)(40480700001)(86362001)(356005)(921005)(7636003)(26005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2022 18:34:34.2656 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4f4290fc-cb41-4a94-20de-08da9a6d998e X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT079.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4292 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Call only dw_pcie_ep_init_notify() which internally takes care of calling dw_pcie_ep_init_complete() to notify about the EP initialization completion to the DWC EP framework. Signed-off-by: Vidya Sagar --- V4: * New patch in this series drivers/pci/controller/dwc/pcie-tegra194.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c index 1b6b437823d2..2600304522eb 100644 --- a/drivers/pci/controller/dwc/pcie-tegra194.c +++ b/drivers/pci/controller/dwc/pcie-tegra194.c @@ -1885,14 +1885,12 @@ static void pex_ep_event_pex_rst_deassert(struct tegra_pcie_dw *pcie) val = (upper_32_bits(ep->msi_mem_phys) & MSIX_ADDR_MATCH_HIGH_OFF_MASK); dw_pcie_writel_dbi(pci, MSIX_ADDR_MATCH_HIGH_OFF, val); - ret = dw_pcie_ep_init_complete(ep); + ret = dw_pcie_ep_init_notify(ep); if (ret) { dev_err(dev, "Failed to complete initialization: %d\n", ret); goto fail_init_complete; } - dw_pcie_ep_init_notify(ep); - /* Program the private control to allow sending LTR upstream */ if (pcie->of_data->has_ltr_req_fix) { val = appl_readl(pcie, APPL_LTR_MSG_2);