Subject: [PATCH 0/5] x86/pci: patches for tip/x86/unify-pci

This patch series contains patches for tip/x86/unify-pci. It fixes
NUMA initialization code reflecting latest changes in tip/master. Also
there are build fixes and minor cleanups. Patch #5 is a cherry pick
that fixes build on UP systems. Code reboots for smp/nosmp,
acpi/noacpi, numaq, 32/64bit. It compiles for visws.



Subject: [PATCH 1/5] x86/pci: Fix build error for X86_VISWS

Signed-off-by: Robert Richter <[email protected]>
---
arch/x86/Kconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index bb0c0d0..51329ee 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -283,7 +283,7 @@ config X86_VOYAGER

config X86_VISWS
bool "SGI 320/540 (Visual Workstation)"
- depends on X86_32 && !PCI
+ depends on X86_32 && PCI
help
The SGI Visual Workstation series is an IA32-based workstation
based on SGI systems chips with some legacy PC hardware attached.
--
1.5.5.4

Subject: [PATCH 2/5] x86/pci: Makefile merge: Changing 32bit ordering

This should be save since VISWS and NUMAQ exclud each other.

Signed-off-by: Robert Richter <[email protected]>
---
arch/x86/pci/Makefile | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/arch/x86/pci/Makefile b/arch/x86/pci/Makefile
index 99d9f09..2a08d2d 100644
--- a/arch/x86/pci/Makefile
+++ b/arch/x86/pci/Makefile
@@ -8,12 +8,11 @@ obj-$(CONFIG_PCI_OLPC) += olpc.o
pci-y := fixup.o
pci-$(CONFIG_ACPI) += acpi.o
pci-y += legacy.o irq.o
+pci-$(CONFIG_X86_NUMAQ) += numa.o

# Careful: VISWS overrule the pci-y above. The colons are
# therefor correct. This needs a proper fix by distangling the code.
pci-$(CONFIG_X86_VISWS) := visws.o fixup.o

-pci-$(CONFIG_X86_NUMAQ) += numa.o
-
obj-y += $(pci-y) common.o early.o
obj-y += amd_bus.o
--
1.5.5.4

Subject: [PATCH 5/5] x86: build fix for "x86: fix C1E && nx6325 stability problem"

From: Ingo Molnar <[email protected]>

fix:

arch/x86/kernel/built-in.o: In function `dmi_ignore_irq0_timer_override':
boot.c:(.init.text+0x3ea4): undefined reference to `force_mask_ioapic_irq_2'

Signed-off-by: Ingo Molnar <[email protected]>
---
include/asm-x86/genapic_32.h | 4 ++++
include/asm-x86/genapic_64.h | 4 ++++
2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/genapic_32.h b/include/asm-x86/genapic_32.h
index 8d4c8bd..33a73f5 100644
--- a/include/asm-x86/genapic_32.h
+++ b/include/asm-x86/genapic_32.h
@@ -119,6 +119,10 @@ enum uv_system_type {UV_NONE, UV_LEGACY_APIC, UV_X2APIC, UV_NON_UNIQUE_APIC};
#define is_uv_system() 0
#define uv_wakeup_secondary(a, b) 1

+#ifdef CONFIG_X86_IO_APIC
extern void force_mask_ioapic_irq_2(void);
+#else
+static inline void force_mask_ioapic_irq_2(void) { }
+#endif

#endif
diff --git a/include/asm-x86/genapic_64.h b/include/asm-x86/genapic_64.h
index 082ad02..647e4e5 100644
--- a/include/asm-x86/genapic_64.h
+++ b/include/asm-x86/genapic_64.h
@@ -46,6 +46,10 @@ extern int uv_wakeup_secondary(int phys_apicid, unsigned int start_rip);

extern void setup_apic_routing(void);

+#ifdef CONFIG_X86_IO_APIC
extern void force_mask_ioapic_irq_2(void);
+#else
+static inline void force_mask_ioapic_irq_2(void) { }
+#endif

#endif
--
1.5.5.4

Subject: [PATCH 4/5] x86/pci: Fix warnings in subsys_initcall functions

