-
Notifications
You must be signed in to change notification settings - Fork 172
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
[PCI/ASPM] Revert commit 456d8aa
to avoid kernel panics in 6.1.94
#448
Open
arista-nwolfe
wants to merge
1
commit into
sonic-net:master
Choose a base branch
from
arista-nwolfe:master-6.1.94-revert-456d8aa
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
patch/revert-456d8aa-to-fix-pcie_aspm_exit_link_status.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Nathan Wolfe <[email protected]> | ||
Date: Tue, 8 Oct 2024 11:57:26 -0700 | ||
Subject: [PATCH] revert 456d8aa to fix pcie_aspm_exit_link_status | ||
|
||
https://github.com/torvalds/linux/commit/456d8aa37d0f56fc9e985e812496e861dcd6f2f2 | ||
--- | ||
drivers/pci/pcie/aspm.c | 21 +++++++++------------ | ||
1 file changed, 9 insertions(+), 12 deletions(-) | ||
|
||
diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c | ||
index cf4acea66..188517c5a 100644 | ||
--- a/drivers/pci/pcie/aspm.c | ||
+++ b/drivers/pci/pcie/aspm.c | ||
@@ -1025,24 +1025,21 @@ void pcie_aspm_exit_link_state(struct pci_dev *pdev) | ||
|
||
down_read(&pci_bus_sem); | ||
mutex_lock(&aspm_lock); | ||
+ /* | ||
+ * All PCIe functions are in one slot, remove one function will remove | ||
+ * the whole slot, so just wait until we are the last function left. | ||
+ */ | ||
+ if (!list_empty(&parent->subordinate->devices)) | ||
+ goto out; | ||
|
||
link = parent->link_state; | ||
root = link->root; | ||
parent_link = link->parent; | ||
|
||
- /* | ||
- * link->downstream is a pointer to the pci_dev of function 0. If | ||
- * we remove that function, the pci_dev is about to be deallocated, | ||
- * so we can't use link->downstream again. Free the link state to | ||
- * avoid this. | ||
- * | ||
- * If we're removing a non-0 function, it's possible we could | ||
- * retain the link state, but PCIe r6.0, sec 7.5.3.7, recommends | ||
- * programming the same ASPM Control value for all functions of | ||
- * multi-function devices, so disable ASPM for all of them. | ||
- */ | ||
+ /* All functions are removed, so just disable ASPM for the link */ | ||
pcie_config_aspm_link(link, 0); | ||
list_del(&link->sibling); | ||
+ /* Clock PM is for endpoint device */ | ||
free_link_state(link); | ||
|
||
/* Recheck latencies and configure upstream links */ | ||
@@ -1050,7 +1047,7 @@ void pcie_aspm_exit_link_state(struct pci_dev *pdev) | ||
pcie_update_aspm_capable(root); | ||
pcie_config_aspm_path(parent_link); | ||
} | ||
- | ||
+out: | ||
mutex_unlock(&aspm_lock); | ||
up_read(&pci_bus_sem); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 add a summary, and also a reference to the upstream discussion.