public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/3] add-force-of-use-mmconfig.patch
@ 2006-07-31  8:28 Edgar Hucek
  2006-08-01  5:18 ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Edgar Hucek @ 2006-07-31  8:28 UTC (permalink / raw)
  To: LKML, Linus Torvalds, Andrew Morton

This Patch add force for mmconfig. On Intel Macs the efi firmaware gives
a different memory map then ACPI_MCFG provides. This makes the check wether
to use mmconfig or not fail.

Signed-off-by: Edgar Hucek <hostmaster@ed-soft.at>


diff -uNr linux-2.6.18-rc3/arch/i386/Kconfig linux-2.6.18-rc3.mactel/arch/i386/Kconfig
--- linux-2.6.18-rc3/arch/i386/Kconfig	2006-07-31 09:24:20.000000000 +0200
+++ linux-2.6.18-rc3.mactel/arch/i386/Kconfig	2006-07-31 09:27:55.000000000 +0200
@@ -1027,6 +1027,7 @@
 	default y
 
 config PCI_MMCONFIG
+	depends on DMI
 	bool
 	depends on PCI && ACPI && (PCI_GOMMCONFIG || PCI_GOANY)
 	default y
diff -uNr linux-2.6.18-rc3/arch/i386/pci/mmconfig.c linux-2.6.18-rc3.mactel/arch/i386/pci/mmconfig.c
--- linux-2.6.18-rc3/arch/i386/pci/mmconfig.c	2006-07-31 09:24:20.000000000 +0200
+++ linux-2.6.18-rc3.mactel/arch/i386/pci/mmconfig.c	2006-07-31 09:27:57.000000000 +0200
@@ -12,6 +12,8 @@
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <linux/acpi.h>
+#include <linux/dmi.h>
+#include <linux/efi.h>
 #include <asm/e820.h>
 #include "pci.h"
 
@@ -187,6 +189,54 @@
 	}
 }
 
+/*
+ * Print system on which MMCONFIG is forced.
+ */
+
+static int __init pci_mmcfg_force_system(struct dmi_system_id *id)
+{
+	printk(KERN_INFO "PCI: System %s detected. Force MMCONFIG\n",
+		id->ident);
+
+	return 0;
+}
+
+/*
+ * DMI table of forced MMCONFIG systems.
+ */
+
+static struct dmi_system_id __initdata pci_mmcfg_dmi_system_apple[] = {
+	{ pci_mmcfg_force_system, "iMac4,1", {
+	  DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
+	  DMI_MATCH(DMI_BIOS_VERSION,"iMac4,1") }},
+	{ pci_mmcfg_force_system, "MacBookPro1,1", {
+	  DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
+	  DMI_MATCH(DMI_BIOS_VERSION,"MacBookPro1,1") }},
+	{ pci_mmcfg_force_system, "MacBook1,1", {
+	  DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
+	  DMI_MATCH(DMI_PRODUCT_NAME,"MacBook1,1")}},
+	{ pci_mmcfg_force_system, "Macmini1,1", {
+	  DMI_MATCH(DMI_BIOS_VENDOR,"Apple Computer, Inc."),
+	  DMI_MATCH(DMI_PRODUCT_NAME,"Macmini1,1")}},
+	{},
+};
+
+/*
+ * Check force MMCONFIG.
+ */
+
+int __init pci_mmcfg_force(void)
+{
+	if (efi_enabled) {
+		if (dmi_check_system(pci_mmcfg_dmi_system_apple)) {
+			add_memory_region(pci_mmcfg_config[0].base_address,
+				pci_mmcfg_config[0].base_address + MMCONFIG_APER_MIN, E820_RESERVED);
+			return 1;
+		}
+	}
+	return 0;
+}
+
 void __init pci_mmcfg_init(void)
 {
 	if ((pci_probe & PCI_PROBE_MMCONF) == 0)
@@ -198,13 +248,15 @@
 	    (pci_mmcfg_config[0].base_address == 0))
 		return;
 
