Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3110946ybi; Thu, 18 Jul 2019 21:14:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqzM6J7qJZELCKMp46P662+or619pDoSJAl2SnyPN0koTJjDX284TPxdvEF0lM8fmKlH6hsz X-Received: by 2002:a17:90a:c70c:: with SMTP id o12mr29165768pjt.62.1563509647470; Thu, 18 Jul 2019 21:14:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563509647; cv=none; d=google.com; s=arc-20160816; b=pvq4O4/ajNk1O0QOK/EqSa5zDF9nImTEs4PtsN4NcON6hv/0m2GeOXZ0/Hf6k5moKM G3n37FsGWiq5g4DaWeifOXqG2GeVKe8fij2wVT5IpiZ1JKblCD8RtsYgCyz3+ImzPf1i /sv3z08NzB1FawrWrE/rl6hjVtQfLPNFqnjYDNi3YrtjyGocjGqFoaHWbmI/V/U2LMd+ eUM/vfC/XdEMIpD1T6o+5/z8f4gVcgGGjPkRbcUoEivRDH4TIG+d7qFngjs6VfFbF/Rt AC3deJKiQ2gwixAjAXxSfKbLT6AlzbOeTzIQ4SfTjEGney57VkD4rZDALn5LCi3u+1pS jAdg== 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=6XD24ci4PcX4jv82s63O4Uvb0cFO0FpCpvDjs7vN7KY=; b=AnVtylk/sf6ob6RmrpIVgDLZUGtPoCvWQChgZ3bk0IKEO4Exa8ZyepPSviqryI9dqi OE5PEFi1FfKyYLMQu92w8/5dvmucdrc8ArurK4P+PE8iIsb6XrcUaZnEG9qYf7Jstu1F eVKAF2iWlcYEcWRnb7tQcMIGq5IGArz6S23iMHyWJIfBgqymGpmFYFkTykTp3eZKeja5 G1fXAaZpLWM1lOeqJUirx3FIVWkUnao/GIzvfFbWGeanpcHQUBt4vAZKqv6pqFblJkeW cfIEJjMXTI5Q3yZqvuIUz7IEptqSfkcWn8w80o0yHdMGhT8KXXIHEOtRQog6QQ46j4vL Aq5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=y1UlAQcj; 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 n10si1780968pgr.27.2019.07.18.21.13.51; Thu, 18 Jul 2019 21:14:07 -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=y1UlAQcj; 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 S2388864AbfGSEM3 (ORCPT + 99 others); Fri, 19 Jul 2019 00:12:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:47708 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388822AbfGSEMY (ORCPT ); Fri, 19 Jul 2019 00:12:24 -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 9280D21873; Fri, 19 Jul 2019 04:12:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563509543; bh=E3+Janh7I5tZaUpI1dGOCf4luRr+92HNCwwvVl12LnI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y1UlAQcjPsS7DlMIhkRcZjLEF/dhev9ur9yLpPUSGnoPIwZBP7A7+lJInetxVsDYy QM6da9ziM9XuIdvOlbkE3A7HR3tAKEmhu1emwlzVTQt2oRvrH44OyswkZYwD+zZlLn RrI+o+uyofFWxiW6Up9dExiUHUG0tyDgua6K5/RQ= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Vidya Sagar , Lorenzo Pieralisi , Thierry Reding , Sasha Levin , linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 41/60] PCI: tegra: Enable Relaxed Ordering only for Tegra20 & Tegra30 Date: Fri, 19 Jul 2019 00:10:50 -0400 Message-Id: <20190719041109.18262-41-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190719041109.18262-1-sashal@kernel.org> References: <20190719041109.18262-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/host/pci-tegra.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c index 1987fec1f126..d2ad76ef3e83 100644 --- a/drivers/pci/host/pci-tegra.c +++ b/drivers/pci/host/pci-tegra.c @@ -607,12 +607,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