On Mon, Jun 29, 2009 at 01:04:53PM +0530, M. Mohan Kumar wrote: > With recent pciutils, lspci tries to open non-existent files in sysfs and > issues following warning messages: > > pcilib: sysfs_fill_slots: Cannot open /sys/bus/pci/slots/control/address: No > such file or directory > pcilib: sysfs_fill_slots: Cannot open /sys/bus/pci/slots/0000:01:00.0/address: > No such file or directory > > Above warning message is displayed when using a 2.6.16 based distro kernel > and pciutils 3.1.2 and 3.1 versions. This problem is not seen in 3.0 > version. > > If the files don't exist, should not we return without displaying any > warning? Yes, we should. Can you try this patch? diff --git a/lib/sysfs.c b/lib/sysfs.c index 2419b41..ef00a3b 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -221,11 +221,13 @@ sysfs_fill_slots(struct pci_access *a) if (n < 0 || n >= OBJNAMELEN) a->error("File name too long"); file = fopen(namebuf, "r"); + /* + * Old versions of Linux had a fakephp which didn't have an 'address' + * file. There's no useful information to be gleaned from these + * devices, pretend they're not there + */ if (!file) - { - a->warning("sysfs_fill_slots: Cannot open %s: %s", namebuf, strerror(errno)); - continue; - } + continue; if (!fgets(buf, sizeof(buf), file) || sscanf(buf, "%x:%x:%x", &dom, &bus, &dev) < 3) a->warning("sysfs_fill_slots: Couldn't parse entry address %s", buf); -- Matthew Wilcox Intel Open Source Technology Centre "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step." -- 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