-	if (!e820_all_mapped(pci_mmcfg_config[0].base_address,
-			pci_mmcfg_config[0].base_address + MMCONFIG_APER_MIN,
-			E820_RESERVED)) {
-		printk(KERN_ERR "PCI: BIOS Bug: MCFG area at %x is not E820-reserved\n",
-				pci_mmcfg_config[0].base_address);
-		printk(KERN_ERR "PCI: Not using MMCONFIG.\n");
-		return;
+ 	if (!pci_mmcfg_force()) {
+		if (!e820_all_mapped(pci_mmcfg_config[0].base_address,
+				pci_mmcfg_config[0].base_address + MMCONFIG_APER_MIN,
+				E820_RESERVED)) {
+			printk(KERN_ERR "PCI: BIOS Bug: MCFG area at %x is not E820-reserved\n",
+					pci_mmcfg_config[0].base_address);
+			printk(KERN_ERR "PCI: Not using MMCONFIG.\n");
+			return;
+		}
 	}
 
 	printk(KERN_INFO "PCI: Using MMCONFIG\n");



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

* Re: [PATCH 2/3] add-force-of-use-mmconfig.patch
  2006-07-31  8:28 [PATCH 2/3] add-force-of-use-mmconfig.patch Edgar Hucek
@ 2006-08-01  5:18 ` Andrew Morton
  2006-08-01  5:26   ` Edgar Hucek
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2006-08-01  5:18 UTC (permalink / raw)
  To: Edgar Hucek; +Cc: linux-kernel, torvalds

On Mon, 31 Jul 2006 10:28:14 +0200
Edgar Hucek <hostmaster@ed-soft.at> wrote:

> This Patch add force for mmconfig. On Intel Macs the efi firmaware gives
> a different memory map then ACPI_MCFG provides. This makes the check wether
> to use mmconfig or not fail.

Sorry, you cannot do this.  I already merged this patch into -mm, and
followed that up with two bugfix patches, both of which you were copied on.

Now you're sending out the original patch, without the bugfixes which
Adrian and I prepared.

If you think these patches should be merged into 2.6.18 at this late a
stage, please give reasons and if they're agreeable I can send it all to
Linus.  But sending out known-buggy stuff which has already been fixed
doesn't help anyone.

Also, please don't use filenames as patch descriptions.  See section 2 of
http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt.

Thanks.

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

* Re: [PATCH 2/3] add-force-of-use-mmconfig.patch
  2006-08-01  5:18 ` Andrew Morton
@ 2006-08-01  5:26   ` Edgar Hucek
  2006-08-01  5:46     ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Edgar Hucek @ 2006-08-01  5:26 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, torvalds

Andrew Morton schrieb:
> On Mon, 31 Jul 2006 10:28:14 +0200
> Edgar Hucek <hostmaster@ed-soft.at> wrote:
> 
>> This Patch add force for mmconfig. On Intel Macs the efi firmaware gives
>> a different memory map then ACPI_MCFG provides. This makes the check wether
>> to use mmconfig or not fail.
> 
> Sorry, you cannot do this.  I already merged this patch into -mm, and
> followed that up with two bugfix patches, both of which you were copied on.
> 
> Now you're sending out the original patch, without the bugfixes which
> Adrian and I prepared.
> 
> If you think these patches should be merged into 2.6.18 at this late a
> stage, please give reasons and if they're agreeable I can send it all to
> Linus.  But sending out known-buggy stuff which has already been fixed
> doesn't help anyone.
> 
> Also, please don't use filenames as patch descriptions.  See section 2 of
> http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt.
> 
> Thanks.
> 

I see only one bugfix patch in your patches ( add-force-of-use-mmconfig-fix.patch )
which is now included in this patch.

cu

ED.

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

* Re: [PATCH 2/3] add-force-of-use-mmconfig.patch
  2006-08-01  5:26   ` Edgar Hucek
@ 2006-08-01  5:46     ` Andrew Morton
  2006-08-01  7:06       ` Edgar Hucek
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2006-08-01  5:46 UTC (permalink / raw)
  To: Edgar Hucek; +Cc: linux-kernel, torvalds

On Tue, 01 Aug 2006 07:26:15 +0200
Edgar Hucek <hostmaster@ed-soft.at> wrote:

> Andrew Morton schrieb:
> > On Mon, 31 Jul 2006 10:28:14 +0200
> > Edgar Hucek <hostmaster@ed-soft.at> wrote:
> > 
> >> This Patch add force for mmconfig. On Intel Macs the efi firmaware gives
> >> a different memory map then ACPI_MCFG provides. This makes the check wether
> >> to use mmconfig or not fail.
> > 
> > Sorry, you cannot do this.  I already merged this patch into -mm, and
> > followed that up with two bugfix patches, both of which you were copied on.
> > 
> > Now you're sending out the original patch, without the bugfixes which
> > Adrian and I prepared.
> > 
> > If you think these patches should be merged into 2.6.18 at this late a
> > stage, please give reasons and if they're agreeable I can send it all to
> > Linus.  But sending out known-buggy stuff which has already been fixed
> > doesn't help anyone.
> > 
> > Also, please don't use filenames as patch descriptions.  See section 2 of
> > http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt.
> > 
> > Thanks.
> > 
> 
> I see only one bugfix patch in your patches ( add-force-of-use-mmconfig-fix.patch )
> which is now included in this patch.
> 

I presently have

add-force-of-use-mmconfig.patch
add-force-of-use-mmconfig-fix.patch
add-force-of-use-mmconfig-fix-2.patch

and

add-efi-e820-memory-mapping-on-x86.patch
add-efi-e820-memory-mapping-on-x86-tidy.patch
add-efi-e820-memory-mapping-on-x86-fix.patch
add-efi-e820-memory-mapping-on-x86-fix-2.patch

all of which you should have been cc'ed on.

Anyway, unless there's a rush on this work, please check that everything
looks OK in -mm as we head into 2.6.19-rc1.

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

* Re: [PATCH 2/3] add-force-of-use-mmconfig.patch
  2006-08-01  5:46     ` Andrew Morton
@ 2006-08-01  7:06       ` Edgar Hucek
  0 siblings, 0 replies; 5+ messages in thread
From: Edgar Hucek @ 2006-08-01  7:06 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, torvalds

Andrew Morton schrieb:
> On Tue, 01 Aug 2006 07:26:15 +0200
> Edgar Hucek <hostmaster@ed-soft.at> wrote:
> 
>> Andrew Morton schrieb:
>>> On Mon, 31 Jul 2006 10:28:14 +0200
>>> Edgar Hucek <hostmaster@ed-soft.at> wrote:
>>>
>>>> This Patch add force for mmconfig. On Intel Macs the efi firmaware gives
>>>> a different memory map then ACPI_MCFG provides. This makes the check wether
>>>> to use mmconfig or not fail.
>>> Sorry, you cannot do this.  I already merged this patch into -mm, and
>>> followed that up with two bugfix patches, both of which you were copied on.
>>>
>>> Now you're sending out the original patch, without the bugfixes which
>>> Adrian and I prepared.
>>>
>>> If you think these patches should be merged into 2.6.18 at this late a
>>> stage, please give reasons and if they're agreeable I can send it all to
>>> Linus.  But sending out known-buggy stuff which has already been fixed
>>> doesn't help anyone.
>>>
>>> Also, please don't use filenames as patch descriptions.  See section 2 of
>>> http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt.
>>>
>>> Thanks.
>>>
>> I see only one bugfix patch in your patches ( add-force-of-use-mmconfig-fix.patch )
>> which is now included in this patch.
>>
> 
> I presently have
> 
> add-force-of-use-mmconfig.patch
> add-force-of-use-mmconfig-fix.patch
> add-force-of-use-mmconfig-fix-2.patch
> 
> and
> 
> add-efi-e820-memory-mapping-on-x86.patch
> add-efi-e820-memory-mapping-on-x86-tidy.patch
> add-efi-e820-memory-mapping-on-x86-fix.patch
> add-efi-e820-memory-mapping-on-x86-fix-2.patch
> 
> all of which you should have been cc'ed on.
> 
> Anyway, unless there's a rush on this work, please check that everything
> looks OK in -mm as we head into 2.6.19-rc1.
> 

Mea culpa. Looked at the wrong place. I checked the patches in mm and they look ok.

cu

Edgar Hucek


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

end of thread, other threads:[~2006-08-01  7:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-31  8:28 [PATCH 2/3] add-force-of-use-mmconfig.patch Edgar Hucek
2006-08-01  5:18 ` Andrew Morton
2006-08-01  5:26   ` Edgar Hucek
2006-08-01  5:46     ` Andrew Morton
2006-08-01  7:06       ` Edgar Hucek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox