Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp782515rdg; Wed, 11 Oct 2023 05:35:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF1L8C4vZWlobF3Dg9cEQjcuGgtzVRi9T3hmk/7cDJCPKIfghNNmJAqDvOqpvou9aKHSZ45 X-Received: by 2002:a17:903:2287:b0:1c5:ff18:98af with SMTP id b7-20020a170903228700b001c5ff1898afmr22299682plh.4.1697027728751; Wed, 11 Oct 2023 05:35:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697027728; cv=none; d=google.com; s=arc-20160816; b=bVjnnyoN/SfbtHerxgNoKQnX93qBln6FiWR3+HICJwnPPHxz8jxYiIP+90VxCInUfC NDMcn5xKBoKJEjYiK2qfimf0AvF79i2gpD03hOmzljcLqQ65/qYkdLgHM43XlbzZVlQ4 yXJL9QsRyo27YHPpAy6vlKWT//DeFp30RbaSQ4RBkFTGhP0Ne4aLi/3IMGx5Jl19QwW9 MHxwBqOM1UeuCSZ9BtKfHzkpr1rcP2ju3PdQeOA1u6lBYzbjgNYRFiko/mHsaKwHWtdQ cYO4p4PNZN+sE6tbE1NSZ3bJpEFL6NtMzruzC82f0kZiQDktIXHKWPJzKp9iCkk/fBrA 7E8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=u7XL/tD7jBNy4Mf5LMc4cpgvoGhfSpXlJeuIF3bc84w=; fh=CLlsEhYzGBjy8kZ6we2oFC84yMxpUwl03TYoDen4h/k=; b=gT4Arsr4WTGBbOgySTo3zjwqFe/A+TcgNQLrq6awvhe4xmWvEFIrYK6HPyEwmsqmH4 iRhtSjUuaRpi5ZpTK9dcVWQunr4ZlVopVHzGZ/w9mxdzDQSjHAA2HZKXdNXXtaZn72iC NWs7knE9niM0KhVDDw3BvfkqpZk/rDFm8kHhdiJqYXh/rlmmo3vm7uOH9nNHWj4YJu+y yWXcAQe8r6TiRIdjQWO495v2KHyf/EKtATW5hvtUuwq9dkYgCy7jYdsJ7u+PVfdjtnZS Qh3uE6nu6zHrOfdSUmoLvIX3MI2j7tXExCh3G5p+tejrmJbQfeOqDOVFejx9ZkoUy3uk dDnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=wsmGMhx1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id q2-20020a170902eb8200b001b9eb349549si13789549plg.630.2023.10.11.05.35.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 05:35:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=wsmGMhx1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 41ECF801F961; Wed, 11 Oct 2023 05:35:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232105AbjJKMfQ (ORCPT + 99 others); Wed, 11 Oct 2023 08:35:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231327AbjJKMfP (ORCPT ); Wed, 11 Oct 2023 08:35:15 -0400 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88B2C94; Wed, 11 Oct 2023 05:35:14 -0700 (PDT) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 39BCYtnb064043; Wed, 11 Oct 2023 07:34:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1697027695; bh=u7XL/tD7jBNy4Mf5LMc4cpgvoGhfSpXlJeuIF3bc84w=; h=From:To:CC:Subject:Date; b=wsmGMhx1UCGi1Lyebwn3dqqIq5R75oBcDVWJ0nAGZq5qEIVONM1xcBXdzt4obMEFX /n3eBiulwSqZu0V9DTlHWWj68svXpB4qKMaPsn2XKjjwZazQIymw3CSJt3QacCWfI8 /HB02ZANCrpOWpIXgu0xNT+5yiklGW5HL74iRWs8= Received: from DFLE101.ent.ti.com (dfle101.ent.ti.com [10.64.6.22]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 39BCYtQE079026 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 11 Oct 2023 07:34:55 -0500 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Wed, 11 Oct 2023 07:34:55 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Wed, 11 Oct 2023 07:34:55 -0500 Received: from uda0492258.dhcp.ti.com (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 39BCYpQG066928; Wed, 11 Oct 2023 07:34:52 -0500 From: Siddharth Vadapalli To: , , , CC: , , , , , Subject: [PATCH] PCI: keystone: Don't enable BAR0 if link is not detected Date: Wed, 11 Oct 2023 18:04:51 +0530 Message-ID: <20231011123451.34827-1-s-vadapalli@ti.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 11 Oct 2023 05:35:26 -0700 (PDT) X-Spam-Level: ** Since the function dw_pcie_host_init() ignores the absence of link under the assumption that link can come up later, it is possible that the pci_host_probe(bridge) function is invoked even when no endpoint device is connected. In such a situation, the ks_pcie_v3_65_add_bus() function configures BAR0 when the link is not up, resulting in Completion Timeouts during the MSI configuration performed later by the PCI Express Port driver to setup AER, PME and other services. Thus, leave BAR0 disabled if link is not yet detected when the ks_pcie_v3_65_add_bus() function is invoked. Signed-off-by: Siddharth Vadapalli --- Hello, This patch is based on linux-next tagged next-20231011. Regards, Siddharth. drivers/pci/controller/dwc/pci-keystone.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pci-keystone.c b/drivers/pci/controller/dwc/pci-keystone.c index 49aea6ce3e87..ac2ad112d616 100644 --- a/drivers/pci/controller/dwc/pci-keystone.c +++ b/drivers/pci/controller/dwc/pci-keystone.c @@ -459,7 +459,8 @@ static int ks_pcie_v3_65_add_bus(struct pci_bus *bus) struct dw_pcie *pci = to_dw_pcie_from_pp(pp); struct keystone_pcie *ks_pcie = to_keystone_pcie(pci); - if (!pci_is_root_bus(bus)) + /* Don't enable BAR0 if link is not yet up at this point */ + if (!pci_is_root_bus(bus) || !dw_pcie_link_up(pci)) return 0; /* Configure and set up BAR0 */ -- 2.34.1