Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • L libpciaccess
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3
    • Issues 3
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • xorgxorg
  • lib
  • libpciaccess
  • Issues
  • #9
Closed
Open
Issue created Dec 25, 2016 by Bugzilla Migration User@bugzilla-migration

pci_device_get_bridge_info() can not work with multi-function bridge

Submitted by Lichao Mu

Assigned to Xorg Project Team

Link to original bug (#99197)

Description

on one SuperMicro X10DRi + Xeon E5-2680 v3 machine, there are multi-function PCI bridges:
# lspci | grep bridge
00:00.0 Host bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 DMI2 (rev 02)
00:01.0 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 1 (rev 02)
00:02.0 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 2 (rev 02)
00:03.0 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 3 (rev 02)
00:03.2 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 3 (rev 02)

00:03.0 and 00:03.2 are multi-function PCI bridges and their header type is 0x81 (the highest bit is 1) when getting from Linux sysfs. In such case, pci_device_get_bridge_info() will return NULL.

following patch will fix the issue.

diff --git a/src/common_bridge.c b/src/common_bridge.c
index b4b5d7e..84cc57b 100644
--- a/src/common_bridge.c
+++ b/src/common_bridge.c
@@ -216,7 +216,7 @@ pci_device_get_bridge_info( struct pci_device * dev )
        read_bridge_info(priv);
     }

-    return (priv->header_type == 1) ? priv->bridge.pci : NULL;
+    return ((priv->header_type & 0x7f) == 1) ? priv->bridge.pci : NULL;
 }

Version: git
Edited Oct 24, 2018 by Adam Jackson
Assignee
Assign to
Time tracking