linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] allow host bridges with no io/mem apertures
@ 2012-01-18  0:41 Bjorn Helgaas
  2012-01-18  0:41 ` [PATCH] x86/PCI: don't fall back to defaults if _CRS has no apertures Bjorn Helgaas
  0 siblings, 1 reply; 5+ messages in thread
From: Bjorn Helgaas @ 2012-01-18  0:41 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: linux-pci, Yinghai Lu

This patch changes what we do when we don't find any apertures in
a PCI host bridge _CRS.  Previously, we assumed something in _CRS
parsing or in _CRS itself was broken, so we gave the root bus
the default resources (all of I/O port and MMIO space).

But I think this is wrong because there are often host bridges that
correctly have no apertures, e.g., they lead to things like Intel
Uncore "devices" that have no BARs.

This is intended for linux-next, not for the current merge window.

---

Bjorn Helgaas (1):
      x86/PCI: don't fall back to defaults if _CRS has no apertures


 arch/x86/pci/acpi.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

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

* [PATCH] x86/PCI: don't fall back to defaults if _CRS has no apertures
  2012-01-18  0:41 [PATCH] allow host bridges with no io/mem apertures Bjorn Helgaas
@ 2012-01-18  0:41 ` Bjorn Helgaas
  2012-01-18  4:09   ` Yinghai Lu
  2012-01-27 17:34   ` Jesse Barnes
  0 siblings, 2 replies; 5+ messages in thread
From: Bjorn Helgaas @ 2012-01-18  0:41 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: linux-pci, Yinghai Lu

Host bridges that lead to things like the Uncore need not have any
I/O port or MMIO apertures.  For example, in this case:

    ACPI: PCI Root Bridge [UNC1] (domain 0000 [bus ff])
    PCI: root bus ff: using default resources
    PCI host bridge to bus 0000:ff
    pci_bus 0000:ff: root bus resource [io  0x0000-0xffff]
    pci_bus 0000:ff: root bus resource [mem 0x00000000-0x3fffffffffff]

we should not pretend those default resources are available on bus ff.

