public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Jeff Garrett <jeff@jgarrett.org>,
	linux-kernel@vger.kernel.org, Len Brown <lenb@kernel.org>,
	linux-acpi@vger.kernel.org,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	linux-pci@vger.kernel.org, David Airlie <airlied@linux.ie>
Subject: Re: [PATCH] x86/pci: intel ioh need to subtract mmconf range
Date: Thu, 14 Jan 2010 16:49:07 -0700	[thread overview]
Message-ID: <201001141649.08554.bjorn.helgaas@hp.com> (raw)
In-Reply-To: <4B4FAAE0.7080608@kernel.org>

On Thursday 14 January 2010 04:38:08 pm Yinghai Lu wrote:
> On 01/14/2010 03:09 PM, Bjorn Helgaas wrote:
> > On Thursday 14 January 2010 03:46:35 pm Yinghai Lu wrote:
> >>
> >> Bjorn pointed out we need to remove mmconf range
> >>
> >> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> >>
> >> ---
> >>  arch/x86/pci/intel_bus.c |   29 +++++++++++++++++++++++++++--
> >>  1 file changed, 27 insertions(+), 2 deletions(-)
> >>
> >> Index: linux-2.6/arch/x86/pci/intel_bus.c
> >> ===================================================================
> >> --- linux-2.6.orig/arch/x86/pci/intel_bus.c
> >> +++ linux-2.6/arch/x86/pci/intel_bus.c
> >> @@ -46,6 +46,20 @@ static inline void print_ioh_resources(s
> >>  
> >>  #define RANGE_NUM 16
> >>  
> >> +static void __devinit subtract_mmconf(struct range *range, int nr)
> >> +{
> >> +#ifdef CONFIG_PCI_MMCONFIG
> >> +	struct pci_mmcfg_region *cfg;
> >> +
> >> +	if (list_empty(&pci_mmcfg_list))
> >> +		return;
> >> +
> >> +        list_for_each_entry(cfg, &pci_mmcfg_list, list)
> >> +		subtract_range(range, nr, cfg->res.start,
> >> +			 cfg->res.end + 1);
> >> +#endif
> > 
> > This can't be right, can it?  Let's say the kernel was built with
> > CONFIG_PCI_MMCONFIG turned off, or the user used "pci=nommconf",
> > or the kernel decides not to use MMCONFIG for some other reason.
> > 
> > In that case, the hardware may still be configured to support
> > MMCONFIG, but the pci_mmcfg_list will be empty, so your code will
> > leave the window alone.  We might assign some of that MMCONFIG
> > space to a device, but the hardware will route it to MMCONFIG,
> > not to the device.
> 
> so if there is mmconf specified, we just skip the whole function?

No, I'm saying that intel-bus.c must ALWAYS remove the MMCONFIG region
from the host bridge apertures, even if Linux isn't using MMCONFIG.

That means intel-bus.c has to be smart enough to figure out on its
own what the MMCONFIG area is.  It can't depend on mmconfig-shared.c
to do it, because mmconfig-shared.c might not be there.

Bjorn

  reply	other threads:[~2010-01-14 23:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-13  5:37 2.6.33-rc3: pci host bridge windows ignored (works with pci=use_crs) Jeff Garrett
2010-01-13  8:44 ` Yinghai Lu
2010-01-13  8:45   ` Yinghai Lu
2010-01-13 13:24     ` Jeff Garrett
2010-01-14  7:46       ` Yinghai Lu
2010-01-14 18:08         ` Bjorn Helgaas
2010-01-14 22:46           ` [PATCH] x86/pci: intel ioh need to subtract mmconf range Yinghai Lu
2010-01-14 23:09             ` Bjorn Helgaas
2010-01-14 23:38               ` Yinghai Lu
2010-01-14 23:49                 ` Bjorn Helgaas [this message]
2010-01-15  0:39                   ` Yinghai Lu
2010-01-15 18:14                     ` Jesse Barnes
2010-01-19 19:42                       ` Jeff Garrett
2010-01-19 19:57                         ` Yinghai Lu
2010-01-19 22:52                           ` Bjorn Helgaas
2010-01-19 22:54                             ` Yinghai Lu

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=201001141649.08554.bjorn.helgaas@hp.com \
    --to=bjorn.helgaas@hp.com \
    --cc=airlied@linux.ie \
    --cc=jbarnes@virtuousgeek.org \
    --cc=jeff@jgarrett.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=yinghai@kernel.org \
    /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