Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1146407pxb; Wed, 4 Nov 2020 00:55:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJzls8o6dS6nPIoPAM/rwGAmaloo4f1p06UXccXvmI5ozPq3z3OE36GeajiU7/GW5zXO7mTe X-Received: by 2002:a17:907:262d:: with SMTP id aq13mr6726704ejc.484.1604480143227; Wed, 04 Nov 2020 00:55:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604480142; cv=none; d=google.com; s=arc-20160816; b=AfFs3rT5VKdVAvNifqBqMhgjnZkJqJccUSUjuFlteTTdGP9nESflVZA2Z5RKM1fgXR ilZSV/6/0nUDfcAgCp4emP/iQ+x6A9nxQ8ZZNQL1yLLUz8cQid29BBV85aLxNb8rDJue J73sIgCl9N03lrGQ3pxnbGW7pp6XPwau4kPG+Nr8wYk6n1lVx/4i4+jJ9CSr3jOqDX7p 56dlqi1/wCnoE2yDu9oIGNhKM7aHPg15Lv9ZzAT5khEuQKE2gp2IXLhRi+ULQM7MLQab L0LWMVS85WAQ/6QmXfZ8Ma26tpmgoT+3vKb9YriwWlD1t7MUV+XpsVcKiYvlmxk2csOE cYng== 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=pE6B5W32IRU6jU0blW1A2aBVvj4gHjrSf7CmW+Ju6pg=; b=hR5EVnTMoATdF6w9oar/RQYKrXbYVHaxNpzHqAQXl39Ok5zdQ2QMIEIuc7m+rveqy7 Sbn5lQ1oHNVQWwBh08wP06WGTmfH8tgKMf5e+4qK7miYYI5w6uWvtWWEuKRaUGlRUM80 O5mw+YFuAiZ+4+Ee24k1xUop0F5P6jHMGxWYFQZDPPS2vhqIbonCBPyehfzB6Yd3+yjL 5EdS8Lv0QtHahsxbHQkEMTYJv6Ld0z1c2dCwI2X1eKFT7T0gF0RbAjYXZB1Q5XaRAOYW Wkntd2/fWC2Vhwv0IsFOcw1ND6U8/YB8gNx9hfN6OxyiqitaW0TYArltTjuW2MOi1Fnp UxSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=qcoyRoCZ; 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 a15si1143142eju.273.2020.11.04.00.55.20; Wed, 04 Nov 2020 00:55:42 -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=qcoyRoCZ; 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 S1728523AbgKDIw2 (ORCPT + 99 others); Wed, 4 Nov 2020 03:52:28 -0500 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:2627 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728675AbgKDIwU (ORCPT ); Wed, 4 Nov 2020 03:52:20 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Wed, 04 Nov 2020 00:52:22 -0800 Received: from HQMAIL105.nvidia.com (172.20.187.12) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 4 Nov 2020 08:52:16 +0000 Received: from vidyas-desktop.nvidia.com (10.124.1.5) by mail.nvidia.com (172.20.187.12) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Wed, 4 Nov 2020 08:52:12 +0000 From: Vidya Sagar To: , , , , , , , CC: , , , , , , Subject: [PATCH V3 1/5] PCI: tegra: Fix ASPM-L1SS advertisement disable code Date: Wed, 4 Nov 2020 14:20:14 +0530 Message-ID: <20201104085018.13021-2-vidyas@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201104085018.13021-1-vidyas@nvidia.com> References: <20201104085018.13021-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=1604479942; bh=pE6B5W32IRU6jU0blW1A2aBVvj4gHjrSf7CmW+Ju6pg=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:X-NVConfidentiality:MIME-Version:Content-Type; b=qcoyRoCZ0piUYe73ac3RXhzFqb2XBUMAuLGZRxa+DjUUQ5uozNBm3gFVaoF5cyHQQ mbqzO9QHYJTjrKgl4cAn++kssJLlXXLQebPPOghBi4Y3q1rnKU89Thed9MLnWW9HeD xbhG0wgKxqBSk4esSaGr2HY66uIbG/Q5alsc9BdnUjORlIp8kuGfRX20iV9GwCeDan aab0YZCQbePSm0DP2XG/UlH0qNLAJADjyYKvcNdik0SdB7KViwJo2hGTgVyXjRC6F5 PY+0BIpRq4DV5+HHt7nSRwiZt3V4OhydPMpC+d9rnw0UfjDG4Yr3fiLhWdmnAtCb0r dhUpxYsdCUumw== 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 --- 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 aa511ec0d800..b172b1d49713 100644 --- a/drivers/pci/controller/dwc/pcie-tegra194.c +++ b/drivers/pci/controller/dwc/pcie-tegra194.c @@ -896,6 +896,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); @@ -1400,12 +1406,6 @@ static int tegra_pcie_config_controller(struct tegra_pcie_dw *pcie, pcie->pcie_cap_base = dw_pcie_find_capability(&pcie->pci, PCI_CAP_ID_EXP); - /* Disable ASPM-L1SS advertisement as there is no CLKREQ routing */ - if (!pcie->supports_clkreq) { - disable_aspm_l11(pcie); - disable_aspm_l12(pcie); - } - return ret; fail_phy: -- 2.17.1