* [PATCH v2 0/2] PCI: Disable ATS for specific Intel IPU E2000 devices
@ 2023-09-08 14:36 Bartosz Pawlowski
2023-09-08 14:36 ` [PATCH v2 1/2] PCI: Extract ATS disabling to a helper function Bartosz Pawlowski
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Bartosz Pawlowski @ 2023-09-08 14:36 UTC (permalink / raw)
To: linux-pci, bhelgaas
Cc: sheenamo, justai, andriy.shevchenko, joel.a.gibson,
emil.s.tantilov, gaurav.s.emmanuel, mike.conover, shaopeng.he,
anthony.l.nguyen, pavan.kumar.linga, Bartosz Pawlowski
This patch series addresses the problem with A an B steppings of
Intel IPU E2000 which expects incorrect endianness in data field of ATS
invalidation request TLP by disabling ATS capability for vulnerable
devices.
v2:
- Removed reference to SW workaround in code comment
Bartosz Pawlowski (2):
PCI: Extract ATS disabling to a helper function
PCI: Disable ATS for specific Intel IPU E2000 devices
drivers/pci/quirks.c | 35 ++++++++++++++++++++++++++++-------
1 file changed, 28 insertions(+), 7 deletions(-)
--
2.41.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 1/2] PCI: Extract ATS disabling to a helper function
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 ` Bartosz Pawlowski
2023-09-08 14:36 ` [PATCH v2 2/2] PCI: Disable ATS for specific Intel IPU E2000 devices Bartosz Pawlowski
2023-10-18 21:15 ` [PATCH v2 0/2] " Bjorn Helgaas
2 siblings, 0 replies; 4+ messages in thread
From: Bartosz Pawlowski @ 2023-09-08 14:36 UTC (permalink / raw)
To: linux-pci, bhelgaas
Cc: sheenamo, justai, andriy.shevchenko, joel.a.gibson,
emil.s.tantilov, gaurav.s.emmanuel, mike.conover, shaopeng.he,
anthony.l.nguyen, pavan.kumar.linga, Bartosz Pawlowski,
Andy Shevchenko
Introduce quirk_no_ats() helper function to provide a standard way to
disable ATS capability in PCI quirks.
Signed-off-by: Bartosz Pawlowski <bartosz.pawlowski@intel.com>
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/pci/quirks.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 321156ca273d..a900546d8d45 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -5505,6 +5505,12 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SERVERWORKS, 0x0420, quirk_no_ext_tags);
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SERVERWORKS, 0x0422, quirk_no_ext_tags);
#ifdef CONFIG_PCI_ATS
+static void quirk_no_ats(struct pci_dev *pdev)
+{
+ pci_info(pdev, "disabling ATS\n");
+ pdev->ats_cap = 0;
+}
+
/*
* Some devices require additional driver setup to enable ATS. Don't use
* ATS for those devices as ATS will be enabled before the driver has had a
@@ -5518,14 +5524,10 @@ static void quirk_amd_harvest_no_ats(struct pci_dev *pdev)
(pdev->subsystem_device == 0xce19 ||
pdev->subsystem_device == 0xcc10 ||
pdev->subsystem_device == 0xcc08))
- goto no_ats;
- else
- return;
+ quirk_no_ats(pdev);
+ } else {
+ quirk_no_ats(pdev);
}
-
-no_ats:
- pci_info(pdev, "disabling ATS\n");
- pdev->ats_cap = 0;
}
/* AMD Stoney platform GPU */
--
2.41.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2 2/2] PCI: Disable ATS for specific Intel IPU E2000 devices
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
2023-10-18 21:15 ` [PATCH v2 0/2] " Bjorn Helgaas
2 siblings, 0 replies; 4+ messages in thread
From: Bartosz Pawlowski @ 2023-09-08 14:36 UTC (permalink / raw)
To: linux-pci, bhelgaas
Cc: sheenamo, justai, andriy.shevchenko, joel.a.gibson,
emil.s.tantilov, gaurav.s.emmanuel, mike.conover, shaopeng.he,
anthony.l.nguyen, pavan.kumar.linga, Bartosz Pawlowski,
Andy Shevchenko, Alexander Lobakin
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 0/2] PCI: Disable ATS for specific Intel IPU E2000 devices
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 ` [PATCH v2 2/2] PCI: Disable ATS for specific Intel IPU E2000 devices Bartosz Pawlowski
@ 2023-10-18 21:15 ` Bjorn Helgaas
2 siblings, 0 replies; 4+ messages in thread
From: Bjorn Helgaas @ 2023-10-18 21:15 UTC (permalink / raw)
To: Bartosz Pawlowski
Cc: linux-pci, bhelgaas, sheenamo, justai, andriy.shevchenko,
joel.a.gibson, emil.s.tantilov, gaurav.s.emmanuel, mike.conover,
shaopeng.he, anthony.l.nguyen, pavan.kumar.linga
On Fri, Sep 08, 2023 at 02:36:04PM +0000, Bartosz Pawlowski wrote:
> This patch series addresses the problem with A an B steppings of
> Intel IPU E2000 which expects incorrect endianness in data field of ATS
> invalidation request TLP by disabling ATS capability for vulnerable
> devices.
>
> v2:
> - Removed reference to SW workaround in code comment
>
> Bartosz Pawlowski (2):
> PCI: Extract ATS disabling to a helper function
> PCI: Disable ATS for specific Intel IPU E2000 devices
>
> drivers/pci/quirks.c | 35 ++++++++++++++++++++++++++++-------
> 1 file changed, 28 insertions(+), 7 deletions(-)
Applied to pci/ats for v6.7, thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-10-18 21:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH v2 2/2] PCI: Disable ATS for specific Intel IPU E2000 devices Bartosz Pawlowski
2023-10-18 21:15 ` [PATCH v2 0/2] " Bjorn Helgaas
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).