Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPU disable unused PCIe BAR #225

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions patch/cisco-npu-disable-other-bars.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
From 2bc0b2e84866a7733fc05a34bd8a93e165db99cc Mon Sep 17 00:00:00 2001
From: Madhava Reddy Siddareddygari <msiddare@cisco.com>
Date: Tue, 9 Mar 2021 13:54:28 -0800
Subject: [PATCH] NPU disable other bars

This is a port of IOS XR patch

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also paste the new log messages from one device to the commit message.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still open.

Spitfire-pacific-disable-all-bars-other-than-0.patch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please provide a git commit hash or URL for this patch.


to Debian kernel. Modifications from IOS XR:

a. Only issue an INFO message for changed resources
b. Include the previous resource data in the INFO message
c. Prepare for the possibility of applying patch to
future NPU revisions.

Original patch message follows:

For Pacific, only bar 0 is valid. Hence disable all other bars as a work
around for spitfire

CDETS: CSCvi15029

Signed-off-by: Gaurav Gupta <gauragup@cisco.com>
Signed-off-by: Subha Keshavaraj <subkesha@cisco.com>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you just copied the output from git show. Please create the patch with git format-patch ….

---
drivers/pci/quirks.c | 50 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index af2149632..932d219e7 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -5462,3 +5462,53 @@ static void apex_pci_fixup_class(struct pci_dev *pdev)
}
DECLARE_PCI_FIXUP_CLASS_HEADER(0x1ac1, 0x089a,
PCI_CLASS_NOT_DEFINED, 8, apex_pci_fixup_class);
+
+#define PCI_DEVICE_ID_LEABA_PACIFIC 0xabcd
+#define PCI_DEVICE_ID_LEABA_GIBRALTAR 0xa001
+#define PCI_DEVICE_ID_LEABA_GRAPHENE 0xa003
+#define PCI_DEVICE_ID_LEABA_PALLADIUM 0xa004
+#define PCI_DEVICE_ID_LEABA_ARGON 0xa005
+#define PCI_DEVICE_ID_LEABA_KRYPTON 0xa006
msiddare marked this conversation as resolved.
Show resolved Hide resolved
+
+/*
+ * For Pacific A0, only BAR 0 is valid
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an errata document name and number for reference.

+ */
+static void silicon_one_fixup(struct pci_dev *dev)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’d think, the function name needs to include cisco somehow.

+{
+ int i;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not follow the Linux coding style. Please check patches with checkpatch.pl script in the Linux kernel.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, Firefox display issues in the browser.

+ struct resource *r;
+
+ for (i = 1; i <= PCI_ROM_RESOURCE; i++) {
+ r = &dev->resource[i];
+ if (!r->start && !r->end && !r->flags)
+ continue;
+
+ dev_info(&dev->dev, "Cisco Silicon One BAR %d %pR fixed up\n", i, r);
+ r->start = 0;
+ r->end = 0;
+ r->flags = 0;
+ }
+ /*
+ * Pacific device was misbehaving during rescan not enumerating
+ * memory for bar. Due to this HW issue, added this workaround
+ * and verified that during rescan memory gets assigned properly
+ * to the device. This is only a temporary fix.
+ */
+ dev->class = PCI_CLASS_MEMORY_OTHER << 8;
+ dev_info(&dev->dev, "Cisco Silicon One class adjusted\n");
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SYNOPSYS, PCI_DEVICE_ID_LEABA_PACIFIC,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why PCI_VENDOR_ID_SYNOPSYS?

+ silicon_one_fixup);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_LEABA_PACIFIC,
+ silicon_one_fixup);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_LEABA_GIBRALTAR,
+ silicon_one_fixup);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_LEABA_GRAPHENE,
+ silicon_one_fixup);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_LEABA_PALLADIUM,
+ silicon_one_fixup);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_LEABA_ARGON,
+ silicon_one_fixup);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_LEABA_KRYPTON,
+ silicon_one_fixup);
+
--
2.26.2