linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] lspci: Skip scanning empty slot in sysfs_fill_slots
       [not found] <526F4EB4.4090101@linux.vnet.ibm.com>
@ 2013-10-29 12:09 ` Martin Mares
  2013-10-30  3:05   ` Zheng Huai Cheng
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Mares @ 2013-10-29 12:09 UTC (permalink / raw)
  To: Zheng Huai Cheng; +Cc: linux-pci

Hello!

> When slot is empty, lspci will report "pcilib: sysfs_fill_slots:
> Couldn't parse entry address 0000:01",this is because address entry will
> only contain domain and bus number when the slot is empty.
> 
> [root@uselp6 ~]# cat /sys/bus/pci/slots/U5802.001.RCHB059-P1-C7/address
> 0000:01

Is this behavior intentional?  It does not make much sense to me.

				Have a nice fortnight
-- 
Martin `MJ' Mares                          <mj@ucw.cz>   http://mj.ucw.cz/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
This line is umop apisdn.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] lspci: Skip scanning empty slot in sysfs_fill_slots
  2013-10-29 12:09 ` [PATCH] lspci: Skip scanning empty slot in sysfs_fill_slots Martin Mares
@ 2013-10-30  3:05   ` Zheng Huai Cheng
  2013-11-10 11:41     ` Martin Mares
  0 siblings, 1 reply; 3+ messages in thread
From: Zheng Huai Cheng @ 2013-10-30  3:05 UTC (permalink / raw)
  To: Martin Mares; +Cc: linux-pci

On Tue, 2013-10-29 at 13:09 +0100, Martin Mares wrote:
> Hello!
> 
> > When slot is empty, lspci will report "pcilib: sysfs_fill_slots:
> > Couldn't parse entry address 0000:01",this is because address entry will
> > only contain domain and bus number when the slot is empty.
> > 
> > [root@uselp6 ~]# cat /sys/bus/pci/slots/U5802.001.RCHB059-P1-C7/address
> > 0000:01

> Is this behavior intentional?  It does not make much sense to me.
> 
> 				Have a nice fortnight
although I am not a expert in PCI, seems this related to PCI hotplug.
And I also found a description in kernel source code

"
Placeholder slots:
In most cases, @pci_bus, @slot_nr will be sufficient to uniquely
identify a slot. There is one notable exception - pSeries (rpaphp),
where the @slot_nr cannot be determined until a device is actually
inserted into the slot. In this scenario, the caller may pass -1 for
@slot_nr.The following semantics are imposed when the caller passes
@slot_nr == -1. First, we no longer check for an existing %struct
pci_slot, as there may be many slots with @slot_nr of -1.  The other
change in semantics is user-visible, which is the 'address' parameter
presented in sysfs will consist solely of a dddd:bb tuple, where dddd is
the PCI domain of the %struct pci_bus and bb is the bus number. In other
words, the devfn of the 'placeholder' slot will not be
displayed.                             
"

so when slots are empty in some cases, "address" solely contain dddd:bb
tuple. But lspci will originally assume address in dddd:dd:dd tuple. so
we should skip dddd:bb case in sysfs_fill_slots


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] lspci: Skip scanning empty slot in sysfs_fill_slots
  2013-10-30  3:05   ` Zheng Huai Cheng
@ 2013-11-10 11:41     ` Martin Mares
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Mares @ 2013-11-10 11:41 UTC (permalink / raw)
  To: Zheng Huai Cheng; +Cc: linux-pci

Hello!

> although I am not a expert in PCI, seems this related to PCI hotplug.
> And I also found a description in kernel source code
> 
> "
> Placeholder slots:
[...]

Thanks for the explanation. I have just applied a fix similar to yours.

				Have a nice fortnight
-- 
Martin `MJ' Mares                          <mj@ucw.cz>   http://mj.ucw.cz/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
A LISP programmer knows value of everything, but cost of nothing.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-11-10 11:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <526F4EB4.4090101@linux.vnet.ibm.com>
2013-10-29 12:09 ` [PATCH] lspci: Skip scanning empty slot in sysfs_fill_slots Martin Mares
2013-10-30  3:05   ` Zheng Huai Cheng
2013-11-10 11:41     ` Martin Mares

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).