Signed-off-by: Robert Richter <[email protected]>
---
arch/x86/pci/legacy.c | 2 ++
arch/x86/pci/visws.c | 2 ++
2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/x86/pci/legacy.c b/arch/x86/pci/legacy.c
index d8b6e92..132876c 100644
--- a/arch/x86/pci/legacy.c
+++ b/arch/x86/pci/legacy.c
@@ -66,5 +66,7 @@ int __init pci_subsys_init(void)
pci_numa_init();
#endif
pcibios_init();
+
+ return 0;
}
subsys_initcall(pci_subsys_init);
diff --git a/arch/x86/pci/visws.c b/arch/x86/pci/visws.c
index 16e5206..852998b 100644
--- a/arch/x86/pci/visws.c
+++ b/arch/x86/pci/visws.c
@@ -109,5 +109,7 @@ static __init int pci_subsys_init(void)
{
pci_visws_init();
pcibios_init();
+
+ return 0;
}
subsys_initcall(pci_subsys_init);
--
1.5.5.4

Subject: [PATCH 3/5] x86/pci merge: Fixing numaq initialization

Patch d49c4288 (tip/x86/mpparse) introduced some changes in calling
subsys_init calls if CONFIG_X86_NUMAQ option is set. This patch
updates subsystem initalization according to this changes.

Signed-off-by: Robert Richter <[email protected]>
---
arch/x86/pci/legacy.c | 3 +++
arch/x86/pci/numa.c | 10 +---------
arch/x86/pci/pci.h | 1 +
3 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/arch/x86/pci/legacy.c b/arch/x86/pci/legacy.c
index 3c1d795..d8b6e92 100644
--- a/arch/x86/pci/legacy.c
+++ b/arch/x86/pci/legacy.c
@@ -62,6 +62,9 @@ int __init pci_subsys_init(void)
#endif
pci_legacy_init();
pcibios_irq_init();
+#ifdef CONFIG_X86_NUMAQ
+ pci_numa_init();
+#endif
pcibios_init();
}
subsys_initcall(pci_subsys_init);
diff --git a/arch/x86/pci/numa.c b/arch/x86/pci/numa.c
index e1620dc..8b5ca19 100644
--- a/arch/x86/pci/numa.c
+++ b/arch/x86/pci/numa.c
@@ -151,7 +151,7 @@ static void __devinit pci_fixup_i450nx(struct pci_dev *d)
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82451NX, pci_fixup_i450nx);

-static int __init pci_numa_init(void)
+int __init pci_numa_init(void)
{
int quad;

@@ -176,11 +176,3 @@ static int __init pci_numa_init(void)
}
return 0;
}
-
-static __init int pci_subsys_init(void)
-{
- pci_numa_init();
- pcibios_irq_init();
- pcibios_init();
-}
-subsys_initcall(pci_subsys_init);
diff --git a/arch/x86/pci/pci.h b/arch/x86/pci/pci.h
index 5824174..b2270a5 100644
--- a/arch/x86/pci/pci.h
+++ b/arch/x86/pci/pci.h
@@ -107,6 +107,7 @@ extern void __init dmi_check_skip_isa_align(void);
/* some common used subsys_initcalls */
extern int __init pci_acpi_init(void);
extern int __init pcibios_irq_init(void);
+extern int __init pci_numa_init(void);
extern int __init pcibios_init(void);

/* pci-mmconfig.c */
--
1.5.5.4

2008-07-10 17:17:44

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH 0/5] x86/pci: patches for tip/x86/unify-pci


* Robert Richter <[email protected]> wrote:

> This patch series contains patches for tip/x86/unify-pci. It fixes
> NUMA initialization code reflecting latest changes in tip/master. Also
> there are build fixes and minor cleanups. Patch #5 is a cherry pick
> that fixes build on UP systems. Code reboots for smp/nosmp,
> acpi/noacpi, numaq, 32/64bit. It compiles for visws.

thanks Robert. Today i've eliminated the VISWS subarch which greatly
simplified your series. I've picked up these two fixes:

Robert Richter (2):
x86/pci merge: fixing numaq initialization
x86/pci: fix warnings in subsys_initcall functions

the others were moot i think.

Please check the tip/x86/generalize-visws, i just pushed them all out.

Ingo

2008-07-10 17:51:28

by Yinghai Lu

[permalink] [raw]
Subject: Re: [PATCH 3/5] x86/pci merge: Fixing numaq initialization

