Skip to contentSkip to conversation

LF-18678 PCI: Add quirk to fix byte-swapped class code on ARA240 device

PATCH In review Stefan Ghetu 5 participants 5 messages Nov 18 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 LF-18678 PCI: Add quirk to fix byte-swapped class code on ARA240 device

From: Richard Zhu <[email protected]>

The ARA240 PCIe endpoint device (1e58:0002) reports an incorrect, byte-swapped class code of 0x000012 instead of 0x120000 (Processing Accelerator). This causes the device to appear as an unclassified device (class 0x00) rather than a processing accelerator (class 0x12).

On ARM platforms, the kernel may refuse to assign BARs to unclassified devices, preventing the ARA240 from functioning properly. The device cannot be initialized and remains unusable.

Add a PCI quirk to force the correct class code during early device enumeration, allowing proper resource assignment and device operation.

---
 drivers/pci/quirks.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/pci/quirks.c +12 -0
index 3d92b99a49238..fc95d87d4af0a 100644
@@ -559,6 +559,18 @@ static void quirk_citrine(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_IBM,	PCI_DEVICE_ID_IBM_CITRINE,	quirk_citrine);
 
+/*
+ * The ARA240 device reports a byte-swapped class code (0x000012) instead of
+ * the correct value (0x120000 - Processing Accelerator). This causes resource
+ * assignment issues on ARM platforms. Apply a quirk to force the correct
+ * class code.
+ */
+static void quirk_ara240_class_code(struct pci_dev *dev)
+{
+	dev->class = 0x120000;
+}
+DECLARE_PCI_FIXUP_HEADER(0x1e58, 0x0002, quirk_ara240_class_code);
+
 /*
  * This chip can cause bus lockups if config addresses above 0x600
  * are read or written.
Signature · 1 line
2.53.0
#1 lore raw
Sashiko has reviewed this patch and found no issues.
Quoted 11 lines

From: Richard Zhu <[email protected]>

The ARA240 PCIe endpoint device (1e58:0002) reports an incorrect, byte-swapped class code of 0x000012 instead of 0x120000 (Processing Accelerator). This causes the device to appear as an unclassified device (class 0x00) rather than a processing accelerator (class 0x12).

On ARM platforms, the kernel may refuse to assign BARs to unclassified devices, preventing the ARA240 from functioning properly. The device cannot be initialized and remains unusable.

Quoted 6 lines

Add a PCI quirk to force the correct class code during early device enumeration, allowing proper resource assignment and device operation.

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#2 lore raw
In reply to Stefan Ghetu
Quoted 28 lines · Stefan Ghetu

From: Richard Zhu <[email protected]>

The ARA240 PCIe endpoint device (1e58:0002) reports an incorrect, byte-swapped class code of 0x000012 instead of 0x120000 (Processing Accelerator). This causes the device to appear as an unclassified device (class 0x00) rather than a processing accelerator (class 0x12).

On ARM platforms, the kernel may refuse to assign BARs to unclassified devices, preventing the ARA240 from functioning properly. The device cannot be initialized and remains unusable.

Add a PCI quirk to force the correct class code during early device enumeration, allowing proper resource assignment and device operation.

---
 drivers/pci/quirks.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/pci/quirks.c +0 -0
index 3d92b99a49238..fc95d87d4af0a 100644
@@ -559,6 +559,18 @@ static void quirk_citrine(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_IBM,	PCI_DEVICE_ID_IBM_CITRINE,	quirk_citrine);

drivers/pci/quirks.c static void quirk_citrine(struct pci_dev *dev) · line 570

Quoted 10 lines
drivers/pci/quirks.c +9 -0
 
+/*
+ * The ARA240 device reports a byte-swapped class code (0x000012) instead of
+ * the correct value (0x120000 - Processing Accelerator). This causes resource
+ * assignment issues on ARM platforms. Apply a quirk to force the correct
+ * class code.
+ */
+static void quirk_ara240_class_code(struct pci_dev *dev)
+{
+	dev->class = 0x120000;

Why isn't this based on PCI_CLASS_ACCELERATOR_PROCESSING ?

Signature · 1 line
 i.
#3 lore raw
In reply to Stefan Ghetu
Quoted 10 lines · Stefan Ghetu

From: Richard Zhu <[email protected]>

The ARA240 PCIe endpoint device (1e58:0002) reports an incorrect, byte-swapped class code of 0x000012 instead of 0x120000 (Processing Accelerator). This causes the device to appear as an unclassified device (class 0x00) rather than a processing accelerator (class 0x12).

On ARM platforms, the kernel may refuse to assign BARs to unclassified devices, preventing the ARA240 from functioning properly. The device cannot be initialized and remains unusable.

Out of curiosity, what's the ARM connection here? The question of assigning resources for unclassified devices seems like it should be generic, not ARM-specific.

If it *is* in fact generic, we should remove the ARM references.

Quoted 36 lines

Add a PCI quirk to force the correct class code during early device enumeration, allowing proper resource assignment and device operation.

---
 drivers/pci/quirks.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/pci/quirks.c +12 -0
index 3d92b99a49238..fc95d87d4af0a 100644
@@ -559,6 +559,18 @@ static void quirk_citrine(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_IBM,	PCI_DEVICE_ID_IBM_CITRINE,	quirk_citrine);
 
+/*
+ * The ARA240 device reports a byte-swapped class code (0x000012) instead of
+ * the correct value (0x120000 - Processing Accelerator). This causes resource
+ * assignment issues on ARM platforms. Apply a quirk to force the correct
+ * class code.
+ */
+static void quirk_ara240_class_code(struct pci_dev *dev)
+{
+	dev->class = 0x120000;
+}
+DECLARE_PCI_FIXUP_HEADER(0x1e58, 0x0002, quirk_ara240_class_code);
+
 /*
  * This chip can cause bus lockups if config addresses above 0x600
  * are read or written.
Signature · 1 line
2.53.0
#4 lore raw
In reply to Stefan Ghetu
Quoted 9 lines

-----Original Message-----
From: Stefan Ghetu <[email protected]>
Sent: Wednesday, November 18, 2026 6:04 PM
To: [email protected]
Cc: [email protected]; [email protected]; Hongxing Zhu <[email protected]>; Jason Liu <[email protected]>; Stefan Ghetu <[email protected]>
Subject: [PATCH] LF-18678 PCI: Add quirk to fix byte-swapped class code on ARA240 device

Hi Stefan:
Please reformat the header of this patch.
- Get rid of "LF-xxxxx". You can't send the original patch directly.
- Describe the exact root cause why this quirk is mandatory needed. Make sure it's aligned with the requirements of community before sending next version.

Best Regards
Richard Zhu

Quoted 49 lines

From: Richard Zhu <[email protected]>

The ARA240 PCIe endpoint device (1e58:0002) reports an incorrect, byte- swapped class code of 0x000012 instead of 0x120000 (Processing Accelerator). This causes the device to appear as an unclassified device (class 0x00) rather than a processing accelerator (class 0x12).

On ARM platforms, the kernel may refuse to assign BARs to unclassified devices, preventing the ARA240 from functioning properly. The device cannot be initialized and remains unusable.

Add a PCI quirk to force the correct class code during early device enumeration, allowing proper resource assignment and device operation.

---
 drivers/pci/quirks.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/pci/quirks.c index renamed from drivers/pci/quirks.c +0 -0

3d92b99a49238..fc95d87d4af0a 100644

drivers/pci/quirks.c +14 -1
@@ -559,6 +559,18 @@ static void quirk_citrine(struct pci_dev *dev)  }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_IBM,
 	PCI_DEVICE_ID_IBM_CITRINE,	quirk_citrine);
 
+/*
+ * The ARA240 device reports a byte-swapped class code (0x000012)
+instead of
+ * the correct value (0x120000 - Processing Accelerator). This causes
+resource
+ * assignment issues on ARM platforms. Apply a quirk to force the
+correct
+ * class code.
+ */
+static void quirk_ara240_class_code(struct pci_dev *dev) {
+	dev->class = 0x120000;
+}
+DECLARE_PCI_FIXUP_HEADER(0x1e58, 0x0002, quirk_ara240_class_code);
+
 /*
  * This chip can cause bus lockups if config addresses above 0x600
  * are read or written.
--

2.53.0