[+cc linux-pci] On Fri, Mar 21, 2014 at 11:56 AM, Cristina Olariu <colariu@xxxxxxxxx> wrote: > Hello Bjorn, > > I was trying to use the pci_slot module in order to associate a network > interface to its corresponding network port by matching devices with > physical slot information. > > Unfortunately the PCIe slots on our platform don't support the hot-plug > function and the pci_slot module doesn't expose the slots interface in > sysfs. > > Is there another way to list devices by physical add-in slots? We are using > kernel version 3.4.67. > Any pointers you may be able to offer would be appreciated. I haven't paid much attention recently to the way we expose slot numbers. I assume you're looking for the sysfs info that is exposed via pci_create_slot(). The pci_slot module only puts slot info in sysfs (via pci_create_slot()) when the ACPI namespace contains certain information (_ADR, _SUN, etc.) If you don't support hotplug, you probably wouldn't have this info in the namespace. It looks like the only other user of pci_create_slot() is pci_hp_register(), which is called by various hotplug drivers. But none of these help you either if you don't support hotplug. "lspci -vv" should show you the "Physical Slot Number" from the Slot Capabilities register in the PCIe capability. Is that the number you're looking for? That seems like something we might want to expose via sysfs, but based on the places that use PCI_EXP_SLTCAP_PSN, I don't see anything that would do so. (Sigh, I see that pciehp defines PSN, which doesn't use PCI_EXP_SLTCAP_PSN but is extracting the same field. I'll fix this.) In any event, I'm guessing pciehp doesn't do anything (including creating the sysfs slot info) on your system because you don't support hotplug. But it seems reasonable that the slot number could be useful even without hotplug, so maybe this functionality should be moved out of pciehp somehow. Could you open a bugzilla at http://bugzilla.kernel.org and attach a complete dmesg log (with pciehp and pci_slot enabled) and complete "lspci -vv" info? Maybe we can figure out a nice way to do this. Bjorn -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html