linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/pci: add pci=skip_isa_align command lines.
@ 2008-03-27  8:31 Yinghai Lu
  2008-03-27  8:45 ` Ingo Molnar
  0 siblings, 1 reply; 7+ messages in thread
From: Yinghai Lu @ 2008-03-27  8:31 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Andrew Morton,
	Gary Hade, Greg Kroah-Hartman
  Cc: kernel list

[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 <yhlu.kernel@gmail.com>

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;

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

* Re: [PATCH] x86/pci: add pci=skip_isa_align command lines.
  2008-03-27  8:31 [PATCH] x86/pci: add pci=skip_isa_align command lines Yinghai Lu
@ 2008-03-27  8:45 ` Ingo Molnar
  2008-03-27 16:10   ` Yinghai Lu
  2008-03-27 17:59   ` Gary Hade
  0 siblings, 2 replies; 7+ messages in thread
From: Ingo Molnar @ 2008-03-27  8:45 UTC (permalink / raw)
  To: yhlu.kernel
  Cc: Thomas Gleixner, H. Peter Anvin, Andrew Morton, Gary Hade,
	Greg Kroah-Hartman, kernel list


* Yinghai Lu <yhlu.kernel.send@gmail.com> 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

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

* Re: [PATCH] x86/pci: add pci=skip_isa_align command lines.
  2008-03-27  8:45 ` Ingo Molnar
@ 2008-03-27 16:10   ` Yinghai Lu
  2008-03-27 17:59   ` Gary Hade
  1 sibling, 0 replies; 7+ messages in thread
From: Yinghai Lu @ 2008-03-27 16:10 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Thomas Gleixner, H. Peter Anvin, Andrew Morton, Gary Hade,
	Greg Kroah-Hartman, kernel list

On Thu, Mar 27, 2008 at 1:45 AM, Ingo Molnar <mingo@elte.hu> wrote:
>
>  * Yinghai Lu <yhlu.kernel.send@gmail.com> 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

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

* Re: [PATCH] x86/pci: add pci=skip_isa_align command lines.
  2008-03-27  8:45 ` Ingo Molnar
  2008-03-27 16:10   ` Yinghai Lu
@ 2008-03-27 17:59   ` Gary Hade
  2008-03-27 18:07     ` Yinghai Lu
  1 sibling, 1 reply; 7+ messages in thread
From: Gary Hade @ 2008-03-27 17:59 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: yhlu.kernel, Thomas Gleixner, H. Peter Anvin, Andrew Morton,
	Gary Hade, Greg Kroah-Hartman, kernel list

On Thu, Mar 27, 2008 at 09:45:57AM +0100, Ingo Molnar wrote:
> 
> * Yinghai Lu <yhlu.kernel.send@gmail.com> 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
garyhade@us.ibm.com
http://www.ibm.com/linux/ltc

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

* Re: [PATCH] x86/pci: add pci=skip_isa_align command lines.
  2008-03-27 17:59   ` Gary Hade
@ 2008-03-27 18:07     ` Yinghai Lu
  2008-03-27 18:42       ` H. Peter Anvin
  2008-03-27 21:46       ` H. Peter Anvin
  0 siblings, 2 replies; 7+ messages in thread
From: Yinghai Lu @ 2008-03-27 18:07 UTC (permalink / raw)
  To: Gary Hade
  Cc: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Andrew Morton,
	Greg Kroah-Hartman, kernel list

On Thu, Mar 27, 2008 at 10:59 AM, Gary Hade <garyhade@us.ibm.com> wrote:
>
> On Thu, Mar 27, 2008 at 09:45:57AM +0100, Ingo Molnar wrote:
>  >
>  > * Yinghai Lu <yhlu.kernel.send@gmail.com> 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

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

* Re: [PATCH] x86/pci: add pci=skip_isa_align command lines.
  2008-03-27 18:07     ` Yinghai Lu
@ 2008-03-27 18:42       ` H. Peter Anvin
  2008-03-27 21:46       ` H. Peter Anvin
  1 sibling, 0 replies; 7+ messages in thread
From: H. Peter Anvin @ 2008-03-27 18:42 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Gary Hade, Ingo Molnar, Thomas Gleixner, Andrew Morton,
	Greg Kroah-Hartman, kernel list

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

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

* Re: [PATCH] x86/pci: add pci=skip_isa_align command lines.
  2008-03-27 18:07     ` Yinghai Lu
  2008-03-27 18:42       ` H. Peter Anvin
@ 2008-03-27 21:46       ` H. Peter Anvin
  1 sibling, 0 replies; 7+ messages in thread
From: H. Peter Anvin @ 2008-03-27 21:46 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Gary Hade, Ingo Molnar, Thomas Gleixner, Andrew Morton,
	Greg Kroah-Hartman, kernel list

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

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

end of thread, other threads:[~2008-03-27 21:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-27  8:31 [PATCH] x86/pci: add pci=skip_isa_align command lines Yinghai Lu
2008-03-27  8:45 ` Ingo Molnar
2008-03-27 16:10   ` Yinghai Lu
2008-03-27 17:59   ` Gary Hade
2008-03-27 18:07     ` Yinghai Lu
2008-03-27 18:42       ` H. Peter Anvin
2008-03-27 21:46       ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).