Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp17410rdb; Wed, 14 Feb 2024 11:13:00 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXqrT6m0nBVGElmqVQxjJ33TqqyUJFjgrd2ahwhVwjZtW/uC/ZY+CdV761hejzu6Z+k+628t8QncRgqMcFIyd39cvvuiH15cLRcohps8A== X-Google-Smtp-Source: AGHT+IFS9O9JMSMdluIZ/39AxhjVpGcOOEjK3Of/961WLR7oEgHyMm6iBM9RTBmnQS3hCbsD6d+m X-Received: by 2002:ac8:7f92:0:b0:42c:755a:2365 with SMTP id z18-20020ac87f92000000b0042c755a2365mr3231081qtj.67.1707937980520; Wed, 14 Feb 2024 11:13:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707937980; cv=pass; d=google.com; s=arc-20160816; b=LrFqNp/sUUjr9HLWSs3XsOm8mZfYKL4Egi2Pet8ipV5efSB1Utw70vh4xtgiJIuaAt 8MHoBfIMRQ2vJSN2fU2M2zjU2VRZu24kYPksoBFwSjFFZwMvQ0WCdzvW0w2hG0eivrei 8GDe8KXppPkjVfDVh3zyLRy8kIF6mXZvxF5phLlgXnZk6dwj3m0vy/ixaG0EbTKz4FSA 7TgT6v/0LtVPh+qnf8CuxLWxldTKCUD0dDw5hL8NqXHxq/Rs6bhUovjc93La0oy2Whwh XR3eQzTdJlWAATEI6a/0zRH9AGjFWjoADtdqk+l8iv96bA4iTYZsk2X7zStjCh5tXabt LfVQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:cc:to:from :date:dkim-signature; bh=VXUf7ECK3TXoTvAqhj8j+P/fMSmmeU0g+4TJP6/nEEs=; fh=STwAQNs6vom1dnGs+i9Ta8yVKlAoJNi3iOX/3iwbj7o=; b=maTV1hhCAntgkGI8xPX/aPhYwFwoatURISKwzc/9nN8RVw5bG+iFQ4nbRb22c1+tnJ p9aQ0HYizNm3tuevxK5hu/vPz7OuE8mvADWfJBO+dMtAJ9JihfN7/C5VCLpXsF7HryvD vTqVOwK8zZ1Culaa4q++OpksDCtIVkcZdaHqWoY8ZA/QjzDc0K8p1btlW6Phj5H9f78n uCLUbwJEnqLbwwabSCQ2Z2fsFab/C101W3kJP1PNsyRM3J0y8X6FT7srHaFw3rAFKANw fRmErR5+vZPfME5Bc26uDGHQ0waUqUY9q5dLj0pXRq9gSgIDURLsER8hGLo7zyXtP7Hu pqrg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F4cChNzy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-65865-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65865-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCWIkJCOkwrsegVhop6l/7ocFZiTXqjxAUT+iJTxOssWv9Ixy/KHDwEPZPpwQxvu6oVBfzD4S+A9/oGHi1Mt1PkgcTl2PKsAf8AdeP98nw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id l16-20020ac84a90000000b0042c31f3921fsi5602875qtq.119.2024.02.14.11.13.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 11:13:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65865-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F4cChNzy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-65865-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65865-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 491211C21073 for ; Wed, 14 Feb 2024 19:13:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4665D13A89A; Wed, 14 Feb 2024 19:12:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="F4cChNzy" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 67E9E171A2; Wed, 14 Feb 2024 19:12:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707937971; cv=none; b=RonN0RFG4MqY5frDfXQvAwL40KBDqiN8ysMU6CCFmO82ZxJJd4uwhdFNzpU+JOzhdXdYFrtVoRLHDrIB4kDjUNQdNhQqTJlM7KeAu2+HNeWVXTSh1LgOeURUQWDQ2u86nFsZuz2u8bOVumeDvSbjz44V7GkNT5nuNRj2p96SNPw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707937971; c=relaxed/simple; bh=GaNW4qJLhcZQPDq6m88xXy4RMPI4Vwk6x2NaA/U2ssA=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=rfu/R8oEsHNsg5jT43ErftGqK55ynG+Xp0u2CdFgKb3w142evcuNErpmLJm2bP+X0bxkdsJal2GQ120EramZPR2DuyI4ee+v3hpRHHd5LgAqeqqnlllnfHF6vkJM6F5Hha48hlu7QJi8KjVBC5H2aeJZThOdJMHrVd3xkjzEkn4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=F4cChNzy; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99C9DC433C7; Wed, 14 Feb 2024 19:12:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707937970; bh=GaNW4qJLhcZQPDq6m88xXy4RMPI4Vwk6x2NaA/U2ssA=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=F4cChNzyKBXOwwfxXYohSyCAMg1dlwLd7cLrxNDuPtwGDI382Mp2mpUlZQn8prFf/ NdIU32bTxG4qoylo01LS3cDpCML72NtUL+SNhUdTb+GZev1zuUtUCZi8Zy+LNtKy4z tDEhQZZmpodutqmmBYham8OPm8HxdjIaaNgDx72vr/VowZGVFLXa4fOGHEl8cnUFXt EpU6rWFIc7mrdCoeTkIrjPPgXfFkXD6jMz4T8kFCmOoLHIZuQ9fJISSddWwaMewxMA n8Ox+OnzOe4tapu+/U0GoqEvw13IhuXjYdVFhTAy6fJU6pcSA/PFN+h1Op4gvLaT4S h7NGbTQbsSSFA== Date: Wed, 14 Feb 2024 13:12:49 -0600 From: Bjorn Helgaas To: Vidya Sagar Cc: Lorenzo Pieralisi , bhelgaas@google.com, robh+dt@kernel.org, mark.rutland@arm.com, thierry.reding@gmail.com, jonathanh@nvidia.com, Kishon Vijay Abraham I , catalin.marinas@arm.com, Will Deacon , jingoohan1@gmail.com, gustavo.pimentel@synopsys.com, digetx@gmail.com, mperttunen@nvidia.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kthota@nvidia.com, mmaddireddy@nvidia.com, sagar.tv@gmail.com Subject: Re: [PATCH V16 13/13] PCI: tegra: Add Tegra194 PCIe support Message-ID: <20240214191249.GA1263222@bhelgaas> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190813113627.27251-14-vidyas@nvidia.com> Hi Vidya, question about ancient history: On Tue, Aug 13, 2019 at 05:06:27PM +0530, Vidya Sagar wrote: > Add support for Synopsys DesignWare core IP based PCIe host controller > present in Tegra194 SoC. > ... > +static int tegra_pcie_dw_host_init(struct pcie_port *pp) > +{ > + struct dw_pcie *pci = to_dw_pcie_from_pp(pp); > + struct tegra_pcie_dw *pcie = to_tegra_pcie(pci); > + u32 val, tmp, offset, speed; > + > + tegra_pcie_prepare_host(pp); > + > + if (dw_pcie_wait_for_link(pci)) { > + /* > + * There are some endpoints which can't get the link up if > + * root port has Data Link Feature (DLF) enabled. > + * Refer Spec rev 4.0 ver 1.0 sec 3.4.2 & 7.7.4 for more info > + * on Scaled Flow Control and DLF. > + * So, need to confirm that is indeed the case here and attempt > + * link up once again with DLF disabled. This comment suggests that there's an issue with *Endpoints*, not an issue with the Root Port. If so, it seems like this problem could occur with all Root Ports, not just Tegra194. Do you remember any details about this? I don't remember hearing about any similar issues, and this driver is the only place PCI_EXT_CAP_ID_DLF is referenced, so maybe it is actually something related to Tegra194? > + val = appl_readl(pcie, APPL_DEBUG); > + val &= APPL_DEBUG_LTSSM_STATE_MASK; > + val >>= APPL_DEBUG_LTSSM_STATE_SHIFT; > + tmp = appl_readl(pcie, APPL_LINK_STATUS); > + tmp &= APPL_LINK_STATUS_RDLH_LINK_UP; > + if (!(val == 0x11 && !tmp)) { > + /* Link is down for all good reasons */ > + return 0; > + } > + > + dev_info(pci->dev, "Link is down in DLL"); > + dev_info(pci->dev, "Trying again with DLFE disabled\n"); > + /* Disable LTSSM */ > + val = appl_readl(pcie, APPL_CTRL); > + val &= ~APPL_CTRL_LTSSM_EN; > + appl_writel(pcie, val, APPL_CTRL); > + > + reset_control_assert(pcie->core_rst); > + reset_control_deassert(pcie->core_rst); > + > + offset = dw_pcie_find_ext_capability(pci, PCI_EXT_CAP_ID_DLF); > + val = dw_pcie_readl_dbi(pci, offset + PCI_DLF_CAP); > + val &= ~PCI_DLF_EXCHANGE_ENABLE; > + dw_pcie_writel_dbi(pci, offset, val); > + > + tegra_pcie_prepare_host(pp); > + > + if (dw_pcie_wait_for_link(pci)) > + return 0; > + } > + > + speed = dw_pcie_readw_dbi(pci, pcie->pcie_cap_base + PCI_EXP_LNKSTA) & > + PCI_EXP_LNKSTA_CLS; > + clk_set_rate(pcie->core_clk, pcie_gen_freq[speed - 1]); > + > + tegra_pcie_enable_interrupts(pp); > + > + return 0; > +}