linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zheng Huai Cheng <zhenghch@linux.vnet.ibm.com>
To: Martin Mares <mj@ucw.cz>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH] lspci: Skip scanning empty slot in sysfs_fill_slots
Date: Wed, 30 Oct 2013 11:05:27 +0800	[thread overview]
Message-ID: <1383102327.8618.0.camel@stefan-ThinkPad-T420> (raw)
In-Reply-To: <mj+md-20131029.120828.26872.nikam@ucw.cz>

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


  reply	other threads:[~2013-10-30  3:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]
2013-11-10 11:41     ` Martin Mares

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1383102327.8618.0.camel@stefan-ThinkPad-T420 \
    --to=zhenghch@linux.vnet.ibm.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=mj@ucw.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).