Skip to contentSkip to conversation

fix x86 DMI checks for PCI quirks

PATCH In review Matt Domsch 4 participants 6 messages May 2, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix x86 DMI checks for PCI quirks

fix x86 DMI checks for PCI quirks

http://bugzilla.kernel.org/show_bug.cgi?id=10583
https://bugzilla.redhat.com/show_bug.cgi?id=444791

Since git commit 08f1c192c3c32797068bfe97738babb3295bbf42 (between kernels 2.6.22 and 2.6.23), arch/x86/pci/acpi.c has not called pcibios_scan_root(), which would have called arch/x86/pci/common.c:dmi_check_system(). This has prevented the quirks listed in pciprobe_dmi_table[] from being checked and appropriate action taken.

This manifests itself in several Dell and HP servers not automatically having the pci=bfsort option be applied, as well as Samsung X20 and Compaq EVO N800c systems needing pci=assign-all-busses was no longer automatically applied.

This patch moves the DMI tests into its own file, arch/x86/pci/dmi.c, and invokes them via subsys_initcall() before pci_acpi_init(), pci_legacy_init(), and pcibios_init() are called, which may rely upon these tests having been executed.

---
 arch/x86/pci/Makefile_32 |    1 +
 arch/x86/pci/Makefile_64 |    1 +
 arch/x86/pci/common.c    |  219 +--------------------------------------------
 arch/x86/pci/dmi.c       |  228 ++++++++++++++++++++++++++++++++++++++++++++++
 arch/x86/pci/pci.h       |    1 +
 5 files changed, 232 insertions(+), 218 deletions(-)
 create mode 100644 arch/x86/pci/dmi.c
arch/x86/pci/Makefile_32 +1 -0
index cdd6828..d5232ee 100644
@@ -5,6 +5,7 @@ obj-$(CONFIG_PCI_MMCONFIG)	+= mmconfig_32.o direct.o mmconfig-shared.o
 obj-$(CONFIG_PCI_DIRECT)	+= direct.o
 
 pci-y				:= fixup.o
+pci-y				+= dmi.o
 pci-$(CONFIG_ACPI)		+= acpi.o
 pci-y				+= legacy.o irq.o
 
arch/x86/pci/Makefile_64 +1 -0
index 7d8c467..654568f 100644
@@ -8,6 +8,7 @@ EXTRA_CFLAGS += -Iarch/x86/pci
 obj-y		:= i386.o
 obj-$(CONFIG_PCI_DIRECT)+= direct.o
 obj-y		+= fixup.o init.o
+obj-y			+= dmi.o
 obj-$(CONFIG_ACPI)	+= acpi.o
 obj-y			+= legacy.o irq.o common.o early.o
 # mmconfig has a 64bit special
arch/x86/pci/common.c +1 -218

243 lines not on this page · raw message

arch/x86/pci/dmi.c new file +228 -0

228 lines not on this page · raw message

arch/x86/pci/pci.h +1 -0
index 3431518..98fc872 100644
@@ -31,6 +31,7 @@
 
 extern unsigned int pci_probe;
 extern unsigned long pirq_table_addr;