CC: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 arch/x86/pci/acpi.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index 0a45d1c..67d9b49 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -405,7 +405,12 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_pci_root *root)
 		kfree(sd);
 	} else {
 		get_current_resources(device, busnum, domain, &resources);
-		if (list_empty(&resources))
+
+		/*
+		 * _CRS with no apertures is normal, so only fall back to
+		 * defaults or native bridge info if we're ignoring _CRS.
+		 */
+		if (!pci_use_crs)
 			x86_pci_root_bus_resources(busnum, &resources);
 		bridge = pci_create_host_bridge(NULL, domain, &root->secondary,
 						&resources, &pci_root_ops, sd);


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

* Re: [PATCH] x86/PCI: don't fall back to defaults if _CRS has no apertures
  2012-01-18  0:41 ` [PATCH] x86/PCI: don't fall back to defaults if _CRS has no apertures Bjorn Helgaas
@ 2012-01-18  4:09   ` Yinghai Lu
  2012-01-18  4:29     ` Bjorn Helgaas
  2012-01-27 17:34   ` Jesse Barnes
  1 sibling, 1 reply; 5+ messages in thread
From: Yinghai Lu @ 2012-01-18  4:09 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: Jesse Barnes, linux-pci

On Tue, Jan 17, 2012 at 4:41 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> Host bridges that lead to things like the Uncore need not have any
> I/O port or MMIO apertures.  For example, in this case:
>
>    ACPI: PCI Root Bridge [UNC1] (domain 0000 [bus ff])
>    PCI: root bus ff: using default resources
>    PCI host bridge to bus 0000:ff
>    pci_bus 0000:ff: root bus resource [io  0x0000-0xffff]
>    pci_bus 0000:ff: root bus resource [mem 0x00000000-0x3fffffffffff]
>
> we should not pretend those default resources are available on bus ff.
>
> CC: Yinghai Lu <yinghai@kernel.org>
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> ---
>  arch/x86/pci/acpi.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
> index 0a45d1c..67d9b49 100644
> --- a/arch/x86/pci/acpi.c
> +++ b/arch/x86/pci/acpi.c
> @@ -405,7 +405,12 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_pci_root *root)
>                kfree(sd);
>        } else {
>                get_current_resources(device, busnum, domain, &resources);
> -               if (list_empty(&resources))
> +
> +               /*
> +                * _CRS with no apertures is normal, so only fall back to
> +                * defaults or native bridge info if we're ignoring _CRS.
> +                */
> +               if (!pci_use_crs)
>                        x86_pci_root_bus_resources(busnum, &resources);
>                bridge = pci_create_host_bridge(NULL, domain, &root->secondary,
>                                                &resources, &pci_root_ops, sd);
>

how about system with ACPI support, but does not have _CRS or _CRS has
parse error ?

Thanks

Yinghai

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

* Re: [PATCH] x86/PCI: don't fall back to defaults if _CRS has no apertures
  2012-01-18  4:09   ` Yinghai Lu
@ 2012-01-18  4:29     ` Bjorn Helgaas
  0 siblings, 0 replies; 5+ messages in thread
From: Bjorn Helgaas @ 2012-01-18  4:29 UTC (permalink / raw)
  To: Yinghai Lu; +Cc: Jesse Barnes, linux-pci

On Tue, Jan 17, 2012 at 9:09 PM, Yinghai Lu <yinghai@kernel.org> wrote:
> On Tue, Jan 17, 2012 at 4:41 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
>> Host bridges that lead to things like the Uncore need not have any
>> I/O port or MMIO apertures.  For example, in this case:
>>
>>    ACPI: PCI Root Bridge [UNC1] (domain 0000 [bus ff])
>>    PCI: root bus ff: using default resources
>>    PCI host bridge to bus 0000:ff
>>    pci_bus 0000:ff: root bus resource [io  0x0000-0xffff]
>>    pci_bus 0000:ff: root bus resource [mem 0x00000000-0x3fffffffffff]
>>
>> we should not pretend those default resources are available on bus ff.
>>
>> CC: Yinghai Lu <yinghai@kernel.org>
>> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
>> ---
>>  arch/x86/pci/acpi.c |    7 ++++++-
>>  1 files changed, 6 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
>> index 0a45d1c..67d9b49 100644
>> --- a/arch/x86/pci/acpi.c
>> +++ b/arch/x86/pci/acpi.c
>> @@ -405,7 +405,12 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_pci_root *root)
>>                kfree(sd);
>>        } else {
>>                get_current_resources(device, busnum, domain, &resources);
>> -               if (list_empty(&resources))
>> +
>> +               /*
>> +                * _CRS with no apertures is normal, so only fall back to
>> +                * defaults or native bridge info if we're ignoring _CRS.
>> +                */
>> +               if (!pci_use_crs)
>>                        x86_pci_root_bus_resources(busnum, &resources);
>>                bridge = pci_create_host_bridge(NULL, domain, &root->secondary,
>>                                                &resources, &pci_root_ops, sd);
>>
>
> how about system with ACPI support, but does not have _CRS or _CRS has
> parse error ?

Do you have examples of such systems?  I haven't seen any, and I'm not
sure it's worth worrying about them unless they actually exist.

It doesn't seem like it would make any sense to use ACPI to describe a
host bridge without using _CRS to describe its properties.

Bjorn

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

* Re: [PATCH] x86/PCI: don't fall back to defaults if _CRS has no apertures
  2012-01-18  0:41 ` [PATCH] x86/PCI: don't fall back to defaults if _CRS has no apertures Bjorn Helgaas
  2012-01-18  4:09   ` Yinghai Lu
@ 2012-01-27 17:34   ` Jesse Barnes
  1 sibling, 0 replies; 5+ messages in thread
From: Jesse Barnes @ 2012-01-27 17:34 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci, Yinghai Lu

[-- Attachment #1: Type: text/plain, Size: 713 bytes --]

On Tue, 17 Jan 2012 17:41:21 -0700
Bjorn Helgaas <bhelgaas@google.com> wrote:

> Host bridges that lead to things like the Uncore need not have any
> I/O port or MMIO apertures.  For example, in this case:
> 
>     ACPI: PCI Root Bridge [UNC1] (domain 0000 [bus ff])
>     PCI: root bus ff: using default resources
>     PCI host bridge to bus 0000:ff
>     pci_bus 0000:ff: root bus resource [io  0x0000-0xffff]
>     pci_bus 0000:ff: root bus resource [mem 0x00000000-0x3fffffffffff]
> 
> we should not pretend those default resources are available on bus ff.

Applied to -next, let's see if this _CRS change breaks anything. :)

Thanks,
-- 
Jesse Barnes, Intel Open Source Technology Center

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2012-01-27 17:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-18  0:41 [PATCH] allow host bridges with no io/mem apertures Bjorn Helgaas
2012-01-18  0:41 ` [PATCH] x86/PCI: don't fall back to defaults if _CRS has no apertures Bjorn Helgaas
2012-01-18  4:09   ` Yinghai Lu
2012-01-18  4:29     ` Bjorn Helgaas
2012-01-27 17:34   ` Jesse Barnes

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).