Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3702480rdg; Wed, 18 Oct 2023 03:42:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEli4aeBhAaqMEfZvYWNyO1o512k9buC1z6NvbILno88nlZzdEHEu39kXrbrLmAEQTAEqgR X-Received: by 2002:a17:902:c402:b0:1ca:8abc:1072 with SMTP id k2-20020a170902c40200b001ca8abc1072mr5818015plk.63.1697625741016; Wed, 18 Oct 2023 03:42:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697625740; cv=none; d=google.com; s=arc-20160816; b=h7YsOM+VY2uuASdpqNbgHth+y+0ITaTALwi2FF4ktspb7SgHxhU6QBObw9l/S1TdVY 5M2yq7ZZTcashosP/XqASSuO99XlxU4TxZgUBpTh8VcERIL6FXqvZA6yCUd+ACtXsEIP +KR2ECVhfbejYLfgG3fal5Y/Tze2Qq5qC1eGaN8mXL45tDW6Z5SU3vrHqMchvZ/aATsZ z9aVPxl1kSRu3le1C0eCFDMXZdtj4iLAp9mn0p8I7QnlkIN4jRNC5lWjjzog9mQMiRxn F4Ea2yuEx3Kk8JNUhqYn4elUtu5HY5on4rdvvsX5hSj6OsCOOBGigDOTtVWFgqZnQnP3 hAqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=IiN0YIQNx/rIeZobowtqHdBnsSAAP4uKtrmkRfiubgs=; fh=a42ggdYlobPJiIf+/Jepj5Gk7vw5NRV/XVJvGk6IAoE=; b=OEX9+eBDU55VW/C0Dp61AkNLUVtSJqksqLFjSdF5ip8hsiWO4SMQkhTjz0oJ2m+Egp wvKhTsFch7HZIFVkedW2oZwdca4sn3wAraPRg1nWhkQ6MXvuS8vsZRzAIgfqxVo7V0Jk UcLo4jPKQ7CEF/YfEDLfmAUYcRibnQC/b3kaxq2L+3pLgcu90ub31bxkC4qX3nS5428r 3BVl2u4umpEfvJNWKspbq6n/cuLJCXUFHlgIjU+TOU/u3IKdjruOlxdwOdtYAkuKD3nq XPpUSYjqtHXpC+x070ouYm/sVESCBYDQz6pRFdh8GPyrqsE9pMcpsJCEZZDZEEKcUbTX e9EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SVOYMyvo; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id e13-20020a170902d38d00b001c62e42ad8bsi3756684pld.72.2023.10.18.03.42.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 03:42:20 -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=@gmail.com header.s=20230601 header.b=SVOYMyvo; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 5B39C8108375; Wed, 18 Oct 2023 03:42:18 -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 S235105AbjJRKmL (ORCPT + 99 others); Wed, 18 Oct 2023 06:42:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230414AbjJRKmK (ORCPT ); Wed, 18 Oct 2023 06:42:10 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B73C595; Wed, 18 Oct 2023 03:42:08 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2c5056059e0so77576241fa.3; Wed, 18 Oct 2023 03:42:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697625727; x=1698230527; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=IiN0YIQNx/rIeZobowtqHdBnsSAAP4uKtrmkRfiubgs=; b=SVOYMyvoG1WWBUnC/zNxZbl3F8rhq5WcYfqzm3+c6ozEIUQe1dM40IlMtrJwyIagtf i9D2tIzyLqg5F4USjIwg9h3SVWxS6ddE37mR4+DxNB/CLPIcBEz1TOEmmrwiUIQuwYUB RFgUXnikCfemXXd/OqxjXhquNEV9uI3dnuIUOQjL0Kv2i+UCaIls6wThKVF33xGU97J4 BxXAPjyEe8swD/rMCe7+Jfj9oZkDiE5aOm8SRDzeMl25Fsci0wBB9BaPVzfQc0Tm23LU qUDjqvMUzIMHj2orIrlJl31pf2P8bxy7fqw6ujDdxABNI1CcUAwuktOVPUlBFe3usMXJ RIng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697625727; x=1698230527; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=IiN0YIQNx/rIeZobowtqHdBnsSAAP4uKtrmkRfiubgs=; b=eXIX2Y3RUGLsv/FyMOWrETGKN8wlwkmTxzbiFo27BoZG2+GB+cWMRrwM8D+Xd6HwJ2 MOoq7EwTymTajwXFrJFxoKuw5WXila7XtMmFDv2l9T+ISrKFr3tSIue8w5CEEKHR7EuL Vgr6TayPLSXCkNIkN3p5fzJ1I8ynnJwkpV2EIrrddMhYGqUUbvdZxBiFEZ1AsfJZGdwH 3TyOwm0iwuv01M9fiXz7he0bEA5XnH6qCWv7HLml7afUGaWaix8XxKDyFkdipCSejBRO kXh4DdV+yM4zs87azuCAn07qCnnI2t87OX3vHB5BT6ovuzRpoogebv3/qgoy8pS7Cox0 9lEw== X-Gm-Message-State: AOJu0YylcqVBArXo58zoxjWoFHl+nUXyORFAtbG1CmRS/fcOfyCZZ1Zj a7k/94Qam7nRGmNz7Ljby+c= X-Received: by 2002:a05:651c:1070:b0:2c5:3322:c2d6 with SMTP id y16-20020a05651c107000b002c53322c2d6mr3027551ljm.7.1697625726544; Wed, 18 Oct 2023 03:42:06 -0700 (PDT) Received: from mobilestation ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id a12-20020a2ebe8c000000b002c27cd20711sm642320ljr.3.2023.10.18.03.42.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 03:42:06 -0700 (PDT) Date: Wed, 18 Oct 2023 13:42:02 +0300 From: Serge Semin To: Siddharth Vadapalli Cc: Bjorn Helgaas , lpieralisi@kernel.org, robh@kernel.org, kw@linux.com, bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, r-gunasekaran@ti.com, srk@ti.com Subject: Re: [PATCH] PCI: keystone: Don't enable BAR0 if link is not detected Message-ID: References: <20231013184958.GA1118393@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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, 18 Oct 2023 03:42:18 -0700 (PDT) On Tue, Oct 17, 2023 at 09:44:51AM +0530, Siddharth Vadapalli wrote: > Hello, > > On 17/10/23 02:59, Serge Semin wrote: > > Hi Siddharth > > > > ... > > >>> > >>> I assume MSI-X actually does work for downstream endpoints? I > >>> wouldn't think anybody would have bothered with > >>> ks_pcie_v3_65_add_bus() unless MSI-X works. > >> > >> Yes, I think it is supposed to work, but it doesn't seem to be working right now > >> considering that even with Endpoint device connected, the readl() returns all Fs. > > > > Could you please have look at what DW PCIe IP-core version is utilized > > in the Keystone PCIe host controller? If it's of v5.x then here is > > The DW PCIe IP-core version is 4.90a. > > > what HW databook says about the BARs initialization: "If you do use a > > BAR, then you should program it to capture TLPs that are targeted to > > your local non-application memory space residing on TRGT1, and not for > > the application on TRGT0 (dbi). The BAR range must be outside of the > > three Base/Limit regions." > > Yes, it's the same even in the DW PCIe IP-core version 4.90a Databook: > > 3.5.7.2 RC Mode > > Two BARs are present but are not expected to be used. You should disable them or > else they will be unnecessarily assigned memory during device enumeration. If > you do use a BAR, then you should program it to capture TLPs that are targeted > to your local non-application memory space residing on TRGT1, and not for the > application on TRGT1. The BAR range must be outside of the three Base/Limit regions. Are you really sure that it's 4.90a? Here is what my DW PCIe RC _v4.90_ HW databook says about the BARs: "Base Address Registers (Offset: 0x10-x14) The Synopsys core does not implement the optional BARs for the RC product. This is based on the assumption that the RC host probably has registers on some other internal bus and has knowledge and setup access to these registers already." What you cited resides in the _v5.x_ databooks. It makes my thinking that in your case the IP-core isn't of 4.90a version. -Serge(y) > > > > > I have no idea whether the BAR being set with an address within the > > Base/Limit regions could have caused the lags you see, but I would > > have at least checked that. > > I will check that. Thank you for sharing your feedback. > > > > > -Serge(y) > > > >> > >> -- > >> Regards, > >> Siddharth. > > -- > Regards, > Siddharth.