[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200915151103.7086-2-mqiao@juniper.net>
Date: Tue, 15 Sep 2020 08:11:02 -0700
From: Ming Qiao <mqiao@...iper.net>
To: bhelgaas@...gle.com, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Ming Qiao <mqiao@...iper.net>, Debjit Ghosh <dghosh@...iper.net>,
Santhanakrishnan Balraj <sbalraj@...iper.net>,
Rajat Jain <rajatja@...gle.com>
Subject: [PATCH 2/3] PCI: Add quirks for Juniper ASICs to set class code
Some of the Juniper ASICs do not report correct PCI class ID, which
would confuse kernel APIs accessing the specific class of devices.
Change them to PCI_CLASS_NETWORK_OTHER << 8.
Signed-off-by: Debjit Ghosh <dghosh@...iper.net>
Signed-off-by: Santhanakrishnan Balraj <sbalraj@...iper.net>
Signed-off-by: Rajat Jain <rajatja@...gle.com>
Signed-off-by: Ming Qiao <mqiao@...iper.net>
---
drivers/pci/quirks.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 61344d2..04dd490 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -5657,3 +5657,22 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JUNIPER, 0x00A8, quirk_jnx_fpga);
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JUNIPER, 0x00A9, quirk_jnx_fpga);
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JUNIPER, 0x00AA, quirk_jnx_fpga);
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_XILINX, 0x0505, quirk_jnx_fpga);
+
+/*
+ * PCI class reported by some Juniper ASICs is not correct.
+ * Change it to NETWORK.
+ */
+static void quirk_jnx_asic(struct pci_dev *dev)
+{
+ dev->class = PCI_CLASS_NETWORK_OTHER << 8;
+}
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JUNIPER, 0x003C, quirk_jnx_asic);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JUNIPER, 0x003D, quirk_jnx_asic);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JUNIPER, 0x003E, quirk_jnx_asic);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JUNIPER, 0x0055, quirk_jnx_asic);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JUNIPER, 0x005E, quirk_jnx_asic);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JUNIPER, 0x005F, quirk_jnx_asic);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JUNIPER, 0x008E, quirk_jnx_asic);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JUNIPER, 0x008D, quirk_jnx_asic);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JUNIPER, 0x0090, quirk_jnx_asic);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JUNIPER, 0x00B2, quirk_jnx_asic);
--
2.10.0
Powered by blists - more mailing lists