On Thu, Jul 10, 2008 at 9:58 AM, Robert Richter <[email protected]> wrote:
> Patch d49c4288 (tip/x86/mpparse) introduced some changes in calling
> subsys_init calls if CONFIG_X86_NUMAQ option is set. This patch
> updates subsystem initalization according to this changes.
>
> Signed-off-by: Robert Richter <[email protected]>
> ---
> arch/x86/pci/legacy.c | 3 +++
> arch/x86/pci/numa.c | 10 +---------
> arch/x86/pci/pci.h | 1 +
> 3 files changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/arch/x86/pci/legacy.c b/arch/x86/pci/legacy.c
> index 3c1d795..d8b6e92 100644
> --- a/arch/x86/pci/legacy.c
> +++ b/arch/x86/pci/legacy.c
> @@ -62,6 +62,9 @@ int __init pci_subsys_init(void)
> #endif
> pci_legacy_init();
> pcibios_irq_init();
> +#ifdef CONFIG_X86_NUMAQ
> + pci_numa_init();
> +#endif
> pcibios_init();
> }

please change sequence to

+#ifdef CONFIG_X86_NUMAQ
+ pci_numa_init();
+#endif
#ifdef CONFIG_ACPI
pci_acpi_init();
#endif
pci_legacy_init();

YH

2008-07-10 18:12:54

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH 0/5] x86/pci: patches for tip/x86/unify-pci


* Ingo Molnar <[email protected]> wrote:

> * Robert Richter <[email protected]> wrote:
>
> > This patch series contains patches for tip/x86/unify-pci. It fixes
> > NUMA initialization code reflecting latest changes in tip/master.
> > Also there are build fixes and minor cleanups. Patch #5 is a cherry
> > pick that fixes build on UP systems. Code reboots for smp/nosmp,
> > acpi/noacpi, numaq, 32/64bit. It compiles for visws.
>
> thanks Robert. Today i've eliminated the VISWS subarch which greatly
> simplified your series. I've picked up these two fixes:
>
> Robert Richter (2):
> x86/pci merge: fixing numaq initialization
> x86/pci: fix warnings in subsys_initcall functions

btw., this is how arch/x86/pci/Makefile looks like now in tip/master:

----------------------------------------->
pci-y := fixup.o
pci-$(CONFIG_ACPI) += acpi.o
pci-y += legacy.o irq.o

pci-$(CONFIG_X86_VISWS) += visws.o

pci-$(CONFIG_X86_NUMAQ) += numa.o

obj-y += $(pci-y) common.o early.o
obj-y += amd_bus.o
<-----------------------------------------

it's _really_ clean now, and we dont have those weird overrides anymore.
Both VisWS and NUMAQ are now two straightforward runtime PCI overrides -
not build-time complications. Much more maintainable i think.

Ingo

2008-07-10 19:52:16

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [PATCH 0/5] x86/pci: patches for tip/x86/unify-pci

On Thu, Jul 10, 2008 at 08:12:34PM +0200, Ingo Molnar wrote:
>
> * Ingo Molnar <[email protected]> wrote:
>
> > * Robert Richter <[email protected]> wrote:
> >
> > > This patch series contains patches for tip/x86/unify-pci. It fixes
> > > NUMA initialization code reflecting latest changes in tip/master.
> > > Also there are build fixes and minor cleanups. Patch #5 is a cherry
> > > pick that fixes build on UP systems. Code reboots for smp/nosmp,
> > > acpi/noacpi, numaq, 32/64bit. It compiles for visws.
> >
> > thanks Robert. Today i've eliminated the VISWS subarch which greatly
> > simplified your series. I've picked up these two fixes:
> >
> > Robert Richter (2):
> > x86/pci merge: fixing numaq initialization
> > x86/pci: fix warnings in subsys_initcall functions
>
> btw., this is how arch/x86/pci/Makefile looks like now in tip/master:
>
> ----------------------------------------->
> pci-y := fixup.o
> pci-$(CONFIG_ACPI) += acpi.o
> pci-y += legacy.o irq.o
>
> pci-$(CONFIG_X86_VISWS) += visws.o
>
> pci-$(CONFIG_X86_NUMAQ) += numa.o
>
> obj-y += $(pci-y) common.o early.o
> obj-y += amd_bus.o
> <-----------------------------------------