+extern int pci_bf_sort;
 
 enum pci_bf_sort_state {
 	pci_bf_sort_default,
Signature · 7 lines
1.5.2.4


-- 
Matt Domsch
Linux Technology Strategist, Dell Office of the CTO
linux.dell.com & www.dell.com/linux
#1 lore raw
Quoted 11 lines · Matt Domsch

fix x86 DMI checks for PCI quirks

http://bugzilla.kernel.org/show_bug.cgi?id=10583
https://bugzilla.redhat.com/show_bug.cgi?id=444791

Since git commit 08f1c192c3c32797068bfe97738babb3295bbf42 (between kernels 2.6.22 and 2.6.23), arch/x86/pci/acpi.c has not called pcibios_scan_root(), which would have called arch/x86/pci/common.c:dmi_check_system(). This has prevented the quirks listed in pciprobe_dmi_table[] from being checked and appropriate action taken.

ugh ...

Quoted 9 lines

This manifests itself in several Dell and HP servers not automatically having the pci=bfsort option be applied, as well as Samsung X20 and Compaq EVO N800c systems needing pci=assign-all-busses was no longer automatically applied.

This patch moves the DMI tests into its own file, arch/x86/pci/dmi.c, and invokes them via subsys_initcall() before pci_acpi_init(), pci_legacy_init(), and pcibios_init() are called, which may rely upon these tests having been executed.

Jesse Barnes (new PCI maintainer) Cc:-ed.

i'm wondering how we could avoid such mishaps in the future. This was broken from 2.6.23 through 2.6.25 - way too long. Perhaps we should create a known signature of the device tree in user-space, and somehow warn if the kernel changes it? Could this somehow be put into the kernel?

Ingo

#2 lore raw
Quoted 28 lines · Ingo Molnar
Quoted 11 lines · Matt Domsch

fix x86 DMI checks for PCI quirks

http://bugzilla.kernel.org/show_bug.cgi?id=10583
https://bugzilla.redhat.com/show_bug.cgi?id=444791

Since git commit 08f1c192c3c32797068bfe97738babb3295bbf42 (between kernels 2.6.22 and 2.6.23), arch/x86/pci/acpi.c has not called pcibios_scan_root(), which would have called arch/x86/pci/common.c:dmi_check_system(). This has prevented the quirks listed in pciprobe_dmi_table[] from being checked and appropriate action taken.

ugh ...

Quoted 9 lines

This manifests itself in several Dell and HP servers not automatically having the pci=bfsort option be applied, as well as Samsung X20 and Compaq EVO N800c systems needing pci=assign-all-busses was no longer automatically applied.

This patch moves the DMI tests into its own file, arch/x86/pci/dmi.c, and invokes them via subsys_initcall() before pci_acpi_init(), pci_legacy_init(), and pcibios_init() are called, which may rely upon these tests having been executed.

Quoted 8 lines

Jesse Barnes (new PCI maintainer) Cc:-ed.

i'm wondering how we could avoid such mishaps in the future. This was broken from 2.6.23 through 2.6.25 - way too long. Perhaps we should create a known signature of the device tree in user-space, and somehow warn if the kernel changes it? Could this somehow be put into the kernel?

please check the patch in x86.git, it should do the same thing, but put the call in pci_access_init...

commit 9817aa147000086bc11b571620ecc1c73a4a614b

Author: Yinghai Lu <[email protected]>
Date:   Mon Apr 14 15:40:37 2008 -0700

x86 PCI: call dmi_check_pciprobe()

this change:

| commit 08f1c192c3c32797068bfe97738babb3295bbf42 | Author: Muli Ben-Yehuda <[email protected]>
| Date: Sun Jul 22 00:23:39 2007 +0300
|
| x86-64: introduce struct pci_sysdata to facilitate sharing of ->sysdata
|
| This patch introduces struct pci_sysdata to x86 and x86-64, and
| converts the existing two users (NUMA, Calgary) to use it.
|
| This lays the groundwork for having other users of sysdata, such as
| the PCI domains work.
|
| The Calgary bits are tested, the NUMA bits just look ok.

replaces pcibios_scan_root with pci_scan_bus_parented...

but in pcibios_scan_root we have a DMI check:

dmi_check_system(pciprobe_dmi_table);

when when have several peer root buses this could be called multiple times (which is bad), so move that call to pci_access_init().

#3 lore raw
Quoted 23 lines · Yinghai Lu
Quoted 22 lines · Ingo Molnar
Quoted 11 lines · Matt Domsch

fix x86 DMI checks for PCI quirks

http://bugzilla.kernel.org/show_bug.cgi?id=10583
https://bugzilla.redhat.com/show_bug.cgi?id=444791

Since git commit 08f1c192c3c32797068bfe97738babb3295bbf42 (between kernels 2.6.22 and 2.6.23), arch/x86/pci/acpi.c has not called pcibios_scan_root(), which would have called arch/x86/pci/common.c:dmi_check_system(). This has prevented the quirks listed in pciprobe_dmi_table[] from being checked and appropriate action taken.

ugh ...

Quoted 4 lines

This manifests itself in several Dell and HP servers not automatically having the pci=bfsort option be applied, as well as Samsung X20 and Compaq EVO N800c systems needing pci=assign-all-busses was no longer automatically applied.

Quoted 8 lines
Quoted 1 line

Jesse Barnes (new PCI maintainer) Cc:-ed.

please check the patch in x86.git, it should do the same thing, but put the call in pci_access_init...

commit 9817aa147000086bc11b571620ecc1c73a4a614b

Author: Yinghai Lu <[email protected]>
Date:   Mon Apr 14 15:40:37 2008 -0700

Indeed it does (boot tested on one of the affected systems), and is a simpler patch. I'd be quite happy with this. Bonus that it's already in the x86.git tree. :-)

Ingo, is this ready to go to Linus?

Now to get it backported to -stable...

Adding the folks from HP who have lots of systems listed.

Thanks,
Matt

Signature · 3 lines
Matt Domsch
Linux Technology Strategist, Dell Office of the CTO
linux.dell.com & www.dell.com/linux
#4 lore raw
In reply to Matt Domsch
Quoted 5 lines · On Thu, 1 May 2008 21:54:27 -0500 Matt Domsch <[email protected]> wrote:

This patch moves the DMI tests into its own file, arch/x86/pci/dmi.c, and invokes them via subsys_initcall() before pci_acpi_init(), pci_legacy_init(), and pcibios_init() are called, which may rely upon these tests having been executed.

Hi,

can we name this file something with "quirks" in it (dmi_quirks.c or so)? At least I tend to look for files named like that when searching for places that do specific hardware/machine based workarounds...

Greetings,
Arjan van de Ven

#5 lore raw
Quoted 9 lines · Arjan van de Ven
Quoted 5 lines · On Thu, 1 May 2008 21:54:27 -0500 Matt Domsch <[email protected]> wrote:

This patch moves the DMI tests into its own file, arch/x86/pci/dmi.c, and invokes them via subsys_initcall() before pci_acpi_init(), pci_legacy_init(), and pcibios_init() are called, which may rely upon these tests having been executed.

Quoted 5 lines

Hi,

can we name this file something with "quirks" in it (dmi_quirks.c or so)? At least I tend to look for files named like that when searching for places that do specific hardware/machine based workarounds...

sure, the file name matters not much to me in this regard, and I can see your point.

Signature · 3 lines
Matt Domsch
Linux Technology Strategist, Dell Office of the CTO
linux.dell.com & www.dell.com/linux