Enumerate all undiscovered PCIe busses
Subsystems (2)
PATCH 1/1 Enumerate all undiscovered PCIe busses
Multiple root complexes have a different start busnumber. Poll all undiscovered busses for a root complex
--- lib/generic.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
lib/generic.c +5 -1
@@ -69,9 +69,13 @@ void pci_generic_scan(struct pci_access *a) {byte busmap[256 ]; +int basebus;memset (busmap,0 ,sizeof (busmap)); -pci_generic_scan_bus (a, busmap,0 ); +for (basebus=0 ;basebus<256 ;basebus++) { +if (busmap[basebus]==0 ) +pci_generic_scan_bus (a, busmap, basebus); + } }int
Signature · 1 line
1.7.0.4
This appears to be a patch for pciutils, so I cc'd Martin, who maintains that.
Quoted 34 lines · Ruud
Multiple root complexes have a different start busnumber. Poll all undiscovered busses for a root complex
Signed-off-by Ruud <[email protected]>--- lib/generic.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)lib/generic.c +5
-1@@ -69,9 +69,13 @@ void pci_generic_scan(struct pci_access *a) {byte busmap[256 ]; +int basebus;memset (busmap,0 ,sizeof (busmap)); -pci_generic_scan_bus (a, busmap,0 ); +for (basebus=0 ;basebus<256 ;basebus++) { +if (busmap[basebus]==0 ) +pci_generic_scan_bus (a, busmap, basebus); + } }int Signature · 6 lines
1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi!
Quoted 2 lines
This appears to be a patch for pciutils, so I cc'd Martin, who maintains that.
Thanks, I manage to follow linux-pci only very loosely these days...
Quoted 3 lines · Ruud
Quoted 2 lines
Multiple root complexes have a different start busnumber. Poll all undiscovered busses for a root complex
Unfortunately, this is not correct to do. Many systems report junk on unused bus number (for example, they decode bus numbers only partially, so the buses repeat).
In which situation do you need this? Is it on Linux? Only lspci, or your own code using libpci?
Does `lspci -M' help?
Have a nice fortnight
Signature · 3 lines
Martin `MJ' Mares <[email protected]> http://mj.ucw.cz/ Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth "Please try to fit your code to 80 columns. That's decimal 80." -- A. Morton
Hi Martin,
I can't check the effect of "-M" at the moment so that will have to wait. Some context:
I got some buggy BIOS and lots of GPU's. The effect is that I need to reenumerate busses and to let linux do that it is suggested to use setpci to clear busnumber etc.
To make sure I do not clobber the linux drivers, I prefer to remove the switches at the root level (echo 1>remove) and set the registers using -H1 as hardware access.
Unfortunately on the multiprocessor intel system, three root complexes
exist: one at bus 0x00, One at bux 0x80 (and one at 0x7f IIRC). lspci -H1 will only report bus 0x00.
It is not a problem for me to use a patched version of pciutils locally, but hoped to share. Perhaps as an idea: make the base bus-number configurable at the command line instead of hard coded?
Best regards,
Ruud
2015-10-05 12:21 GMT+02:00 Martin Mares <[email protected]>:
Quoted 25 lines
Hi!
Quoted 2 lines
This appears to be a patch for pciutils, so I cc'd Martin, who maintains that.
Thanks, I manage to follow linux-pci only very loosely these days...
Quoted 3 lines · Ruud
Quoted 2 lines
Multiple root complexes have a different start busnumber. Poll all undiscovered busses for a root complex
Unfortunately, this is not correct to do. Many systems report junk on unused bus number (for example, they decode bus numbers only partially, so the buses repeat).
In which situation do you need this? Is it on Linux? Only lspci, or your own code using libpci?
Does `lspci -M' help?
Have a nice fortnight
--
Martin `MJ' Mares <[email protected]> http://mj.ucw.cz/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth "Please try to fit your code to 80 columns. That's decimal 80." -- A. Morton
Hi Martin,
I did some more digging
Quoted 2 lines
Does `lspci -M' help?
The -M option shows all busses (but not a tree view), but more important setpci doesn't have the option and thus does not allow to do settings on the alternative busses.
With respect to the "incorrectness" of the patch, one could argue that scanning all busses is allowed as they should read 0xFF for unassigned busses IIRC.
Quoted 1 line
From that respect it may make more sense to have a command line
option that forces a single bus, but scans by default instead of the other way around.
What do you think?
Best regards,
Ruud
2015-10-05 16:23 GMT+02:00 Ruud <[email protected]>:
Quoted 51 lines
Hi Martin,
I can't check the effect of "-M" at the moment so that will have to wait. Some context:
I got some buggy BIOS and lots of GPU's. The effect is that I need to reenumerate busses and to let linux do that it is suggested to use setpci to clear busnumber etc.
To make sure I do not clobber the linux drivers, I prefer to remove the switches at the root level (echo 1>remove) and set the registers using -H1 as hardware access.Unfortunately on the multiprocessor intel system, three root complexes
exist: one at bus0x00, One at bux0x80(and one at0x7fIIRC). lspci -H1 will only report bus0x00.It is not a problem for me to use a patched version of pciutils locally, but hoped to share. Perhaps as an idea: make the base bus-number configurable at the command line instead of hard coded?
Best regards,
Ruud
2015-10-05 12:21 GMT+02:00 Martin Mares <[email protected]>:
Quoted 25 lines
Hi!
Quoted 2 lines
This appears to be a patch for pciutils, so I cc'd Martin, who maintains that.
Thanks, I manage to follow linux-pci only very loosely these days...
Quoted 3 lines · Ruud
Quoted 2 lines
Multiple root complexes have a different start busnumber. Poll all undiscovered busses for a root complex
Unfortunately, this is not correct to do. Many systems report junk on unused bus number (for example, they decode bus numbers only partially, so the buses repeat).
In which situation do you need this? Is it on Linux? Only lspci, or your own code using libpci?
Does `lspci -M' help?
Have a nice fortnight
--
Martin `MJ' Mares <[email protected]> http://mj.ucw.cz/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth "Please try to fit your code to 80 columns. That's decimal 80." -- A. Morton
As alternative I made another patch that allows to specify a specific busnumber as a base:
https://github.com/netwerkforens/pciutils/tree/multibus_v2
https://github.com/pciutils/pciutils/pull/2
Quoted 4 lines
Quoted 4 lines
It is not a problem for me to use a patched version of pciutils locally, but hoped to share. Perhaps as an idea: make the base bus-number configurable at the command line instead of hard coded?