* [PATCH 5.10 1/2] PCI: Extract ATS disabling to a helper function
2024-01-12 14:15 [PATCH 5.10 0/2] PCI: Disable ATS for specific Intel IPU E2000 devices Bartosz Pawlowski
@ 2024-01-12 14:15 ` Bartosz Pawlowski
2024-01-12 14:15 ` [PATCH 5.10 2/2] PCI: Disable ATS for specific Intel IPU E2000 devices Bartosz Pawlowski
2024-01-13 9:13 ` [PATCH 5.10 0/2] " Greg KH
2 siblings, 0 replies; 4+ messages in thread
From: Bartosz Pawlowski @ 2024-01-12 14:15 UTC (permalink / raw)
To: stable, sashal
Cc: joel.a.gibson, emil.s.tantilov, gaurav.s.emmanuel,
sridhar.samudrala, lihong.yang, Bartosz Pawlowski,
Andy Shevchenko, Bjorn Helgaas
[ Upstream commit f18b1137d38c091cc8c16365219f0a1d4a30b3d1 ]
Introduce quirk_no_ats() helper function to provide a standard way to
disable ATS capability in PCI quirks.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230908143606.685930-2-bartosz.pawlowski@intel.com
Signed-off-by: Bartosz Pawlowski <bartosz.pawlowski@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/pci/quirks.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 158ff4331a14..7a1d656d1d41 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -5353,6 +5353,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
@@ -5365,8 +5371,7 @@ static void quirk_amd_harvest_no_ats(struct pci_dev *pdev)
(pdev->device == 0x7341 && pdev->revision != 0x00))
return;
- pci_info(pdev, "disabling ATS\n");
- pdev->ats_cap = 0;
+ quirk_no_ats(pdev);
}
/* AMD Stoney platform GPU */
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 5.10 2/2] PCI: Disable ATS for specific Intel IPU E2000 devices
2024-01-12 14:15 [PATCH 5.10 0/2] PCI: Disable ATS for specific Intel IPU E2000 devices Bartosz Pawlowski
2024-01-12 14:15 ` [PATCH 5.10 1/2] PCI: Extract ATS disabling to a helper function Bartosz Pawlowski
@ 2024-01-12 14:15 ` Bartosz Pawlowski
2024-01-13 9:13 ` [PATCH 5.10 0/2] " Greg KH
2 siblings, 0 replies; 4+ messages in thread
From: Bartosz Pawlowski @ 2024-01-12 14:15 UTC (permalink / raw)
To: stable, sashal
Cc: joel.a.gibson, emil.s.tantilov, gaurav.s.emmanuel,
sridhar.samudrala, lihong.yang, Bartosz Pawlowski, Bjorn Helgaas,
Andy Shevchenko, Alexander Lobakin
[ Upstream commit a18615b1cfc04f00548c60eb9a77e0ce56e848fd ]
Due to a hardware issue in A and B steppings of Intel IPU E2000, 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.
To prevent such issues, add quirk_intel_e2000_no_ats() to disable ATS for
vulnerable IPU E2000 devices.
Link: https://lore.kernel.org/r/20230908143606.685930-3-bartosz.pawlowski@intel.com
Signed-off-by: Bartosz Pawlowski <bartosz.pawlowski@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.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 7a1d656d1d41..500905dad643 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -5383,6 +5383,25 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x7312, quirk_amd_harvest_no_ats);
/* AMD Navi14 dGPU */
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x7340, quirk_amd_harvest_no_ats);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x7341, 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.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 5.10 0/2] PCI: Disable ATS for specific Intel IPU E2000 devices
2024-01-12 14:15 [PATCH 5.10 0/2] PCI: Disable ATS for specific Intel IPU E2000 devices Bartosz Pawlowski
2024-01-12 14:15 ` [PATCH 5.10 1/2] PCI: Extract ATS disabling to a helper function Bartosz Pawlowski
2024-01-12 14:15 ` [PATCH 5.10 2/2] PCI: Disable ATS for specific Intel IPU E2000 devices Bartosz Pawlowski
@ 2024-01-13 9:13 ` Greg KH
2 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2024-01-13 9:13 UTC (permalink / raw)
To: Bartosz Pawlowski
Cc: stable, sashal, joel.a.gibson, emil.s.tantilov, gaurav.s.emmanuel,
sridhar.samudrala, lihong.yang
On Fri, Jan 12, 2024 at 02:15:43PM +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.
>
> Bartosz Pawlowski (2):
> PCI: Extract ATS disabling to a helper function
> PCI: Disable ATS for specific Intel IPU E2000 devices
>
> drivers/pci/quirks.c | 28 ++++++++++++++++++++++++++--
> 1 file changed, 26 insertions(+), 2 deletions(-)
>
> --
> 2.43.0
>
>
All now queued up, thanks.
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread