Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6570738ybx; Mon, 11 Nov 2019 11:07:49 -0800 (PST) X-Google-Smtp-Source: APXvYqzz1yJQ4eBWgL0DjlXx8X//vi4NtLur2CFbP4q4/GDMUu2CkNiN9o0ODAgwZBA1o1KScTVp X-Received: by 2002:a17:906:4e99:: with SMTP id v25mr12922265eju.106.1573499268888; Mon, 11 Nov 2019 11:07:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573499268; cv=none; d=google.com; s=arc-20160816; b=eLPIy3xrqZSCn4Arpbc515qkkrdSmN2acEIYH5crL3+7A7iZhRpTZePwAswyZoXuBP 6vBgYL+zE4/HUPDgluzORmeMTyLWx4LvMsCtZGKD9YGiDpBop8gSAylMk3i/ZcVFKM0m eC43EIenMGLVG5MkpntXlURmPCX56ve/9Hg/VeDcDn7qXO88Da+84zdSFsPMiqBt74+B vUhGlITutI1fO37uTsDwGubftTRmMNjy/g8HsUgFFGtSMer65020uu2ULx7SEhmhBeIO BYvfrxTB6ocCQnLzgPy9YGV/AyROKpbWR/+Qsixqtqd8bDY2mMmiH9oxfgFkPYRuOotD /5Gw== 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=3YiKbQySZ4wJvh9uiE4gljqr9J+bn32CspxbHkYJm0Q=; b=t8AUjuwitDyuKKgNV+7sM/a3mtAWf3Tl9odexkt4c2wpM2s7NgyaU/NhIlr4T9FQkU qeq3olCUhckAqwudZHN4n8S78cAMHcEXhyCKYRPucj894J5kfe4k0etM1wgJ/RWtXF9t zPYe6/z5nM10S5eYNifBSWSjX0uw8GML4XM0iE7vfJuUGzgNZZmI5aayKgefhlQwz/8z NA8n9PKs6CFNshgkiiK3gCWiIAp1WxzaFcWPqFnqkF+DvGN01eeuTtc1US2MAZXBomGs p8bM4+j8aOfpjziY+aWmc5AzmN2eu0no7yERnzdPL4lrbLE+Q73ZTIulmd666dGNdWjW T80w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kMSgpoH5; 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 w47si11881243edd.326.2019.11.11.11.07.25; Mon, 11 Nov 2019 11:07:48 -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=kMSgpoH5; 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 S1729681AbfKKSnz (ORCPT + 99 others); Mon, 11 Nov 2019 13:43:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:35376 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729666AbfKKSnw (ORCPT ); Mon, 11 Nov 2019 13:43:52 -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 7F6FF204FD; Mon, 11 Nov 2019 18:43:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573497832; bh=I8bJFqYfWHTylaZR6JZ1uKWs8R4yf0qldaNLb9L6BAg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kMSgpoH5S90WKZ05fCZfLTsZhewJskwoGaojLqpbZuDNsJOBqJNjYffUhqb0BnR1P 58M2kdqzp4cMYcSw7RaJiY5UOVp8S2kqdJKolQKUaX+5Z6Jac0+K2fgHZFZLMbJHn7 J4W8nJ1VqvLXBe8rEZD+xFlXqSTaOnGf7KgdUuQA= 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.19 069/125] PCI: tegra: Enable Relaxed Ordering only for Tegra20 & Tegra30 Date: Mon, 11 Nov 2019 19:28:28 +0100 Message-Id: <20191111181449.360572855@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181438.945353076@linuxfoundation.org> References: <20191111181438.945353076@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/controller/pci-tegra.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- 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_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_request_resources(struct tegra_pcie *pcie) {