Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6573979ybx; Mon, 11 Nov 2019 11:10:46 -0800 (PST) X-Google-Smtp-Source: APXvYqy+qu6UrF2WaWVOjsSCPpT3IfitYG4kiS/Zi214S+dNoSkM7KAfh5L3SxNkVAcUAYWN1ZeK X-Received: by 2002:a50:fd95:: with SMTP id o21mr28878713edt.283.1573499446102; Mon, 11 Nov 2019 11:10:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573499446; cv=none; d=google.com; s=arc-20160816; b=KJTpML+eu3TBs1yBckrqO/6sU3pbPU+wZZTaiTC2+NPvfL+nsxZ37y2l1MGOntMxUv ycqyIz/tHEiEWiAy1mw1VJ/XF26P88H/GPNsYuueP52VsfW8lO+dkwuJLmzmHsTimlaE qzOJSz6fd/Rjube780zgOzt0W3OIZiUuULsOA8f44tHFun7Bj0dmIoLk4oouyY2/Dq5/ QoMuGrOe+aQiw0h9j4/btCWtguGarIqYK9tEPRRhxlDLvC9zrxgaML1XU/XciV2thDy6 xQ5jYFzxyO3mXIGhmiCAPcDSV1VR8tRS/PN44Xo5B1jxUiZ+1+pEschEZQChE+pKIW/N AOXg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6rs6grHqAYRkm5XKZqWuqIh9K3WpgHlKRBgFV413+OU=; b=knaypJYFkCyz+z/pVPqnDne0KUERcfk4ufqbCEZQarNaRn32R0Qs8ifPkUHBlnh9oF w+faSBn4VDzQUb73L5TePUrRR0cBETyRjrHlcQJ/8mJwUYpjVTyKSl9dMlF+ndJwL4+9 h477nT7/oUEIV6fi9Q5i45HvCSJxMwSVrdfKg6arknIa+sCsq/xwtuFw7uIfTkfZlonE 6szMpf6i93h38Q8d4IwF+8AQQKo5fjMio/rF7dK7Wo6y41UGRZMwf23ncZyD2Kf5msv1 KlGTq1mKe0ov4FHtj3hUyY6X4toKzqxZo3IUC89uGpzsYs/HTIWAbfZ1sUmDrgTjZ/6e JSIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nn78vLvd; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o19si7184590ejj.307.2019.11.11.11.10.21; Mon, 11 Nov 2019 11:10:46 -0800 (PST) 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=nn78vLvd; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727804AbfKKTJw (ORCPT + 99 others); Mon, 11 Nov 2019 14:09:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:50800 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728148AbfKKSd1 (ORCPT ); Mon, 11 Nov 2019 13:33:27 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 33DF721872; Mon, 11 Nov 2019 18:33:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573497204; bh=AtAWPOCu6lMVkXMXhsRugQz95QvYSlyLDAkluKdUCrg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nn78vLvdhHN9LO07ZPb/p6PncdQow/Qgg72h4IxA8M2GQi61GRxymy4Jq63sNdR4R wu8HH6RGdXdihhtajJiTQh9E6mwbI3GicH3dv5D1eoQGfgVIGh5cNJJjW7s0G+1vpB 3IMLAl/f3nK7EDjO23xCkHNQXpNSnClop5IxTOws= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vidya Sagar , Lorenzo Pieralisi , Thierry Reding Subject: [PATCH 4.9 37/65] PCI: tegra: Enable Relaxed Ordering only for Tegra20 & Tegra30 Date: Mon, 11 Nov 2019 19:28:37 +0100 Message-Id: <20191111181347.225448602@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181331.917659011@linuxfoundation.org> References: <20191111181331.917659011@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 commit 7be142caabc4780b13a522c485abc806de5c4114 upstream. 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: Greg Kroah-Hartman --- drivers/pci/host/pci-tegra.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/drivers/pci/host/pci-tegra.c +++ b/drivers/pci/host/pci-tegra.c @@ -603,12 +603,15 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NV 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_setup(int nr, struct pci_sys_data *sys) {