-
Notifications
You must be signed in to change notification settings - Fork 169
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
Changes from all commits
f59eed4
a199d39
ac3d687
81cec9d
8fa81b8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
From 0be339b4c8468138dfe1a30de29511e94b846af6 Mon Sep 17 00:00:00 2001 | ||
From: Madhava Reddy Siddareddygari <msiddare@cisco.com> | ||
Date: Mon, 16 Aug 2021 12:55:37 -0700 | ||
Subject: [PATCH] NPU disable unused PCI BAR | ||
|
||
For Cisco ASIC only BAR0 is valid. Not disabling other BAR's | ||
was resulting in pci_enable_device function failure in P0 | ||
Pacific ASIC's. Further debugging and consultion with Hardware | ||
team, issue seems to be related to only P0 version of ASIC and | ||
workaround suggested is to disable unused PCI BAR. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Still open. |
||
Signed-off-by: Madhava Reddy Siddareddygari <msiddare@cisco.com> | ||
--- | ||
drivers/pci/quirks.c | 54 ++++++++++++++++++++++++++++++++++++++++++++ | ||
1 file changed, 54 insertions(+) | ||
|
||
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c | ||
index af2149632..8b99883e1 100644 | ||
--- a/drivers/pci/quirks.c | ||
+++ b/drivers/pci/quirks.c | ||
@@ -5462,3 +5462,57 @@ 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I’d think, the function name needs to include |
||
+{ | ||
+ int i; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does not follow the Linux coding style. Please check patches with There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 disabled due to " | ||
+ "NPU hardware bug in P0 Pacific ASIC\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 for pacific ASIC | ||
Comment on lines
+54
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe:
|
||
+ * only | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it really temporary? |
||
+ */ | ||
+ 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, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why |
||
+ 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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make it an upstreamable commit message summary (How to Write a Git Commit Message).