linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartosz Pawlowski <bartosz.pawlowski@intel.com>
To: linux-pci@vger.kernel.org, bhelgaas@google.com
Cc: sheenamo@google.com, justai@google.com,
	andriy.shevchenko@intel.com, joel.a.gibson@intel.com,
	emil.s.tantilov@intel.com, gaurav.s.emmanuel@intel.com,
	mike.conover@intel.com, shaopeng.he@intel.com,
	anthony.l.nguyen@intel.com, pavan.kumar.linga@intel.com,
	Bartosz Pawlowski <bartosz.pawlowski@intel.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Alexander Lobakin <aleksander.lobakin@intel.com>
Subject: [PATCH v2 2/2] PCI: Disable ATS for specific Intel IPU E2000 devices
Date: Fri,  8 Sep 2023 14:36:06 +0000	[thread overview]
Message-ID: <20230908143606.685930-3-bartosz.pawlowski@intel.com> (raw)
In-Reply-To: <20230908143606.685930-1-bartosz.pawlowski@intel.com>

There is a HW issue in A and B steppings of Intel IPU E2000 that it
expects wrong endianness in ATS invalidation message body. This problem
can lead to outdated translations being returned as valid and finally
cause system instability.

In order to prevent such issues introduce quirk_intel_e2000_no_ats()
function to disable ATS for vulnerable IPU E2000 devices.

Signed-off-by: Bartosz Pawlowski <bartosz.pawlowski@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
---
 drivers/pci/quirks.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index a900546d8d45..2d3e6aaa387c 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -5550,6 +5550,25 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x7347, quirk_amd_harvest_no_ats);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x734f, quirk_amd_harvest_no_ats);
 /* AMD Raven platform iGPU */
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x15d8, quirk_amd_harvest_no_ats);
+
+/*
+ * Intel IPU E2000 revisions before C0 implement incorrect endianness
+ * in ATS Invalidate Request message body. Disable ATS for those devices.
+ */
+static void quirk_intel_e2000_no_ats(struct pci_dev *pdev)
+{
+	if (pdev->revision < 0x20)
+		quirk_no_ats(pdev);
+}
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1451, quirk_intel_e2000_no_ats);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1452, quirk_intel_e2000_no_ats);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1453, quirk_intel_e2000_no_ats);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1454, quirk_intel_e2000_no_ats);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1455, quirk_intel_e2000_no_ats);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1457, quirk_intel_e2000_no_ats);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1459, quirk_intel_e2000_no_ats);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x145a, quirk_intel_e2000_no_ats);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x145c, quirk_intel_e2000_no_ats);
 #endif /* CONFIG_PCI_ATS */
 
 /* Freescale PCIe doesn't support MSI in RC mode */
-- 
2.41.0


  parent reply	other threads:[~2023-09-08 14:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-08 14:36 [PATCH v2 0/2] PCI: Disable ATS for specific Intel IPU E2000 devices Bartosz Pawlowski
2023-09-08 14:36 ` [PATCH v2 1/2] PCI: Extract ATS disabling to a helper function Bartosz Pawlowski
2023-09-08 14:36 ` Bartosz Pawlowski [this message]
2023-10-18 21:15 ` [PATCH v2 0/2] PCI: Disable ATS for specific Intel IPU E2000 devices Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230908143606.685930-3-bartosz.pawlowski@intel.com \
    --to=bartosz.pawlowski@intel.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=bhelgaas@google.com \
    --cc=emil.s.tantilov@intel.com \
    --cc=gaurav.s.emmanuel@intel.com \
    --cc=joel.a.gibson@intel.com \
    --cc=justai@google.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=mike.conover@intel.com \
    --cc=pavan.kumar.linga@intel.com \
    --cc=shaopeng.he@intel.com \
    --cc=sheenamo@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).