Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3131324ybi; Thu, 18 Jul 2019 21:38:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHqaQKasD2SDAIi974orcbUkQfj8TxiYbQ4c5EALcCrzx1w10/gEBSLPSWuIUNpz4jTkeR X-Received: by 2002:a65:4044:: with SMTP id h4mr51862660pgp.164.1563511105931; Thu, 18 Jul 2019 21:38:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563511105; cv=none; d=google.com; s=arc-20160816; b=fJ1HSELyKE5bJYn1j0xrNTdVUXNTQjfBOM0/275Nu+7A4+CicQMztE0JhH9FCr3CEH oVE53KIJQfAfIiLlm+Z4+nysICIOybXMgnj0hXuvbCWJSFCDLLNCMuxKjLY9E4obkxiY vj9wrnVD9vs0pMLHt6P9cr0XDp7vgEHBlToZEmd6xSE0baYfM6XkdxbM8CQ0l7jaT8CO Sjlk+7seHQZrLhK5DHjpZX1lR3l9jvIZltnS41hUGTU4OIJ8KY5Jk3KJnj7XE2MgWgss zVUc3gOmSrQQUhM/0PoSww0MCFCxr2cRzRD+H4HaFPLay9qhySI/384c0hx++eOJFX89 5qKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qcYTB10/rA29sfgqZV+ROsmtxbCZKA5BxmYkNnOcTRw=; b=P6renc/DBce7gQvxIZELL63KVXaxhwQ9EiTvuxJIEzzGMUV048Ni/w+sJjKNwkCUiH MPqKciPwQHr9q6zZdvEbifSGqBr0REvVIYZLVU6L9QfDoUfjs+kG4nTlWyF87hQiBkl8 7ZJV0KxkFfZjAWmOzcRtlipPRY9/PWJHw77Ba9V1BXqkGqKumUrdHcT4yG9EvHTgecoF +RtleUk0qtNgR7THxEb9rQD8K7OZtXr4+8G/4f8HtNaC9Eyg4pHxqDl1pKcs0PUsqaQz +Lz/ShUycBXViMPta//XMn7tMkN+R7Or9DZZv8I4EAWirooyjfwBwRevDcOs0REALJMb z5ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WLpA6ZRZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e129si843318pgc.344.2019.07.18.21.38.10; Thu, 18 Jul 2019 21:38:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WLpA6ZRZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732479AbfGSEgc (ORCPT + 99 others); Fri, 19 Jul 2019 00:36:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:60416 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729088AbfGSEAe (ORCPT ); Fri, 19 Jul 2019 00:00:34 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C7D4621851; Fri, 19 Jul 2019 04:00:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563508833; bh=ODh4CTkykYpoX++oqzYOTKUG6FeESfkWrW9mds2LKCE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WLpA6ZRZu9/te9EYjFxS+SlMxKermDiE3P8qP9NQL8Jq7jz0KavGRfADSR7nGHzG1 opAaelbxcQdFKfZ291mhJJynodb+QghquRxA7/SvU2xiU5ROUz0qy24HPgH79X6B3c /mBCuOasJLeQ4UY5UHBfVWnOvnl3Yr9y9JzYyKyw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Vidya Sagar , Lorenzo Pieralisi , Thierry Reding , Sasha Levin , linux-tegra@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH AUTOSEL 5.2 115/171] PCI: tegra: Enable Relaxed Ordering only for Tegra20 & Tegra30 Date: Thu, 18 Jul 2019 23:55:46 -0400 Message-Id: <20190719035643.14300-115-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190719035643.14300-1-sashal@kernel.org> References: <20190719035643.14300-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vidya Sagar [ Upstream commit 7be142caabc4780b13a522c485abc806de5c4114 ] The PCI Tegra controller conversion to a device tree configurable driver in commit d1523b52bff3 ("PCI: tegra: Move PCIe driver to drivers/pci/host") implied that code for the driver can be compiled in for a kernel supporting multiple platforms. Unfortunately, a blind move of the code did not check that some of the quirks that were applied in arch/arm (eg enabling Relaxed Ordering on all PCI devices - since the quirk hook erroneously matches PCI_ANY_ID for both Vendor-ID and Device-ID) are now applied in all kernels that compile the PCI Tegra controlled driver, DT and ACPI alike. This is completely wrong, in that enablement of Relaxed Ordering is only required by default in Tegra20 platforms as described in the Tegra20 Technical Reference Manual (available at https://developer.nvidia.com/embedded/downloads#?search=tegra%202 in Section 34.1, where it is mentioned that Relaxed Ordering bit needs to be enabled in its root ports to avoid deadlock in hardware) and in the Tegra30 platforms for the same reasons (unfortunately not documented in the TRM). There is no other strict requirement on PCI devices Relaxed Ordering enablement on any other Tegra platforms or PCI host bridge driver. Fix this quite upsetting situation by limiting the vendor and device IDs to which the Relaxed Ordering quirk applies to the root ports in question, reported above. Signed-off-by: Vidya Sagar [lorenzo.pieralisi@arm.com: completely rewrote the commit log/fixes tag] Signed-off-by: Lorenzo Pieralisi Acked-by: Thierry Reding Signed-off-by: Sasha Levin --- drivers/pci/controller/pci-tegra.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/pci-tegra.c b/drivers/pci/controller/pci-tegra.c index 464ba2538d52..bc7be369c1b3 100644 --- a/drivers/pci/controller/pci-tegra.c +++ b/drivers/pci/controller/pci-tegra.c @@ -545,12 +545,15 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NVIDIA, 0x0bf1, tegra_pcie_fixup_class); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NVIDIA, 0x0e1c, tegra_pcie_fixup_class); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NVIDIA, 0x0e1d, tegra_pcie_fixup_class); -/* Tegra PCIE requires relaxed ordering */ +/* Tegra20 and Tegra30 PCIE requires relaxed ordering */ static void tegra_pcie_relax_enable(struct pci_dev *dev) { pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_RELAX_EN); } -DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, tegra_pcie_relax_enable); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, 0x0bf0, tegra_pcie_relax_enable); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, 0x0bf1, tegra_pcie_relax_enable); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, 0x0e1c, tegra_pcie_relax_enable); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, 0x0e1d, tegra_pcie_relax_enable); static int tegra_pcie_request_resources(struct tegra_pcie *pcie) { -- 2.20.1