2008-03-27 08:29:28

by Yinghai Lu

[permalink] [raw]
Subject: [PATCH] x86/pci: add pci=skip_isa_align command lines.

[PATCH] x86/pci: add pci=skip_isa_align command lines.

so we don't align the io port start address for pci cards.

also move out dmi check out acpi.c, because it has nothing to do with acpi.
it could spare some calling when we have several peer root buses.

Signed-off-by: Yinghai Lu <[email protected]>

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 1970479..d25db3b 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1497,6 +1497,8 @@ and is between 256 and 4096 characters. It is defined in the file
This is normally done in pci_enable_device(),
so this option is a temporary workaround
for broken drivers that don't call it.
+ skip_isa_align [X86] do not align io start addr, so can
+ handle more pci cards
firmware [ARM] Do not re-enumerate the bus but instead
just use the configuration from the
bootloader. This is currently used on
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index b0e4369..850d721 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -6,45 +6,6 @@
#include <asm/numa.h>
#include "pci.h"

-static int __devinit can_skip_ioresource_align(const struct dmi_system_id *d)
-{
- pci_probe |= PCI_CAN_SKIP_ISA_ALIGN;
- printk(KERN_INFO "PCI: %s detected, can skip ISA alignment\n", d->ident);
- return 0;
-}
-
-static struct dmi_system_id acpi_pciprobe_dmi_table[] __devinitdata = {
-/*
- * Systems where PCI IO resource ISA alignment can be skipped
- * when the ISA enable bit in the bridge control is not set
- */
- {
- .callback = can_skip_ioresource_align,
- .ident = "IBM System x3800",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
- DMI_MATCH(DMI_PRODUCT_NAME, "x3800"),
- },
- },
- {
- .callback = can_skip_ioresource_align,
- .ident = "IBM System x3850",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
- DMI_MATCH(DMI_PRODUCT_NAME, "x3850"),
- },
- },
- {
- .callback = can_skip_ioresource_align,
- .ident = "IBM System x3950",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
- DMI_MATCH(DMI_PRODUCT_NAME, "x3950"),
- },
- },
- {}
-};
-
struct pci_root_info {
char *name;
unsigned int res_num;
@@ -196,8 +157,6 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int do
int pxm;
#endif

- dmi_check_system(acpi_pciprobe_dmi_table);
-
if (domain && !pci_domains_supported) {
printk(KERN_WARNING "PCI: Multiple domains not supported "
"(dom %d, bus %d)\n", domain, busnum);
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index ae1bf52..8045a4a 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -77,6 +77,50 @@ int pcibios_scanned;
*/
DEFINE_SPINLOCK(pci_config_lock);

+static int __devinit can_skip_ioresource_align(const struct dmi_system_id *d)
+{
+ pci_probe |= PCI_CAN_SKIP_ISA_ALIGN;
+ printk(KERN_INFO "PCI: %s detected, can skip ISA alignment\n", d->ident);
+ return 0;
+}
+
+static struct dmi_system_id can_skip_pciprobe_dmi_table[] __devinitdata = {
+/*
+ * Systems where PCI IO resource ISA alignment can be skipped
+ * when the ISA enable bit in the bridge control is not set
+ */
+ {
+ .callback = can_skip_ioresource_align,
+ .ident = "IBM System x3800",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "x3800"),
+ },
+ },
+ {
+ .callback = can_skip_ioresource_align,
+ .ident = "IBM System x3850",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "x3850"),
+ },
+ },
+ {
+ .callback = can_skip_ioresource_align,
+ .ident = "IBM System x3950",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "x3950"),
+ },
+ },
+ {}
+};
+
+void __init dmi_check_skip_isa_align(void)
+{
+ dmi_check_system(can_skip_pciprobe_dmi_table);
+}
+
/*
* Several buggy motherboards address only 16 devices and mirror
* them to next 16 IDs. We try to detect this `feature' on all
@@ -519,6 +563,9 @@ char * __devinit pcibios_setup(char *str)
} else if (!strcmp(str, "routeirq")) {
pci_routeirq = 1;
return NULL;
+ } else if (!strcmp(str, "skip_isa_align")) {
+ pci_probe |= PCI_CAN_SKIP_ISA_ALIGN;
+ return NULL;
}
return str;
}
diff --git a/arch/x86/pci/init.c b/arch/x86/pci/init.c
index 343c363..49bb1cf 100644
--- a/arch/x86/pci/init.c
+++ b/arch/x86/pci/init.c
@@ -29,6 +29,8 @@ static __init int pci_access_init(void)
printk(KERN_ERR
"PCI: Fatal: No config space access function found\n");

+ dmi_check_skip_isa_align();
+
return 0;
}
arch_initcall(pci_access_init);
diff --git a/arch/x86/pci/pci.h b/arch/x86/pci/pci.h
index c9fb637..d338935 100644
--- a/arch/x86/pci/pci.h
+++ b/arch/x86/pci/pci.h
@@ -39,6 +39,8 @@ enum pci_bf_sort_state {
pci_dmi_bf,
};

+extern void __init dmi_check_skip_isa_align(void);
+
/* pci-i386.c */

extern unsigned int pcibios_max_latency;


2008-03-27 08:46:23

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH] x86/pci: add pci=skip_isa_align command lines.


* Yinghai Lu <[email protected]> wrote:

> [PATCH] x86/pci: add pci=skip_isa_align command lines.
>
> so we don't align the io port start address for pci cards.
>
> also move out dmi check out acpi.c, because it has nothing to do with
> acpi. it could spare some calling when we have several peer root
> buses.

i like this feature, and i've applied your patch to x86.git for testing,
but i'd like to hear what the ACPI and PCI guys think about this.

Also, we should try as hard as possible to make it a blacklist instead
of a whitelist? It would be cool to support more PCI cards/devices on
all new(-ish) systems by default and if we didnt have to maintain the
DMI whitelist for eternity. (a whitelist will always be incomplete and
will lag behind reality)

Ingo

2008-03-27 16:10:49

by Yinghai Lu

[permalink] [raw]
Subject: Re: [PATCH] x86/pci: add pci=skip_isa_align command lines.

On Thu, Mar 27, 2008 at 1:45 AM, Ingo Molnar <[email protected]> wrote:
>
> * Yinghai Lu <[email protected]> wrote:
>
> > [PATCH] x86/pci: add pci=skip_isa_align command lines.
> >
> > so we don't align the io port start address for pci cards.
> >
> > also move out dmi check out acpi.c, because it has nothing to do with
> > acpi. it could spare some calling when we have several peer root
> > buses.
>
> i like this feature, and i've applied your patch to x86.git for testing,
> but i'd like to hear what the ACPI and PCI guys think about this.
>
> Also, we should try as hard as possible to make it a blacklist instead
> of a whitelist? It would be cool to support more PCI cards/devices on
> all new(-ish) systems by default and if we didnt have to maintain the
> DMI whitelist for eternity. (a whitelist will always be incomplete and
> will lag behind reality)

yeah, blacklist is more good. that limitation is quite old...

YH

2008-03-27 17:59:53

by Gary Hade

[permalink] [raw]
Subject: Re: [PATCH] x86/pci: add pci=skip_isa_align command lines.

On Thu, Mar 27, 2008 at 09:45:57AM +0100, Ingo Molnar wrote:
>
> * Yinghai Lu <[email protected]> wrote:
>
> > [PATCH] x86/pci: add pci=skip_isa_align command lines.
> >
> > so we don't align the io port start address for pci cards.
> >
> > also move out dmi check out acpi.c, because it has nothing to do with
> > acpi. it could spare some calling when we have several peer root
> > buses.
>
> i like this feature, and i've applied your patch to x86.git for testing,
> but i'd like to hear what the ACPI and PCI guys think about this.
>
> Also, we should try as hard as possible to make it a blacklist instead
> of a whitelist? It would be cool to support more PCI cards/devices on
> all new(-ish) systems by default and if we didnt have to maintain the
> DMI whitelist for eternity. (a whitelist will always be incomplete and
> will lag behind reality)

Ingo, This is a great idea. I was the guy that added the whitelist
and ISA alignment avoidance code but have also been concerned about
the headache of keeping whitelist current in mainline and Distro
releases as new systems are introduced. When I made the change I
assumed (appearently incorrectly) that there were way too many
existing systems requiring the alignment to even consider the
blacklist approach. Do you have any suggestions on how to identify
systems to include in the blacklist? ...or would we just boldly make
non-alignment the default, provide an empty blacklist, and let
breakage identify those systems that need to be blacklisted?

Thanks.

Gary

--
Gary Hade
System x Enablement
IBM Linux Technology Center
503-578-4503 IBM T/L: 775-4503
[email protected]
http://www.ibm.com/linux/ltc

2008-03-27 18:08:17

by Yinghai Lu

[permalink] [raw]
Subject: Re: [PATCH] x86/pci: add pci=skip_isa_align command lines.

On Thu, Mar 27, 2008 at 10:59 AM, Gary Hade <[email protected]> wrote:
>
> On Thu, Mar 27, 2008 at 09:45:57AM +0100, Ingo Molnar wrote:
> >
> > * Yinghai Lu <[email protected]> wrote:
> >
> > > [PATCH] x86/pci: add pci=skip_isa_align command lines.
> > >
> > > so we don't align the io port start address for pci cards.
> > >
> > > also move out dmi check out acpi.c, because it has nothing to do with
> > > acpi. it could spare some calling when we have several peer root
> > > buses.
> >
> > i like this feature, and i've applied your patch to x86.git for testing,
> > but i'd like to hear what the ACPI and PCI guys think about this.
> >
> > Also, we should try as hard as possible to make it a blacklist instead
> > of a whitelist? It would be cool to support more PCI cards/devices on
> > all new(-ish) systems by default and if we didnt have to maintain the
> > DMI whitelist for eternity. (a whitelist will always be incomplete and
> > will lag behind reality)
>
> Ingo, This is a great idea. I was the guy that added the whitelist
> and ISA alignment avoidance code but have also been concerned about
> the headache of keeping whitelist current in mainline and Distro
> releases as new systems are introduced. When I made the change I
> assumed (appearently incorrectly) that there were way too many
> existing systems requiring the alignment to even consider the
> blacklist approach. Do you have any suggestions on how to identify
> systems to include in the blacklist? ...or would we just boldly make
> non-alignment the default, provide an empty blacklist, and let
> breakage identify those systems that need to be blacklisted?

at least to use blacklist with x86_64

YH

2008-03-27 18:55:47

by H. Peter Anvin

[permalink] [raw]
Subject: Re: [PATCH] x86/pci: add pci=skip_isa_align command lines.

Yinghai Lu wrote:
>
> at least to use blacklist with x86_64
>

No, please. The last thing we need is an arbitrary behaviour difference
based on 32 vs 64 bits.

-hpa

2008-03-27 21:48:29

by H. Peter Anvin

[permalink] [raw]
Subject: Re: [PATCH] x86/pci: add pci=skip_isa_align command lines.

Yinghai Lu wrote:
>
> at least to use blacklist with x86_64
>

I propose that we should use a rule like:

if ( DMI_date >= cutoff && !(CONFIG_ISA_SLOTS && ISA slots in DMI) )

-hpa