Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5459387ybi; Wed, 12 Jun 2019 02:54:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmI9FVqs1d5qfp1Cloh/IEgWICRsJtu2QiJpPt/HDBr19Sw0FNHvu2u0zrOMtnY8msZ8jR X-Received: by 2002:a63:295:: with SMTP id 143mr23583334pgc.279.1560333276134; Wed, 12 Jun 2019 02:54:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560333276; cv=none; d=google.com; s=arc-20160816; b=ub2+CtAdC1Y6xKEmkXQFOsX4VJ/Sq5IqXxS3KiHSSecy/spI+nT0s6cEnHw6wqPIpP OeUBrcW4q7OL53kI7X/SwRbdXsGTpR6xhXGE591rATF5tULzxlWYLYpFM8S63NjHo6q0 tZk+Tyi5rO75ikZC8vdoPhLxIIUZtfY2T/eltYLg9bD/0Wh4yQMgRbegzJwZ6LfuXpu0 RFvU7sFp0qy8v8NXb5NkLQA5QktG2eBCmVyyK8BfexNdBQUoeHWcsOqc7W+klZvZtA81 L63yPwEkFmIHCS3ftrRnzNok5FrRUzZkNloWoUsdKKbYDbUHWKdCzDOgQ3cU53F5WnYv OGPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=TgQh0KW52B5ee+vdx914db29NSc2mR2j2vjGrGdjUk0=; b=feHV7MoGXBu7X4Q9bZtUg6aJe7BfwRM7IRMH5qbgrIr+wZmVd1yme70RRwXCweKjj2 xfyhGfJAUPu5l/x6oAtQ3DzlQ5Xfs3eLRWsJuqKs45KBsxU/iPNBMY5D6tHBtJ5+VnZ+ WHNjlS5SgpwQhXhw9XIRIg6eyit/XMYj6GTFysaDIF5G25X6jhm1aBZAgm4x2ngStt7i L4x2xIGFDp9nrZrQA4lUPZfEdcXnfhH+F43TTxOEFs0FWVRmq0fqSlcX9Ds4291WhJ0z i7XL/StfzSL4HtaOHsdFRDzFHzoGvVQL7MgdlQ5y1KnDG10oo/zJJNcFPcpmPhdO7RU0 BJwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=HpwBXYlm; 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=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n14si12935388pgv.81.2019.06.12.02.54.20; Wed, 12 Jun 2019 02:54:36 -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=@nvidia.com header.s=n1 header.b=HpwBXYlm; 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=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437781AbfFLJyE (ORCPT + 99 others); Wed, 12 Jun 2019 05:54:04 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:16042 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437698AbfFLJyE (ORCPT ); Wed, 12 Jun 2019 05:54:04 -0400 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Wed, 12 Jun 2019 02:54:03 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Wed, 12 Jun 2019 02:54:02 -0700 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Wed, 12 Jun 2019 02:54:02 -0700 Received: from HQMAIL108.nvidia.com (172.18.146.13) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 12 Jun 2019 09:54:02 +0000 Received: from hqnvemgw01.nvidia.com (172.20.150.20) by HQMAIL108.nvidia.com (172.18.146.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Wed, 12 Jun 2019 09:54:02 +0000 Received: from vidyas-desktop.nvidia.com (Not Verified[10.24.37.38]) by hqnvemgw01.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Wed, 12 Jun 2019 02:54:01 -0700 From: Vidya Sagar To: , , , , , , , , , , CC: , , , , , , , , , , Subject: [PATCH V10 02/15] PCI: Disable MSI for Tegra194 root port Date: Wed, 12 Jun 2019 15:23:26 +0530 Message-ID: <20190612095339.20118-3-vidyas@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190612095339.20118-1-vidyas@nvidia.com> References: <20190612095339.20118-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=1560333243; bh=TgQh0KW52B5ee+vdx914db29NSc2mR2j2vjGrGdjUk0=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-NVConfidentiality:MIME-Version: Content-Type; b=HpwBXYlm6Pe3pz+1sU6mccGoS+Gy+fsXzbJR719nE+AW0j9nj488+yRteNXND5u71 xFvMtwUleQ7tIGt/ArvKKpbSxV6pqdNRH8bkK9drvzRamTjiwdjFAEE44sqACG1z5q 3L8foU5qUCXMYap/2PqCrDkcJADmjof6vDCSPj7wRjXnxT7hqic+qScBEKxD/mcaZI u6NNehGfkqdF32FxDNJHl9AklEPfw4M2EIYYvC+kWuBcg7ze/EbPgp+9IaMUfN6Mum +e1VjbfNjnz8beh1aYWrlky+DvuCLdINkp+GHWNpiVmdaZwJxghbm18S2EiIPE09qO yLGy88eMaQr3Q== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tegra194 rootports don't generate MSI interrupts for PME and AER events. Since PCIe spec (Ref: r4.0 sec 7.7.1.2 and 7.7.2.2) doesn't support using a mix of INTx and MSI/MSI-X, MSI needs to be disabled to avoid root ports service drivers registering their respective ISRs with MSI interrupt and to let only INTx be used for all events. Signed-off-by: Vidya Sagar Reviewed-by: Thierry Reding --- Changes since [v9]: * None Changes since [v8]: * None Changes since [v7]: * Changed quirk macro to consider class code as well to avoid this quirk getting applied to Tegra194 when it is operating in endpoint mode. Also quoted relevant sections from PCIe spec in comments. Changes since [v6]: * This is a new patch drivers/pci/quirks.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 0f16acc323c6..69c061e0ca7d 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -2592,6 +2592,29 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_15, nvenet_msi_disable); +/* + * PCIe spec r4.0 sec 7.7.1.2 and sec 7.7.2.2 say that if MSI/MSI-X is enabled, + * then the device can't use INTx interrupts. Tegra194's PCIe root ports don't + * generate MSI interrupts for PME and AER events instead only INTx interrupts + * are generated. Though Tegra194 can generate MSI interrupts for other events, + * since PCIe specificiation doesn't support using a mix of INTx and MSI/MSI-X, + * it is required to disable MSI interrupts to avoid port service drivers + * registering their respective ISRs for MSIs. + */ +static void pci_quirk_nvidia_tegra194_disable_rp_msi(struct pci_dev *dev) +{ + dev->no_msi = 1; +} +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_NVIDIA, 0x1ad0, + PCI_CLASS_BRIDGE_PCI, 8, + pci_quirk_nvidia_tegra194_disable_rp_msi); +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_NVIDIA, 0x1ad1, + PCI_CLASS_BRIDGE_PCI, 8, + pci_quirk_nvidia_tegra194_disable_rp_msi); +DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_NVIDIA, 0x1ad2, + PCI_CLASS_BRIDGE_PCI, 8, + pci_quirk_nvidia_tegra194_disable_rp_msi); + /* * Some versions of the MCP55 bridge from Nvidia have a legacy IRQ routing * config register. This register controls the routing of legacy -- 2.17.1