minor bug in pciutils libpci for sparc64 when /sys is not mounted

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



That's by error inside a chroot that I find that if /sys is not mounted,
lspci fail.
This happen only in sparc64 arch (tested x86 and powerpc).

With /sys not mounted
[chroot-sparc64] root:/$ lspci -G
Trying method 1......cannot open /sys/bus/pci...No.
Trying method 2......using /proc/bus/pci...OK
Decided to use linux-proc
pcilib: Cannot open /proc/bus/pci/02/03.0
lspci: Unable to read the standard configuration space header of device
0000:02:03.0
pcilib: Cannot open /proc/bus/pci/01/03.0
lspci: Unable to read the standard configuration space header of device
0000:01:03.0
pcilib: Cannot open /proc/bus/pci/01/02.0
lspci: Unable to read the standard configuration space header of device
0000:01:02.0
pcilib: Cannot open /proc/bus/pci/01/01.1
lspci: Unable to read the standard configuration space header of device
0000:01:01.1
pcilib: Cannot open /proc/bus/pci/01/01.0
lspci: Unable to read the standard configuration space header of device
0000:01:01.0
pcilib: Cannot open /proc/bus/pci/00/01.0
lspci: Unable to read the standard configuration space header of device
0000:00:01.0
pcilib: Cannot open /proc/bus/pci/00/01.1
lspci: Unable to read the standard configuration space header of device
0000:00:01.1
pcilib: Cannot open /proc/bus/pci/00/00.0
lspci: Unable to read the standard configuration space header of device
0000:00:00.0

[chroot-sparc64] root:/$ mount -t sysfs sysfs /sys
[chroot-sparc64] root:/$ lspci -G
Trying method 1......using /sys/bus/pci...OK
Decided to use linux-sysfs
00:00.0 Host bridge: Sun Microsystems Computer Corp. Psycho UPA-PCI Bus
Module [pcipsy]
00:01.0 PCI bridge: Sun Microsystems Computer Corp. Simba Advanced PCI
Bridge (rev 13)
00:01.1 PCI bridge: Sun Microsystems Computer Corp. Simba Advanced PCI
Bridge (rev 13)
01:01.0 Bridge: Sun Microsystems Computer Corp. EBUS (rev 01)
01:01.1 Ethernet controller: Sun Microsystems Computer Corp. Happy Meal
10/100 Ethernet [hme] (rev 01)
01:02.0 VGA compatible controller: ATI Technologies Inc 3D Rage Pro 215GP
(rev 5c)
01:03.0 IDE interface: Silicon Image, Inc. PCI0646 (rev 03)
02:03.0 Ethernet controller: Realtek Semiconductor Co., Ltd.
RTL-8139/8139C/8139C+ (rev 10)

The reason should be that the format in /proc/bus/pci is different for
sparc64 from other arch.
[chroot-sparc64] root:/$ ls /proc/bus/pci
0000:00  0000:01  0000:02  devices

[chroot-i486] root:/$ ls /proc/bus/pci
00  01  03  devices

Both pciutils-3.0.0 (debian lenny) and 3.1.2 (vanilia) behave the same.

I know there is a specific define for PCI_ARCH_SPARC64 in types.h.
But I franckly don't know how fix the code (except that' probably in
lib/proc.c).

    Gilles

Ps keep me CC

--
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

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux