From: Richard Yang <weiyang@linux.vnet.ibm.com>
To: Richard Yang <weiyang@linux.vnet.ibm.com>
Cc: Linux PCI <linux-pci@vger.kernel.org>,
Gavin Shan <shangw@linux.vnet.ibm.com>,
Ram Pai <linuxram@us.ibm.com>
Subject: Re: One question about the useage of pci_dev->resource[]
Date: Tue, 26 Jun 2012 09:57:40 +0800 [thread overview]
Message-ID: <20120626015740.GA8128@richard> (raw)
In-Reply-To: <20120620084515.GA22809@richard>
On Wed, Jun 20, 2012 at 04:45:15PM +0800, Richard Yang wrote:
>All,
>
>I want to confirm something for the pci_dev->resource[].
>
>As in the definition in the pci.h, this resource array is divided into
>several parts.
> 0-5 for standard PCI resources
> 6 for ROM resource
> 7-10 for bridge resource( if no iov )
>
>
>1. For P2P bridge, 0-5 is left empty?
>2. If so, in code pci_setup_device(), I think it set the wrong resource.
> It call pci_read_bases(dev, 2, PCI_ROM_ADDRESS1), for a p2p bridge.
> And in pci_read_bases(), BAR information is retrieved and set to
> pci_dev->resource[0|1].
>3. If pci_setup_device() just set first two resource, the child bus will
> point to empty resource.
> In pci_alloc_child_bus(), child->resource[0-3] will be point to
> bridge->resource[7-10], which is not set in pci_setup_device().
>4. Another question is, is there any convention for pci_bus->resource[].
> [0] for io, [1] for mem, [2] for prefetch?
All,
I go through the code again and find pci_dev->resource[7-10] is used for
io/mem base/limit, which is used by the bridge to determine whether it
will forward one pci transaction.
So pci_dev->[0-1] is used by the bridge's driver?
If not exact, please correct me:)
>
>--
>Richard Yang
>Help you, Help me
--
Richard Yang
Help you, Help me
next prev parent reply other threads:[~2012-06-26 1:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-20 8:45 One question about the useage of pci_dev->resource[] Richard Yang
2012-06-26 1:57 ` Richard Yang [this message]
2012-06-26 12:16 ` Bjorn Helgaas
2012-06-27 2:22 ` Richard Yang
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=20120626015740.GA8128@richard \
--to=weiyang@linux.vnet.ibm.com \
--cc=linux-pci@vger.kernel.org \
--cc=linuxram@us.ibm.com \
--cc=shangw@linux.vnet.ibm.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.