This repository was archived by the owner on May 12, 2021. It is now read-only.
drivers: Correct isPCIeDevice logic#2898
Merged
Merged
Conversation
Currently, isPCIeDevice() attempts to determine if a (host) device is PCI-Express capable by looking up its link speed via the PCI slots information in sysfs. This is a) complicated and b) wrong. PCI-e devices don't have to have slots information, so this frequently fails. Instead determine if devices are PCI-e by checking for the presence of PCIe extended configuration space by looking at the size of the "config" file in sysfs. Fixes: #2678 Signed-off-by: David Gibson <david@gibson.dropbear.id.au> (cherry picked from commit 6bf93b2)
Contributor
Author
|
stable-1.11 backport of #2889 |
Member
|
/test |
jodh-intel
approved these changes
Aug 25, 2020
Codecov Report
@@ Coverage Diff @@
## stable-1.11 #2898 +/- ##
===============================================
- Coverage 50.43% 50.38% -0.05%
===============================================
Files 118 118
Lines 17114 17139 +25
===============================================
+ Hits 8631 8636 +5
- Misses 7425 7445 +20
Partials 1058 1058 |
devimc
approved these changes
Aug 25, 2020
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Currently, isPCIeDevice() attempts to determine if a (host) device is
PCI-Express capable by looking up its link speed via the PCI slots
information in sysfs. This is a) complicated and b) wrong. PCI-e devices
don't have to have slots information, so this frequently fails.
Instead determine if devices are PCI-e by checking for the presence of
PCIe extended configuration space by looking at the size of the "config"
file in sysfs.
Fixes: #2678
Signed-off-by: David Gibson david@gibson.dropbear.id.au
(cherry picked from commit 6bf93b2)