So if I am not mistaken you can kill pci-y entirely:

obj-y := fixup.o
obj-$(CONFIG_ACPI) += acpi.o
obj-y += legacy.o irq.o

obj-$(CONFIG_X86_VISWS) += visws.o

obj-$(CONFIG_X86_NUMAQ) += numa.o

obj-y += common.o early.o
obj-y += amd_bus.o

Sam

2008-07-10 19:54:48

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH 0/5] x86/pci: patches for tip/x86/unify-pci


* Sam Ravnborg <[email protected]> wrote:

> On Thu, Jul 10, 2008 at 08:12:34PM +0200, Ingo Molnar wrote:
> >
> > * Ingo Molnar <[email protected]> wrote:
> >
> > > * Robert Richter <[email protected]> wrote:
> > >
> > > > This patch series contains patches for tip/x86/unify-pci. It fixes
> > > > NUMA initialization code reflecting latest changes in tip/master.
> > > > Also there are build fixes and minor cleanups. Patch #5 is a cherry
> > > > pick that fixes build on UP systems. Code reboots for smp/nosmp,
> > > > acpi/noacpi, numaq, 32/64bit. It compiles for visws.
> > >
> > > thanks Robert. Today i've eliminated the VISWS subarch which greatly
> > > simplified your series. I've picked up these two fixes:
> > >
> > > Robert Richter (2):
> > > x86/pci merge: fixing numaq initialization
> > > x86/pci: fix warnings in subsys_initcall functions
> >
> > btw., this is how arch/x86/pci/Makefile looks like now in tip/master:
> >
> > ----------------------------------------->
> > pci-y := fixup.o
> > pci-$(CONFIG_ACPI) += acpi.o
> > pci-y += legacy.o irq.o
> >
> > pci-$(CONFIG_X86_VISWS) += visws.o
> >
> > pci-$(CONFIG_X86_NUMAQ) += numa.o
> >
> > obj-y += $(pci-y) common.o early.o
> > obj-y += amd_bus.o
> > <-----------------------------------------
>
> So if I am not mistaken you can kill pci-y entirely:
>
> obj-y := fixup.o
> obj-$(CONFIG_ACPI) += acpi.o
> obj-y += legacy.o irq.o
>
> obj-$(CONFIG_X86_VISWS) += visws.o
>
> obj-$(CONFIG_X86_NUMAQ) += numa.o
>
> obj-y += common.o early.o
> obj-y += amd_bus.o

ah, indeed :-) Very nice.

Ingo

Subject: Re: [PATCH 0/5] x86/pci: patches for tip/x86/unify-pci

On 10.07.08 21:54:25, Ingo Molnar wrote:
>
> * Sam Ravnborg <[email protected]> wrote:
>
> > On Thu, Jul 10, 2008 at 08:12:34PM +0200, Ingo Molnar wrote:
> > >
> > > * Ingo Molnar <[email protected]> wrote:
> > >
> > > > * Robert Richter <[email protected]> wrote:
> > > >
> > > > > This patch series contains patches for tip/x86/unify-pci. It fixes
> > > > > NUMA initialization code reflecting latest changes in tip/master.
> > > > > Also there are build fixes and minor cleanups. Patch #5 is a cherry
> > > > > pick that fixes build on UP systems. Code reboots for smp/nosmp,
> > > > > acpi/noacpi, numaq, 32/64bit. It compiles for visws.
> > > >
> > > > thanks Robert. Today i've eliminated the VISWS subarch which greatly
> > > > simplified your series. I've picked up these two fixes:
> > > >
> > > > Robert Richter (2):
> > > > x86/pci merge: fixing numaq initialization
> > > > x86/pci: fix warnings in subsys_initcall functions
> > >
> > > btw., this is how arch/x86/pci/Makefile looks like now in tip/master:
> > >
> > > ----------------------------------------->
> > > pci-y := fixup.o
> > > pci-$(CONFIG_ACPI) += acpi.o
> > > pci-y += legacy.o irq.o
> > >
> > > pci-$(CONFIG_X86_VISWS) += visws.o
> > >
> > > pci-$(CONFIG_X86_NUMAQ) += numa.o
> > >
> > > obj-y += $(pci-y) common.o early.o
> > > obj-y += amd_bus.o
> > > <-----------------------------------------
> >
> > So if I am not mistaken you can kill pci-y entirely:

Yes, but...

> >
> > obj-y := fixup.o

... this is with a plus:

obj-y += fixup.o

> > obj-$(CONFIG_ACPI) += acpi.o
> > obj-y += legacy.o irq.o
> >
> > obj-$(CONFIG_X86_VISWS) += visws.o
> >
> > obj-$(CONFIG_X86_NUMAQ) += numa.o
> >
> > obj-y += common.o early.o
> > obj-y += amd_bus.o
>
> ah, indeed :-) Very nice.
>
> Ingo
>

--
Advanced Micro Devices, Inc.
Operating System Research Center
email: [email protected]

Subject: Re: [PATCH 0/5] x86/pci: patches for tip/x86/unify-pci

On 10.07.08 20:12:34, Ingo Molnar wrote:
>
> * Ingo Molnar <[email protected]> wrote:
>
> > * Robert Richter <[email protected]> wrote:
> >
> > > This patch series contains patches for tip/x86/unify-pci. It fixes
> > > NUMA initialization code reflecting latest changes in tip/master.
> > > Also there are build fixes and minor cleanups. Patch #5 is a cherry
> > > pick that fixes build on UP systems. Code reboots for smp/nosmp,
> > > acpi/noacpi, numaq, 32/64bit. It compiles for visws.
> >
> > thanks Robert. Today i've eliminated the VISWS subarch which greatly
> > simplified your series. I've picked up these two fixes:
> >
> > Robert Richter (2):
> > x86/pci merge: fixing numaq initialization
> > x86/pci: fix warnings in subsys_initcall functions
>
> btw., this is how arch/x86/pci/Makefile looks like now in tip/master:
>
> ----------------------------------------->
> pci-y := fixup.o
> pci-$(CONFIG_ACPI) += acpi.o
> pci-y += legacy.o irq.o
>
> pci-$(CONFIG_X86_VISWS) += visws.o
>
> pci-$(CONFIG_X86_NUMAQ) += numa.o
>
> obj-y += $(pci-y) common.o early.o
> obj-y += amd_bus.o
> <-----------------------------------------
>
> it's _really_ clean now, and we dont have those weird overrides anymore.
> Both VisWS and NUMAQ are now two straightforward runtime PCI overrides -
> not build-time complications. Much more maintainable i think.

Yes, it really looks nice now.

-Robert

--
Advanced Micro Devices, Inc.
Operating System Research Center
email: [email protected]

2008-07-11 10:21:25

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [PATCH 0/5] x86/pci: patches for tip/x86/unify-pci

> > >
> > > So if I am not mistaken you can kill pci-y entirely:
>
> Yes, but...
>
> > >
> > > obj-y := fixup.o
>
> ... this is with a plus:
>
> obj-y += fixup.o

obj-y is empty when you enter the Makefile.
So if you start out with ':=' or '+=' is no difference.

Sam

2008-07-11 10:23:36

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH 0/5] x86/pci: patches for tip/x86/unify-pci


* Sam Ravnborg <[email protected]> wrote:

> > > >
> > > > So if I am not mistaken you can kill pci-y entirely:
> >
> > Yes, but...
> >
> > > >
> > > > obj-y := fixup.o
> >
> > ... this is with a plus:
> >
> > obj-y += fixup.o
>
> obj-y is empty when you enter the Makefile.
> So if you start out with ':=' or '+=' is no difference.

i guess it's safer to use +=, because it's ordering invariant.

We should use := only if we absolutely want to override the current
rules.

Ingo

2008-07-11 10:28:07

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [PATCH 0/5] x86/pci: patches for tip/x86/unify-pci

> >
> > obj-y is empty when you enter the Makefile.
> > So if you start out with ':=' or '+=' is no difference.
>
> i guess it's safer to use +=, because it's ordering invariant.
>
> We should use := only if we absolutely want to override the current
> rules.

In the past I was carefully to use ':=' for the first assignmnet so the
variable was a " simply expanded variables" variable.
But as I have added a 'obj-y := ' in kbuild we should
be safe.

" simply expanded variables" is some special make stuff.

A typical:

FOO = bar

is a "recursively expanded variable".
Here the assingment is evaluated on each usage.

Sam