aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Kaindl <bk@suse.de>2006-02-18 04:36:55 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-03-23 17:35:14 -0500
commit8c4b2cf9af9b4ecc29d4f0ec4ecc8e94dc4432d7 (patch)
tree4f8e56e9012847aa4dfe4ec2c59f4d8b2714f2b2
parenta0454b40ee8fac03194bb71f01730266506e75e1 (diff)
[PATCH] PCI: PCI/Cardbus cards hidden, needs pci=assign-busses to fix
"In some cases, especially on modern laptops with a lot of PCI and cardbus bridges, we're unable to assign correct secondary/subordinate bus numbers to all cardbus bridges due to BIOS limitations unless we are using "pci=assign-busses" boot option." -- Ivan Kokshaysky (from a patch comment) Without it, Cardbus cards inserted are never seen by PCI because the parent PCI-PCI Bridge of the Cardbus bridge will not pass and translate Type 1 PCI configuration cycles correctly and the system will fail to find and initialise the PCI devices in the system. Reference: PCI-PCI Bridges: PCI Configuration Cycles and PCI Bus Numbering: http://www.science.unitn.it/~fiorella/guidelinux/tlk/node72.html The reason for this is that: ``All PCI busses located behind a PCI-PCI bridge must reside between the secondary bus number and the subordinate bus number (inclusive).'' "pci=assign-busses" makes pcibios_assign_all_busses return 1 and this turns on PCI renumbering during PCI probing. Alan suggested to use DMI automatically set assign-busses on problem systems. The only question for me was where to put it. I put it directly before scanning PCI bus into pcibios_scan_root() because it's called from legacy, acpi and numa and so it can be one place for all systems and configurations which may need it. AMD64 Laptops are also affected and fixed by assign-busses, and the code is also incuded from arch/x86_64/pci/ that place will also work for x86_64 kernels, I only ifdef'-ed the x86-only Laptop in this example. Affected and known or assumed to be fixed with it are (found by googling): * ASUS Z71V and L3s * Samsung X20 * Compaq R3140us and all Compaq R3000 series laptops with TI1620 Controller, also Compaq R4000 series (from a kernel.org bugreport) * HP zv5000z (AMD64 3700+, known that fixup_parent_subordinate_busnr fixes it) * HP zv5200z * IBM ThinkPad 240 * An IBM ThinkPad (1.8 GHz Pentium M) debugged by Pavel Machek gives the correspondig message which detects the possible problem. * MSI S260 / Medion SIM 2100 MD 95600 The patch also expands the "try pci=assign-busses" warning so testers will help us to update the DMI table. Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Dominik Brodowski <linux@dominikbrodowski.net> Cc: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--arch/i386/pci/common.c32
-rw-r--r--drivers/pci/probe.c4
2 files changed, 35 insertions, 1 deletions
diff --git a/arch/i386/pci/common.c b/arch/i386/pci/common.c
index f6bc48da4d2a..dbece776c5b2 100644
--- a/arch/i386/pci/common.c
+++ b/arch/i386/pci/common.c
@@ -8,6 +8,7 @@
8#include <linux/pci.h> 8#include <linux/pci.h>
9#include <linux/ioport.h> 9#include <linux/ioport.h>
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/dmi.h>
11 12
12#include <asm/acpi.h> 13#include <asm/acpi.h>
13#include <asm/segment.h> 14#include <asm/segment.h>
@@ -120,11 +121,42 @@ void __devinit pcibios_fixup_bus(struct pci_bus *b)
120 pci_read_bridge_bases(b); 121 pci_read_bridge_bases(b);
121} 122}
122 123
124/*
125 * Enable renumbering of PCI bus# ranges to reach all PCI busses (Cardbus)
126 */
127#ifdef __i386__
128static int __devinit assign_all_busses(struct dmi_system_id *d)
129{
130 pci_probe |= PCI_ASSIGN_ALL_BUSSES;
131 printk(KERN_INFO "%s detected: enabling PCI bus# renumbering"
132 " (pci=assign-busses)\n", d->ident);
133 return 0;
134}
135#endif
136
137/*
138 * Laptops which need pci=assign-busses to see Cardbus cards
139 */
140static struct dmi_system_id __devinitdata pciprobe_dmi_table[] = {
141#ifdef __i386__
142 {
143 .callback = assign_all_busses,
144 .ident = "Samsung X20 Laptop",
145 .matches = {
146 DMI_MATCH(DMI_SYS_VENDOR, "Samsung Electronics"),
147 DMI_MATCH(DMI_PRODUCT_NAME, "SX20S"),
148 },
149 },
150#endif /* __i386__ */
151 {}
152};
123 153
124struct pci_bus * __devinit pcibios_scan_root(int busnum) 154struct pci_bus * __devinit pcibios_scan_root(int busnum)
125{ 155{
126 struct pci_bus *bus = NULL; 156 struct pci_bus *bus = NULL;
127 157
158 dmi_check_system(pciprobe_dmi_table);
159
128 while ((bus = pci_find_next_bus(bus)) != NULL) { 160 while ((bus = pci_find_next_bus(bus)) != NULL) {
129 if (bus->number == busnum) { 161 if (bus->number == busnum) {
130 /* Already scanned */ 162 /* Already scanned */
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 542e7dfb371b..e3dc3063e05b 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -589,13 +589,15 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max
589 (child->number > bus->subordinate) || 589 (child->number > bus->subordinate) ||
590 (child->number < bus->number) || 590 (child->number < bus->number) ||
591 (child->subordinate < bus->number)) { 591 (child->subordinate < bus->number)) {
592 printk(KERN_WARNING "PCI: Bus #%02x (-#%02x) may be " 592 printk(KERN_WARNING "PCI: Bus #%02x (-#%02x) is "
593 "hidden behind%s bridge #%02x (-#%02x)%s\n", 593 "hidden behind%s bridge #%02x (-#%02x)%s\n",
594 child->number, child->subordinate, 594 child->number, child->subordinate,
595 bus->self->transparent ? " transparent" : " ", 595 bus->self->transparent ? " transparent" : " ",
596 bus->number, bus->subordinate, 596 bus->number, bus->subordinate,
597 pcibios_assign_all_busses() ? " " : 597 pcibios_assign_all_busses() ? " " :
598 " (try 'pci=assign-busses')"); 598 " (try 'pci=assign-busses')");
599 printk(KERN_WARNING "Please report the result to "
600 "linux-kernel to fix this permanently\n");
599 } 601 }
600 bus = bus->parent; 602 bus = bus->parent;
601 } 603 }