On Wed, 16 Jan 2008 14:09:02 -0800
Yinghai Lu <[EMAIL PROTECTED]> wrote:

> [PATCH] x86: MMCONF enable MCFG early
> 
> patch
>       x86: validate against ACPI motherboard resources
> 
> changed the mmconf init sequence, and init MMCONF late in acpi_init.
> 
> here change it back to old sequence
> 1. check hostbridge in early
> 2. check MCFG with e820 in early
> 3. if all fail, will check MCFg with acpi _CRS in acpi_init
> 
> So we can make MCONF working again when acpi=off is set if hostbridge support 
> that.
> 
> ...
>
> +             printk(KERN_NOTICE "PCI: MCFG configuration %d: base %lx "
>                      "segment %hu buses %u - %u\n",
>                      i, (unsigned long)cfg->address, cfg->pci_segment,
>                      (unsigned int)cfg->start_bus_number,
>                      (unsigned int)cfg->end_bus_number);
> +
> +             if (!early)
>               if (is_acpi_reserved(cfg->address, cfg->address + size - 1)) {
>                       printk(KERN_NOTICE "PCI: MCFG area at %Lx reserved "
>                              "in ACPI motherboard resources\n",
>                              cfg->address);
> -             } else {
> +                     valid = 1;
> +             }

grumble.  Please don't mess up the kernel source like that.

> -void __init pci_mmcfg_late_init(void)
> +void __init __pci_mmcfg_init(int type, int early)
>  {
> -     int known_bridge = 0;
> -
>       /* MMCONFIG disabled */
>       if ((pci_probe & PCI_PROBE_MMCONF) == 0)
>               return;
>  
>       /* MMCONFIG already enabled */
> +     if (!early)
>       if (!(pci_probe & PCI_PROBE_MASK & ~PCI_PROBE_MMCONF))
>               return;
>  

and that.  Do it properly.

--- a/arch/x86/pci/mmconfig-shared.c~x86-mmconf-enable-mcfg-early-cleanup
+++ a/arch/x86/pci/mmconfig-shared.c
@@ -308,8 +308,8 @@ static void __init pci_mmcfg_reject_brok
                       (unsigned int)cfg->start_bus_number,
                       (unsigned int)cfg->end_bus_number);
 
-               if (!early)
-               if (is_acpi_reserved(cfg->address, cfg->address + size - 1)) {
+               if (!early &&
+                   is_acpi_reserved(cfg->address, cfg->address + size - 1)) {
                        printk(KERN_NOTICE "PCI: MCFG area at %Lx reserved "
                               "in ACPI motherboard resources\n",
                               cfg->address);
@@ -357,8 +357,7 @@ void __init __pci_mmcfg_init(int type, i
                return;
 
        /* MMCONFIG already enabled */
-       if (!early)
-       if (!(pci_probe & PCI_PROBE_MASK & ~PCI_PROBE_MMCONF))
+       if (!early && !(pci_probe & PCI_PROBE_MASK & ~PCI_PROBE_MMCONF))
                return;
 
        /* for late to exit */
_

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to