From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Yu Zhao <yu.zhao@intel.com>,
Matthew Wilcox <willy@linux.intel.com>
Subject: Re: [PATCH] x86/pci: claim SR-IOV bar in pcibios_allocate_resource
Date: Tue, 24 Nov 2009 13:40:08 -0800 [thread overview]
Message-ID: <20091124134008.0050a339@jbarnes-piketon> (raw)
In-Reply-To: <4B0C4E69.4090402@kernel.org>
On Tue, 24 Nov 2009 13:21:45 -0800
Yinghai Lu <yinghai@kernel.org> wrote:
> Jesse Barnes wrote:
> > On Sat, 14 Nov 2009 23:46:46 -0800
> > Yinghai Lu <yinghai@kernel.org> wrote:
> >
> >> so use correct allocation from BIOS, instead of later assign
> >> another one.
> >>
> >> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> >>
> >> ---
> >> arch/x86/pci/i386.c | 4 +++-
> >> 1 file changed, 3 insertions(+), 1 deletion(-)
> >>
> >> Index: linux-2.6/arch/x86/pci/i386.c
> >> ===================================================================
> >> --- linux-2.6.orig/arch/x86/pci/i386.c
> >> +++ linux-2.6/arch/x86/pci/i386.c
> >> @@ -155,7 +155,9 @@ static void __init pcibios_allocate_reso
> >>
> >> for_each_pci_dev(dev) {
> >> pci_read_config_word(dev, PCI_COMMAND, &command);
> >> - for (idx = 0; idx < PCI_ROM_RESOURCE; idx++) {
> >> + for (idx = 0; idx < PCI_BRIDGE_RESOURCES; idx++) {
> >> + if (idx == PCI_ROM_RESOURCE)
> >> + continue;
> >> r = &dev->resource[idx];
> >> if (r->parent) /* Already
> >> allocated */ continue;
> >
> > I'm worried this might have side effects beyond just allocating
> > SR-IOV BARs, since it looks like we'll walk through all the bridge
> > resources all the time?
>
> /*
> * For PCI devices, the region numbers are assigned this way:
> */
> enum {
> /* #0-5: standard PCI resources */
> PCI_STD_RESOURCES,
> PCI_STD_RESOURCE_END = 5,
>
> /* #6: expansion ROM resource */
> PCI_ROM_RESOURCE,
>
> /* device specific resources */
> #ifdef CONFIG_PCI_IOV
> PCI_IOV_RESOURCES,
> PCI_IOV_RESOURCE_END = PCI_IOV_RESOURCES + PCI_SRIOV_NUM_BARS
> - 1, #endif
>
> /* resources assigned to buses behind the bridge */
> #define PCI_BRIDGE_RESOURCE_NUM 4
>
> PCI_BRIDGE_RESOURCES,
>
> so will only add IOV BAR related.
Oh right, *up to* bridge resources... Still we should probably add a
comment about that. SR-IOV is still somewhat new.
--
Jesse Barnes, Intel Open Source Technology Center
next prev parent reply other threads:[~2009-11-24 21:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-15 7:46 Yinghai Lu
2009-11-24 21:19 ` Jesse Barnes
2009-11-24 21:21 ` Yinghai Lu
2009-11-24 21:40 ` Jesse Barnes [this message]
2009-11-25 2:05 ` [PATCH] x86/pci: claim SR-IOV bar in pcibios_allocate_resource -v2 Yinghai Lu
2009-12-05 0:00 ` Jesse Barnes
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=20091124134008.0050a339@jbarnes-piketon \
--to=jbarnes@virtuousgeek.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=willy@linux.intel.com \
--cc=yinghai@kernel.org \
--cc=yu.zhao@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®