#2067 closed defect (fixed)

Algorithm to determine max. PCI bus number is incorrect

Reported by: strauman Owned by: Joel Sherrill
Priority: highest Milestone: 4.9.5
Component: bsps Version: 4.9
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description (last modified by Gedare)

The algorithm scans all PCI busses (0..ff)
and all devices (0..31) on each bus for bridges
and determines the maximum of all subordinate
busses encountered.

However, the algorithm does not scan all functions
present in multi-function devices -- I have a PCI express
root complex (82801H) where multiple (non-zero index)
functions are 'PCI bridges' whose subordinate bus number is
missed by the original algorithm.

The attached patch makes sure that the scan
is extended to all functions of multi-function
devices.

Attachments (1)

rtems-i386-pcibios-buscnt-fix.diff (2.0 KB) - added by strauman on May 31, 2012 at 3:01:17 AM.
fix for the reported bug

Download all attachments as: .zip

Change History (8)

Changed on May 31, 2012 at 3:01:17 AM by strauman

fix for the reported bug

comment:1 Changed on May 31, 2012 at 3:01:17 AM by strauman

The algorithm scans all PCI busses (0..ff)
and all devices (0..31) on each bus for bridges
and determines the maximum of all subordinate
busses encountered.

However, the algorithm does not scan all functions
present in multi-function devices -- I have a PCI express
root complex (82801H) where multiple (non-zero index)
functions are 'PCI bridges' whose subordinate bus number is
missed by the original algorithm.

The attached patch makes sure that the scan
is extended to all functions of multi-function
devices.

comment:2 Changed on Dec 19, 2014 at 5:06:18 AM by Gedare

Priority: normalhighest

Bump priority to highest for tickets with a fix attached or seemingly simple fix proposed in the description or comments.

comment:3 Changed on Dec 24, 2014 at 3:29:57 AM by Till Strauman <strauman@…>

In e446d32687ee21037859d31f43a4a5d29db42793/rtems:

pc386: scan all functions of multi-function PCI devices

The current algorithm scans all PCI busses (0..ff)
and all devices (0..31) on each bus for bridges
and determines the maximum of all subordinate
busses encountered.

However, the algorithm does not scan all functions
present in multi-function devices -- I have a PCI express
root complex (82801H) where multiple (non-zero index)
functions are 'PCI bridges' whose subordinate bus number is
missed by the original algorithm.

This commit makes sure that the scan
is extended to all functions of multi-function
devices.

See #2067

comment:4 Changed on Dec 24, 2014 at 3:30:10 AM by Till Strauman <strauman@…>

In 0863e8e3903d1d4fa04df3bdf847931240570bfa/rtems:

pc386: scan all functions of multi-function PCI devices

The current algorithm scans all PCI busses (0..ff)
and all devices (0..31) on each bus for bridges
and determines the maximum of all subordinate
busses encountered.

However, the algorithm does not scan all functions
present in multi-function devices -- I have a PCI express
root complex (82801H) where multiple (non-zero index)
functions are 'PCI bridges' whose subordinate bus number is
missed by the original algorithm.

This commit makes sure that the scan
is extended to all functions of multi-function
devices.

See #2067

comment:5 Changed on Dec 24, 2014 at 3:30:27 AM by Till Strauman <strauman@…>

In 2573e698d1a5f2e481b5b0520a949c4f590bacbd/rtems:

pc386: scan all functions of multi-function PCI devices

The current algorithm scans all PCI busses (0..ff)
and all devices (0..31) on each bus for bridges
and determines the maximum of all subordinate
busses encountered.

However, the algorithm does not scan all functions
present in multi-function devices -- I have a PCI express
root complex (82801H) where multiple (non-zero index)
functions are 'PCI bridges' whose subordinate bus number is
missed by the original algorithm.

This commit makes sure that the scan
is extended to all functions of multi-function
devices.

See #2067

comment:6 Changed on Dec 24, 2014 at 3:31:56 AM by Gedare

Description: modified (diff)
Resolution: fixed
Status: newclosed

Patch reformatted to fix whitespace and applied to master and release branches 4.10 and 4.9

comment:7 Changed on Dec 24, 2014 at 3:44:45 AM by Gedare

Milestone: 4.114.9.5
Version: 4.104.9
Note: See TracTickets for help on using tickets.