Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp490940pxu; Thu, 3 Dec 2020 05:39:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJyW+VSdUK+HF4wTaZmEhzBsLc5qkuNgCh3mzmiEXXN70cPQziZYm2eyid1Jmvef0iWbdgzV X-Received: by 2002:a17:907:2122:: with SMTP id qo2mr450321ejb.539.1607002776844; Thu, 03 Dec 2020 05:39:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607002776; cv=none; d=google.com; s=arc-20160816; b=u3i+EsZBkkFlMZzTH7lnL0lhqPY2bWxhOyY/fVn88cRsTMXOqXoVf72YE6jGA8eFFs oWbdjOSUoMNF7nK/desCCLmoQsaavUPFnfI8pzf9t6rynzNAczksmOVgQA2vdbui6sH5 7FEv4HjU6KQsdDyfn9PdY/0VUh3C8x5hgdFhPxpAhUGz/JIJthoGt/1KgGET7sxM0XED jcVCK0gBrk+Lyhq26I4EK8ehKiZD9rV8mHGoIEWMoKoVg1On19QdLhuQdCbazGmlCs5w vPlxcR/OApiJWBaxlZXjkzhHilBYCLOwHxfvMr/iZ4GpAiJXFayFZMGv+Y2MITxLjQNH 3hyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=BFek7vJlaZbrownN3cTAQ+IV1PMfDMjoJ5+0cXFWPq0=; b=lZd/CvNnri+ZPnIVkSS5DZg49ofOPtlHFfaglo9J35UF7TpUeJ8EyZC6m0rj5Me+au gh6IfVaJp0TzBF+k5N/zaLHuRR7ZuJIN1WPeoSGtYlW9ULzSwSvrNlG2Vr5bktUaw933 aA9ib+b05ftPu3po4tnFx3NwlNf8FaJCC+0PvmndouphuQZahezlCgvz6a/yW/DPv5Ww Bguun+3WGIXAILNQjKof+eUmUVwn+DQONrR4Yz0IrvOppZUfI0ov2tu/bPvhnofV2PW/ qC+BtdHr1/Zn27L+QZ3uDQSDdNEhgOfMXmIZgSL4LcknoPOCz8U0aPGsWkJB7ZO8B9aK gXGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=gdWUdjwx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y10si1180584ejw.156.2020.12.03.05.39.08; Thu, 03 Dec 2020 05:39:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=gdWUdjwx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436725AbgLCNfv (ORCPT + 99 others); Thu, 3 Dec 2020 08:35:51 -0500 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:17819 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437051AbgLCNfs (ORCPT ); Thu, 3 Dec 2020 08:35:48 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 03 Dec 2020 05:35:07 -0800 Received: from HQMAIL101.nvidia.com (172.20.187.10) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 3 Dec 2020 13:35:03 +0000 Received: from vidyas-desktop.nvidia.com (10.124.1.5) by mail.nvidia.com (172.20.187.10) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Thu, 3 Dec 2020 13:35:00 +0000 From: Vidya Sagar To: , , , , , , , CC: , , , , , , Subject: [PATCH V5 1/5] PCI: tegra: Fix ASPM-L1SS advertisement disable code Date: Thu, 3 Dec 2020 19:04:47 +0530 Message-ID: <20201203133451.17716-2-vidyas@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201203133451.17716-1-vidyas@nvidia.com> References: <20201203133451.17716-1-vidyas@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1607002507; bh=BFek7vJlaZbrownN3cTAQ+IV1PMfDMjoJ5+0cXFWPq0=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:X-NVConfidentiality:MIME-Version:Content-Type; b=gdWUdjwxas0SmsqWfjKaTyJd5HToix6Xtl6KFDsOgeCywv+NscQ7pHuHkM0lhfnBc 2pG41qOJXmmC4KflZYRyK+1MNbfKZvQacfcimA8nBkzRNGNAVyLb4K1M2uRH/19viB 667Gr36e+KVheMuo2kvg30BwKGB6tLPjPIhlzW1Ec0BHWf7ryPco7Cj0A+MZcwuNlx hLDtV7dv8gUDryHjmBT3CaGYt7s3MQjHANlSKb6oroK3L7Ovu3p2VmOHCtOB/4qXcy xgyR2Om49uW/PiqbuwpeMoTDORUzyMI04n77KobNT0yA+le35Z8DvkCV99cvb1XB0i orLtIiy0Tn0EA== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the absence of CLKREQ# signal is indicated by the absence of "supports-clkreq" in the device-tree node, current driver is disabling the advertisement of ASPM-L1 Sub-States *before* the ASPM-L1 Sub-States offset is correctly initialized. Since default value of the ASPM-L1SS offset is zero, this is causing the Vendor-ID wrongly programmed to 0x10d2 instead of Nvidia's 0x10de thereby the quirks applicable for Tegra194 are not being applied. This patch fixes this issue by refactoring the code that disables the ASPM-L1SS advertisement. Fixes: 56e15a238d92 ("PCI: tegra: Add Tegra194 PCIe support") Signed-off-by: Vidya Sagar --- V5: * Rebased on top of the tree code V4: * None V3: * None V2: * None drivers/pci/controller/dwc/pcie-tegra194.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c index 648e731bccfa..4c966e9adb2b 100644 --- a/drivers/pci/controller/dwc/pcie-tegra194.c +++ b/drivers/pci/controller/dwc/pcie-tegra194.c @@ -863,12 +863,6 @@ static void tegra_pcie_prepare_host(struct pcie_port *pp) pcie->pcie_cap_base = dw_pcie_find_capability(&pcie->pci, PCI_CAP_ID_EXP); - /* Disable ASPM-L1SS advertisement if there is no CLKREQ routing */ - if (!pcie->supports_clkreq) { - disable_aspm_l11(pcie); - disable_aspm_l12(pcie); - } - val = dw_pcie_readl_dbi(pci, PCI_IO_BASE); val &= ~(IO_BASE_IO_DECODE | IO_BASE_IO_DECODE_BIT8); dw_pcie_writel_dbi(pci, PCI_IO_BASE, val); @@ -897,6 +891,12 @@ static void tegra_pcie_prepare_host(struct pcie_port *pp) init_host_aspm(pcie); + /* Disable ASPM-L1SS advertisement if there is no CLKREQ routing */ + if (!pcie->supports_clkreq) { + disable_aspm_l11(pcie); + disable_aspm_l12(pcie); + } + val = dw_pcie_readl_dbi(pci, GEN3_RELATED_OFF); val &= ~GEN3_RELATED_OFF_GEN3_ZRXDC_NONCOMPL; dw_pcie_writel_dbi(pci, GEN3_RELATED_OFF, val); -- 2.17.1