* Re: [PATCH 1/6] Change RIO function mpc85xx_ to fsl_ .
From: Kumar Gala @ 2008-01-30 14:43 UTC (permalink / raw)
To: Zhang Wei; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <1201689053956-git-send-email-wei.zhang@freescale.com>
Can you post a device tree update as well.
The older patches on the list for the 86xx .dts should NOT put the rio
node under the soc. It should be at the same level as PCI.
- k
^ permalink raw reply
* Re: [patch v6 3/4] USB: add Cypress c67x00 OTG controller HCD driver
From: Alan Stern @ 2008-01-30 15:19 UTC (permalink / raw)
To: Peter Korsgaard; +Cc: linuxppc-dev, dbrownell, USB list
In-Reply-To: <87r6fzd5bm.fsf@macbook.be.48ers.dk>
On Wed, 30 Jan 2008, Peter Korsgaard wrote:
> >> +static void c67x00_sched_done(unsigned long __c67x00)
> >> +{
> >> + struct c67x00_hcd *c67x00 = (struct c67x00_hcd *)__c67x00;
> >> + struct c67x00_urb_priv *urbp, *tmp;
> >> + struct urb *urb;
> >> +
> >> + spin_lock(&c67x00->lock);
> >> +
> >> + /* Loop over the done list and give back all the urbs */
> >> + list_for_each_entry_safe(urbp, tmp, &c67x00->done_list, hep_node) {
> >> + urb = urbp->urb;
> >> + c67x00_release_urb(c67x00, urb);
> >> + if (!usb_hcd_check_unlink_urb(c67x00_hcd_to_hcd(c67x00),
> >> + urb, urbp->status)) {
>
> Alan> The function call above is completely wrong. It is meant to be used only
> Alan> from within the dequeue method.
>
> Ahh, so should I just unconditionally do the unlink_urb_from_ep and
> giveback_urb?
Yes, that's right. The check_unlink_urb routine merely verifies that
an unlink is valid. If you're about to giveback an URB then you
already know it's valid to do so.
Alan Stern
^ permalink raw reply
* Re: x86/non-x86: percpu, node ids, apic ids x86.git fixup
From: Geert Uytterhoeven @ 2008-01-30 15:27 UTC (permalink / raw)
To: Linus Torvalds, Ingo Molnar, Thomas Gleixner, Mike Travis
Cc: sparclinux, Linux/PPC Development, linux-ia64,
Linux Kernel Development
In-Reply-To: <200801301414.m0UEEgCC006371@hera.kernel.org>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 4814 bytes --]
On Wed, 30 Jan 2008, Linux Kernel Mailing List wrote:
> Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=dd5af90a7f3d79e04b7eace9a98644dbf2038f4d
> Commit: dd5af90a7f3d79e04b7eace9a98644dbf2038f4d
> Parent: 3212bff370c2f22e4987c6679ba485654cefb178
> Author: Mike Travis <travis@sgi.com>
> AuthorDate: Wed Jan 30 13:33:32 2008 +0100
> Committer: Ingo Molnar <mingo@elte.hu>
> CommitDate: Wed Jan 30 13:33:32 2008 +0100
>
> x86/non-x86: percpu, node ids, apic ids x86.git fixup
>
> Signed-off-by: Ingo Molnar <mingo@elte.hu>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> ---
> arch/x86/Kconfig | 2 +-
> include/asm-generic/percpu.h | 12 ++----------
> init/main.c | 4 ++--
> kernel/module.c | 8 ++++++++
This broke powerpc (and presumably ia64 and sparc64) in current linux-2.6.git:
| init/main.c:376: error: static declaration of 'setup_per_cpu_areas' follows non-static declaration
| include2/asm/percpu.h:33: error: previous declaration of 'setup_per_cpu_areas' was here
as the generic and x86-specific parts were integrated, while the
powerpc/ia64/sparc64-specific parts are still missing.
> 4 files changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index f0887d1..8e1b33c 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -97,7 +97,7 @@ config GENERIC_TIME_VSYSCALL
> bool
> default X86_64
>
> -config ARCH_SETS_UP_PER_CPU_AREA
> +config HAVE_SETUP_PER_CPU_AREA
> def_bool X86_64
>
> config ARCH_SUPPORTS_OPROFILE
> diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h
> index c41b1a7..4b8d31c 100644
> --- a/include/asm-generic/percpu.h
> +++ b/include/asm-generic/percpu.h
> @@ -47,7 +47,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
> #endif
>
> /*
> - * A percpu variable may point to a discarded reghions. The following are
> + * A percpu variable may point to a discarded regions. The following are
> * established ways to produce a usable pointer from the percpu variable
> * offset.
> */
> @@ -59,18 +59,10 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
> (*SHIFT_PERCPU_PTR(&per_cpu_var(var), __my_cpu_offset))
>
>
> -#ifdef CONFIG_ARCH_SETS_UP_PER_CPU_AREA
> +#ifdef CONFIG_HAVE_SETUP_PER_CPU_AREA
> extern void setup_per_cpu_areas(void);
> #endif
>
> -/* A macro to avoid #include hell... */
> -#define percpu_modcopy(pcpudst, src, size) \
> -do { \
> - unsigned int __i; \
> - for_each_possible_cpu(__i) \
> - memcpy((pcpudst)+per_cpu_offset(__i), \
> - (src), (size)); \
> -} while (0)
> #else /* ! SMP */
>
> #define per_cpu(var, cpu) (*((void)(cpu), &per_cpu_var(var)))
> diff --git a/init/main.c b/init/main.c
> index 5843fe9..3316dff 100644
> --- a/init/main.c
> +++ b/init/main.c
> @@ -363,7 +363,7 @@ static inline void smp_prepare_cpus(unsigned int maxcpus) { }
>
> #else
>
> -#ifndef CONFIG_ARCH_SETS_UP_PER_CPU_AREA
> +#ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA
> unsigned long __per_cpu_offset[NR_CPUS] __read_mostly;
>
> EXPORT_SYMBOL(__per_cpu_offset);
> @@ -384,7 +384,7 @@ static void __init setup_per_cpu_areas(void)
> ptr += size;
> }
> }
> -#endif /* CONFIG_ARCH_SETS_UP_CPU_AREA */
> +#endif /* CONFIG_HAVE_SETUP_PER_CPU_AREA */
>
> /* Called by boot processor to activate the rest. */
> static void __init smp_init(void)
> diff --git a/kernel/module.c b/kernel/module.c
> index f6a4e72..bd60278 100644
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -430,6 +430,14 @@ static unsigned int find_pcpusec(Elf_Ehdr *hdr,
> return find_sec(hdr, sechdrs, secstrings, ".data.percpu");
> }
>
> +static void percpu_modcopy(void *pcpudest, const void *from, unsigned long size)
> +{
> + int cpu;
> +
> + for_each_possible_cpu(cpu)
> + memcpy(pcpudest + per_cpu_offset(cpu), from, size);
> +}
> +
> static int percpu_modinit(void)
> {
> pcpu_num_used = 2;
> -
> To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
With kind regards,
Geert Uytterhoeven
Software Architect
Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
Phone: +32 (0)2 700 8453
Fax: +32 (0)2 700 8622
E-mail: Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/
Sony Network and Software Technology Center Europe
A division of Sony Service Centre (Europe) N.V.
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium
VAT BE 0413.825.160 · RPR Brussels
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619
^ permalink raw reply
* Re: x86/non-x86: percpu, node ids, apic ids x86.git fixup
From: Mike Travis @ 2008-01-30 16:02 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: linux-ia64, Linux Kernel Development, Linux/PPC Development,
sparclinux, Ingo Molnar, Linus Torvalds, Thomas Gleixner
In-Reply-To: <Pine.LNX.4.64.0801301622460.11859@vixen.sonytel.be>
Geert Uytterhoeven wrote:
> On Wed, 30 Jan 2008, Linux Kernel Mailing List wrote:
>> Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=dd5af90a7f3d79e04b7eace9a98644dbf2038f4d
>> Commit: dd5af90a7f3d79e04b7eace9a98644dbf2038f4d
>> Parent: 3212bff370c2f22e4987c6679ba485654cefb178
>> Author: Mike Travis <travis@sgi.com>
>> AuthorDate: Wed Jan 30 13:33:32 2008 +0100
>> Committer: Ingo Molnar <mingo@elte.hu>
>> CommitDate: Wed Jan 30 13:33:32 2008 +0100
>>
>> x86/non-x86: percpu, node ids, apic ids x86.git fixup
>>
>> Signed-off-by: Ingo Molnar <mingo@elte.hu>
>> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
>> ---
>> arch/x86/Kconfig | 2 +-
>> include/asm-generic/percpu.h | 12 ++----------
>> init/main.c | 4 ++--
>> kernel/module.c | 8 ++++++++
>
> This broke powerpc (and presumably ia64 and sparc64) in current linux-2.6.git:
I'm generating a "fixup patch" right now...
-Mike
>
> | init/main.c:376: error: static declaration of 'setup_per_cpu_areas' follows non-static declaration
> | include2/asm/percpu.h:33: error: previous declaration of 'setup_per_cpu_areas' was here
>
> as the generic and x86-specific parts were integrated, while the
> powerpc/ia64/sparc64-specific parts are still missing.
>
>> 4 files changed, 13 insertions(+), 13 deletions(-)
>>
>> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
>> index f0887d1..8e1b33c 100644
>> --- a/arch/x86/Kconfig
>> +++ b/arch/x86/Kconfig
>> @@ -97,7 +97,7 @@ config GENERIC_TIME_VSYSCALL
>> bool
>> default X86_64
>>
>> -config ARCH_SETS_UP_PER_CPU_AREA
>> +config HAVE_SETUP_PER_CPU_AREA
>> def_bool X86_64
>>
>> config ARCH_SUPPORTS_OPROFILE
>> diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h
>> index c41b1a7..4b8d31c 100644
>> --- a/include/asm-generic/percpu.h
>> +++ b/include/asm-generic/percpu.h
>> @@ -47,7 +47,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
>> #endif
>>
>> /*
>> - * A percpu variable may point to a discarded reghions. The following are
>> + * A percpu variable may point to a discarded regions. The following are
>> * established ways to produce a usable pointer from the percpu variable
>> * offset.
>> */
>> @@ -59,18 +59,10 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
>> (*SHIFT_PERCPU_PTR(&per_cpu_var(var), __my_cpu_offset))
>>
>>
>> -#ifdef CONFIG_ARCH_SETS_UP_PER_CPU_AREA
>> +#ifdef CONFIG_HAVE_SETUP_PER_CPU_AREA
>> extern void setup_per_cpu_areas(void);
>> #endif
>>
>> -/* A macro to avoid #include hell... */
>> -#define percpu_modcopy(pcpudst, src, size) \
>> -do { \
>> - unsigned int __i; \
>> - for_each_possible_cpu(__i) \
>> - memcpy((pcpudst)+per_cpu_offset(__i), \
>> - (src), (size)); \
>> -} while (0)
>> #else /* ! SMP */
>>
>> #define per_cpu(var, cpu) (*((void)(cpu), &per_cpu_var(var)))
>> diff --git a/init/main.c b/init/main.c
>> index 5843fe9..3316dff 100644
>> --- a/init/main.c
>> +++ b/init/main.c
>> @@ -363,7 +363,7 @@ static inline void smp_prepare_cpus(unsigned int maxcpus) { }
>>
>> #else
>>
>> -#ifndef CONFIG_ARCH_SETS_UP_PER_CPU_AREA
>> +#ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA
>> unsigned long __per_cpu_offset[NR_CPUS] __read_mostly;
>>
>> EXPORT_SYMBOL(__per_cpu_offset);
>> @@ -384,7 +384,7 @@ static void __init setup_per_cpu_areas(void)
>> ptr += size;
>> }
>> }
>> -#endif /* CONFIG_ARCH_SETS_UP_CPU_AREA */
>> +#endif /* CONFIG_HAVE_SETUP_PER_CPU_AREA */
>>
>> /* Called by boot processor to activate the rest. */
>> static void __init smp_init(void)
>> diff --git a/kernel/module.c b/kernel/module.c
>> index f6a4e72..bd60278 100644
>> --- a/kernel/module.c
>> +++ b/kernel/module.c
>> @@ -430,6 +430,14 @@ static unsigned int find_pcpusec(Elf_Ehdr *hdr,
>> return find_sec(hdr, sechdrs, secstrings, ".data.percpu");
>> }
>>
>> +static void percpu_modcopy(void *pcpudest, const void *from, unsigned long size)
>> +{
>> + int cpu;
>> +
>> + for_each_possible_cpu(cpu)
>> + memcpy(pcpudest + per_cpu_offset(cpu), from, size);
>> +}
>> +
>> static int percpu_modinit(void)
>> {
>> pcpu_num_used = 2;
>> -
>> To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
> With kind regards,
>
> Geert Uytterhoeven
> Software Architect
>
> Sony Network and Software Technology Center Europe
> The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
>
> Phone: +32 (0)2 700 8453
> Fax: +32 (0)2 700 8622
> E-mail: Geert.Uytterhoeven@sonycom.com
> Internet: http://www.sony-europe.com/
>
> Sony Network and Software Technology Center Europe
> A division of Sony Service Centre (Europe) N.V.
> Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium
> VAT BE 0413.825.160 · RPR Brussels
> Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619
^ permalink raw reply
* Re: x86/non-x86: percpu, node ids, apic ids x86.git fixup
From: Ingo Molnar @ 2008-01-30 16:10 UTC (permalink / raw)
To: Mike Travis
Cc: sparclinux, linux-ia64, Linux Kernel Development,
Linux/PPC Development, Geert Uytterhoeven, Thomas Gleixner,
Linus Torvalds
In-Reply-To: <47A09F8A.3000309@sgi.com>
* Mike Travis <travis@sgi.com> wrote:
> > This broke powerpc (and presumably ia64 and sparc64) in current
> > linux-2.6.git:
>
> I'm generating a "fixup patch" right now...
thanks! Sorry about that: we cross-built on ARM but not on SMP non-x86
platforms so this dependency/breakage went unnoticed.
Ingo
^ permalink raw reply
* [BUILD FAILURE] 2.6.24-git7 section type conflict at various drivers on powerpc
From: Kamalesh Babulal @ 2008-01-30 16:19 UTC (permalink / raw)
To: LKML, netdev, linuxppc-dev, Sam Ravnborg, Andy Whitcroft
Hi,
Following are the different build failure with 2.6.24-git7 kernel on the powerpc
drivers/net/typhoon.c:181: error: typhoon_card_info causes a section type conflict
make[2]: *** [drivers/net/typhoon.o] Error 1
drivers/net/natsemi.c:259: error: natsemi_pci_info causes a section type conflict
make[2]: *** [drivers/net/natsemi.o] Error 1
drivers/net/bnx2.c:95: error: board_info causes a section type conflict
make[2]: *** [drivers/net/bnx2.o] Error 1
drivers/net/via-velocity.c:454: error: velocity_id_table causes a section type conflict
make[2]: *** [drivers/net/via-velocity.o] Error 1
Following are warning with section mismatch CONFIG_DEBUG_SECTION_MISMATCH enabled,
WARNING: kernel/built-in.o(.text+0x423f4): Section mismatch in reference from the function .enable_nonboot_cpus() to the function .cpuinit.text:._cpu_up()
The function .enable_nonboot_cpus() references
the function __cpuinit ._cpu_up().
This is often because .enable_nonboot_cpus lacks a __cpuinit
annotation or the annotation of ._cpu_up is wrong.
WARNING: drivers/net/ibm_newemac/ibm_newemac.o(.devinit.text+0x1bb4): Section mismatch in reference from the function .emac_probe() to the function .devexit.text:.tah_detach()
The function __devinit .emac_probe() references
a function __devexit .tah_detach().
This is often seen when error handling in the init function
uses functionality in the exit path.
The fix is often to remove the __devexit annotation of
.tah_detach() so it may be used outside an exit section.
WARNING: drivers/net/ibm_newemac/ibm_newemac.o(.devinit.text+0x1bd0): Section mismatch in reference from the function .emac_probe() to the function .devexit.text:.rgmii_detach()
The function __devinit .emac_probe() references
a function __devexit .rgmii_detach().
This is often seen when error handling in the init function
uses functionality in the exit path.
The fix is often to remove the __devexit annotation of
.rgmii_detach() so it may be used outside an exit section.
WARNING: drivers/net/ibm_newemac/ibm_newemac.o(.devinit.text+0x1bec): Section mismatch in reference from the function .emac_probe() to the function .devexit.text:.zmii_detach()
The function __devinit .emac_probe() references
a function __devexit .zmii_detach().
This is often seen when error handling in the init function
uses functionality in the exit path.
The fix is often to remove the __devexit annotation of
.zmii_detach() so it may be used outside an exit section.
WARNING: drivers/net/ibm_newemac/ibm_newemac.o(.devinit.text+0x1bfc): Section mismatch in reference from the function .emac_probe() to the function .devexit.text:.mal_unregister_commac()
The function __devinit .emac_probe() references
a function __devexit .mal_unregister_commac().
This is often seen when error handling in the init function
uses functionality in the exit path.
The fix is often to remove the __devexit annotation of
.mal_unregister_commac() so it may be used outside an exit section.
LD drivers/net/ibm_newemac/built-in.o
WARNING: drivers/net/ibm_newemac/built-in.o(.devinit.text+0x1bb4): Section mismatch in reference from the function .emac_probe() to the function .devexit.text:.tah_detach()
The function __devinit .emac_probe() references
a function __devexit .tah_detach().
This is often seen when error handling in the init function
uses functionality in the exit path.
The fix is often to remove the __devexit annotation of
.tah_detach() so it may be used outside an exit section.
WARNING: drivers/net/ibm_newemac/built-in.o(.devinit.text+0x1bd0): Section mismatch in reference from the function .emac_probe() to the function .devexit.text:.rgmii_detach()
The function __devinit .emac_probe() references
a function __devexit .rgmii_detach().
This is often seen when error handling in the init function
uses functionality in the exit path.
The fix is often to remove the __devexit annotation of
.rgmii_detach() so it may be used outside an exit section.
WARNING: drivers/net/ibm_newemac/built-in.o(.devinit.text+0x1bec): Section mismatch in reference from the function .emac_probe() to the function .devexit.text:.zmii_detach()
The function __devinit .emac_probe() references
a function __devexit .zmii_detach().
This is often seen when error handling in the init function
uses functionality in the exit path.
The fix is often to remove the __devexit annotation of
.zmii_detach() so it may be used outside an exit section.
WARNING: drivers/net/ibm_newemac/built-in.o(.devinit.text+0x1bfc): Section mismatch in reference from the function .emac_probe() to the function .devexit.text:.mal_unregister_commac()
The function __devinit .emac_probe() references
a function __devexit .mal_unregister_commac().
This is often seen when error handling in the init function
uses functionality in the exit path.
The fix is often to remove the __devexit annotation of
.mal_unregister_commac() so it may be used outside an exit section.
WARNING: drivers/net/mlx4/mlx4_core.o(.text+0x6cf8): Section mismatch in reference from the function .mlx4_init_icm() to the function .devinit.text:.mlx4_init_cmpt_table()
The function .mlx4_init_icm() references
the function __devinit .mlx4_init_cmpt_table().
This is often because .mlx4_init_icm lacks a __devinit
annotation or the annotation of .mlx4_init_cmpt_table is wrong.
WARNING: drivers/net/mlx4/mlx4_core.o(.text+0x728c): Section mismatch in reference from the function .mlx4_init_hca() to the function .devinit.text:.mlx4_load_fw()
The function .mlx4_init_hca() references
the function __devinit .mlx4_load_fw().
This is often because .mlx4_init_hca lacks a __devinit
annotation or the annotation of .mlx4_load_fw is wrong.
WARNING: drivers/net/mlx4/mlx4_core.o(.text+0x7c98): Section mismatch in reference from the function .__mlx4_init_one() to the function .devinit.text:.mlx4_enable_msi_x()
The function .__mlx4_init_one() references
the function __devinit .mlx4_enable_msi_x().
This is often because .__mlx4_init_one lacks a __devinit
annotation or the annotation of .mlx4_enable_msi_x is wrong.
WARNING: drivers/net/mlx4/mlx4_core.o(.text+0x97ac): Section mismatch in reference from the function .mlx4_init_mr_table() to the function .devinit.text:.mlx4_buddy_init()
The function .mlx4_init_mr_table() references
the function __devinit .mlx4_buddy_init().
This is often because .mlx4_init_mr_table lacks a __devinit
annotation or the annotation of .mlx4_buddy_init is wrong.
LD drivers/net/mlx4/built-in.o
WARNING: drivers/net/mlx4/built-in.o(.text+0x6cf8): Section mismatch in reference from the function .mlx4_init_icm() to the function .devinit.text:.mlx4_init_cmpt_table()
The function .mlx4_init_icm() references
the function __devinit .mlx4_init_cmpt_table().
This is often because .mlx4_init_icm lacks a __devinit
annotation or the annotation of .mlx4_init_cmpt_table is wrong.
WARNING: drivers/net/mlx4/built-in.o(.text+0x728c): Section mismatch in reference from the function .mlx4_init_hca() to the function .devinit.text:.mlx4_load_fw()
The function .mlx4_init_hca() references
the function __devinit .mlx4_load_fw().
This is often because .mlx4_init_hca lacks a __devinit
annotation or the annotation of .mlx4_load_fw is wrong.
WARNING: drivers/net/mlx4/built-in.o(.text+0x7c98): Section mismatch in reference from the function .__mlx4_init_one() to the function .devinit.text:.mlx4_enable_msi_x()
The function .__mlx4_init_one() references
the function __devinit .mlx4_enable_msi_x().
This is often because .__mlx4_init_one lacks a __devinit
annotation or the annotation of .mlx4_enable_msi_x is wrong.
WARNING: drivers/net/mlx4/built-in.o(.text+0x97ac): Section mismatch in reference from the function .mlx4_init_mr_table() to the function .devinit.text:.mlx4_buddy_init()
The function .mlx4_init_mr_table() references
the function __devinit .mlx4_buddy_init().
This is often because .mlx4_init_mr_table lacks a __devinit
annotation or the annotation of .mlx4_buddy_init is wrong.
WARNING: drivers/net/tokenring/built-in.o(.text+0x4d64): Section mismatch in reference from the function .olympic_open() to the function .devinit.text:.olympic_init()
The function .olympic_open() references
the function __devinit .olympic_init().
This is often because .olympic_open lacks a __devinit
annotation or the annotation of .olympic_init is wrong.
--
Thanks & Regards,
Kamalesh Babulal,
Linux Technology Center,
IBM, ISTL.
^ permalink raw reply
* Re: [PATCH] [NET] cpmac: convert to new Fixed PHY infrastructure (was: Re: fixed phy support (warning related to FIXED_MII_100_FDX))
From: Kumar Gala @ 2008-01-30 16:35 UTC (permalink / raw)
To: Jeff Garzik; +Cc: linuxppc-dev list, Eugene Konev, netdev
In-Reply-To: <20080121204953.GA11384@localhost.localdomain>
On Jan 21, 2008, at 2:49 PM, Anton Vorontsov wrote:
> On Mon, Jan 21, 2008 at 01:19:41PM -0600, Kumar Gala wrote:
>> Anton,
>>
>> it looks like the "TI AR7 CPMAC Ethernet support" uses FIXED_PHY and
>> was selecting FIXED_MII_100_FDX which is gone.
>>
>> Can you look into this. I get the following warning now:
>>
>> scripts/kconfig/conf -s arch/powerpc/Kconfig
>> drivers/net/Kconfig:1713:warning: 'select' used by config symbol
>> 'CPMAC' refers to undefined symbol 'FIXED_MII_100_FDX'
>
> Wow. I thought there were no Fixed PHY users. :-)
>
> Jeff, as you've already Acked Fixed PHY rework to go through powerpc
> tree, would you please Ack this patch in addition? I hope cpmac
> maintainer will fix remaining issues as time goes by.
>
> Thanks!
Jeff, just a reminder to look at this.
- k
> - - - -
> From: Anton Vorontsov <avorontsov@ru.mvista.com>
> Subject: [PATCH] [NET] cpmac: convert to new Fixed PHY infrastructure
>
> This patch converts cpmac to the new Fixed PHY infrastructure,
> though it
> doesn't fix all the problems with that driver. I didn't even bother to
> test this patch to compile, because cpmac driver is broken in
> several ways:
>
> 1. This driver won't compile by itself because lack of its header
> describing
> platform data;
> 2. It assumes that fixed PHYs should be created by the ethernet
> driver.
> It is wrong assumption: fixed PHYs creation is platform code
> authority,
> driver must blindly accept bus_id and phy_id platform data variables
> instead.
>
> Also, it seem that that driver doesn't have actual in-tree users, so
> nothing to fix further.
>
> The main purpose of that patch is to get rid of the following Kconfig
> warning:
>
> scripts/kconfig/conf -s arch/powerpc/Kconfig
> drivers/net/Kconfig:1713:warning: 'select' used by config symbol
> 'CPMAC' refers to undefined symbol 'FIXED_MII_100_FDX'
>
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> ---
> drivers/net/Kconfig | 4 +--
> drivers/net/cpmac.c | 55 +++++++++++++++
> +----------------------------------
> 2 files changed, 19 insertions(+), 40 deletions(-)
>
> diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
> index 114771a..5380ff9 100644
> --- a/drivers/net/Kconfig
> +++ b/drivers/net/Kconfig
> @@ -1707,10 +1707,8 @@ config SC92031
>
> config CPMAC
> tristate "TI AR7 CPMAC Ethernet support (EXPERIMENTAL)"
> - depends on NET_ETHERNET && EXPERIMENTAL && AR7
> + depends on NET_ETHERNET && EXPERIMENTAL && AR7 && BROKEN
> select PHYLIB
> - select FIXED_PHY
> - select FIXED_MII_100_FDX
> help
> TI AR7 CPMAC Ethernet support
>
> diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c
> index 6fd95a2..88eeb1d 100644
> --- a/drivers/net/cpmac.c
> +++ b/drivers/net/cpmac.c
> @@ -848,15 +848,6 @@ static void cpmac_adjust_link(struct net_device
> *dev)
> spin_unlock(&priv->lock);
> }
>
> -static int cpmac_link_update(struct net_device *dev,
> - struct fixed_phy_status *status)
> -{
> - status->link = 1;
> - status->speed = 100;
> - status->duplex = 1;
> - return 0;
> -}
> -
> static int cpmac_open(struct net_device *dev)
> {
> int i, size, res;
> @@ -999,11 +990,11 @@ static int external_switch;
> static int __devinit cpmac_probe(struct platform_device *pdev)
> {
> int rc, phy_id, i;
> + int mdio_bus_id = cpmac_mii.id;
> struct resource *mem;
> struct cpmac_priv *priv;
> struct net_device *dev;
> struct plat_cpmac_data *pdata;
> - struct fixed_info *fixed_phy;
> DECLARE_MAC_BUF(mac);
>
> pdata = pdev->dev.platform_data;
> @@ -1017,9 +1008,23 @@ static int __devinit cpmac_probe(struct
> platform_device *pdev)
> }
>
> if (phy_id == PHY_MAX_ADDR) {
> - if (external_switch || dumb_switch)
> + if (external_switch || dumb_switch) {
> + struct fixed_phy_status status = {};
> +
> + mdio_bus_id = 0;
> +
> + /*
> + * FIXME: this should be in the platform code!
> + * Since there is not platform code at all (that is,
> + * no mainline users of that driver), place it here
> + * for now.
> + */
> phy_id = 0;
> - else {
> + status.link = 1;
> + status.duplex = 1;
> + status.speed = 100;
> + fixed_phy_add(PHY_POLL, phy_id, &status);
> + } else {
> printk(KERN_ERR "cpmac: no PHY present\n");
> return -ENODEV;
> }
> @@ -1063,32 +1068,8 @@ static int __devinit cpmac_probe(struct
> platform_device *pdev)
> priv->msg_enable = netif_msg_init(debug_level, 0xff);
> memcpy(dev->dev_addr, pdata->dev_addr, sizeof(dev->dev_addr));
>
> - if (phy_id == 31) {
> - snprintf(priv->phy_name, BUS_ID_SIZE, PHY_ID_FMT, cpmac_mii.id,
> - phy_id);
> - } else {
> - /* Let's try to get a free fixed phy... */
> - for (i = 0; i < MAX_PHY_AMNT; i++) {
> - fixed_phy = fixed_mdio_get_phydev(i);
> - if (!fixed_phy)
> - continue;
> - if (!fixed_phy->phydev->attached_dev) {
> - strncpy(priv->phy_name,
> - fixed_phy->phydev->dev.bus_id,
> - BUS_ID_SIZE);
> - fixed_mdio_set_link_update(fixed_phy->phydev,
> - &cpmac_link_update);
> - goto phy_found;
> - }
> - }
> - if (netif_msg_drv(priv))
> - printk(KERN_ERR "%s: Could not find fixed PHY\n",
> - dev->name);
> - rc = -ENODEV;
> - goto fail;
> - }
> + snprintf(priv->phy_name, BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id,
> phy_id);
>
> -phy_found:
> priv->phy = phy_connect(dev, priv->phy_name, &cpmac_adjust_link, 0,
> PHY_INTERFACE_MODE_MII);
> if (IS_ERR(priv->phy)) {
> --
> 1.5.2.2
^ permalink raw reply
* [PATCH] powerpc: configure USB clock for MPC8315E
From: Kim Phillips @ 2008-01-30 16:36 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Jerry Huang
SCCR USB bits are in a different location on the mpc8315.
Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
---
arch/powerpc/platforms/83xx/mpc83xx.h | 2 ++
arch/powerpc/platforms/83xx/usb.c | 12 ++++++++----
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/platforms/83xx/mpc83xx.h b/arch/powerpc/platforms/83xx/mpc83xx.h
index 88bb748..68065e6 100644
--- a/arch/powerpc/platforms/83xx/mpc83xx.h
+++ b/arch/powerpc/platforms/83xx/mpc83xx.h
@@ -14,6 +14,8 @@
#define MPC83XX_SCCR_USB_DRCM_11 0x00300000
#define MPC83XX_SCCR_USB_DRCM_01 0x00100000
#define MPC83XX_SCCR_USB_DRCM_10 0x00200000
+#define MPC8315_SCCR_USB_MASK 0x00c00000
+#define MPC8315_SCCR_USB_DRCM_11 0x00c00000
#define MPC837X_SCCR_USB_DRCM_11 0x00c00000
/* system i/o configuration register low */
diff --git a/arch/powerpc/platforms/83xx/usb.c b/arch/powerpc/platforms/83xx/usb.c
index 681230a..b3b650e 100644
--- a/arch/powerpc/platforms/83xx/usb.c
+++ b/arch/powerpc/platforms/83xx/usb.c
@@ -124,10 +124,14 @@ int mpc831x_usb_cfg(void)
}
/* Configure clock */
- temp = in_be32(immap + MPC83XX_SCCR_OFFS);
- temp &= ~MPC83XX_SCCR_USB_MASK;
- temp |= MPC83XX_SCCR_USB_DRCM_11; /* 1:3 */
- out_be32(immap + MPC83XX_SCCR_OFFS, temp);
+ if (of_find_compatible_node(NULL, NULL, "fsl,mpc8315erdb"))
+ clrsetbits_be32(immap + MPC83XX_SCCR_OFFS,
+ MPC8315_SCCR_USB_MASK,
+ MPC8315_SCCR_USB_DRCM_11);
+ else
+ clrsetbits_be32(immap + MPC83XX_SCCR_OFFS,
+ MPC83XX_SCCR_USB_MASK,
+ MPC83XX_SCCR_USB_DRCM_11);
/* Configure pin mux for ULPI. There is no pin mux for UTMI */
if (prop && !strcmp(prop, "ulpi")) {
--
1.5.2.2
^ permalink raw reply related
* Re: [PATCH] powerpc: configure USB clock for MPC8315E
From: Kumar Gala @ 2008-01-30 16:38 UTC (permalink / raw)
To: Kim Phillips; +Cc: linuxppc-dev, Jerry Huang
In-Reply-To: <20080130103644.bbfe82a5.kim.phillips@freescale.com>
On Jan 30, 2008, at 10:36 AM, Kim Phillips wrote:
> SCCR USB bits are in a different location on the mpc8315.
>
> Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
> ---
> arch/powerpc/platforms/83xx/mpc83xx.h | 2 ++
> arch/powerpc/platforms/83xx/usb.c | 12 ++++++++----
> 2 files changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/platforms/83xx/mpc83xx.h b/arch/powerpc/
> platforms/83xx/mpc83xx.h
> index 88bb748..68065e6 100644
> --- a/arch/powerpc/platforms/83xx/mpc83xx.h
> +++ b/arch/powerpc/platforms/83xx/mpc83xx.h
> @@ -14,6 +14,8 @@
> #define MPC83XX_SCCR_USB_DRCM_11 0x00300000
> #define MPC83XX_SCCR_USB_DRCM_01 0x00100000
> #define MPC83XX_SCCR_USB_DRCM_10 0x00200000
> +#define MPC8315_SCCR_USB_MASK 0x00c00000
> +#define MPC8315_SCCR_USB_DRCM_11 0x00c00000
> #define MPC837X_SCCR_USB_DRCM_11 0x00c00000
>
> /* system i/o configuration register low */
> diff --git a/arch/powerpc/platforms/83xx/usb.c b/arch/powerpc/
> platforms/83xx/usb.c
> index 681230a..b3b650e 100644
> --- a/arch/powerpc/platforms/83xx/usb.c
> +++ b/arch/powerpc/platforms/83xx/usb.c
> @@ -124,10 +124,14 @@ int mpc831x_usb_cfg(void)
> }
>
> /* Configure clock */
> - temp = in_be32(immap + MPC83XX_SCCR_OFFS);
> - temp &= ~MPC83XX_SCCR_USB_MASK;
> - temp |= MPC83XX_SCCR_USB_DRCM_11; /* 1:3 */
> - out_be32(immap + MPC83XX_SCCR_OFFS, temp);
> + if (of_find_compatible_node(NULL, NULL, "fsl,mpc8315erdb"))
Nope. I don't want a board specific compat check in this code.
>
> + clrsetbits_be32(immap + MPC83XX_SCCR_OFFS,
> + MPC8315_SCCR_USB_MASK,
> + MPC8315_SCCR_USB_DRCM_11);
> + else
> + clrsetbits_be32(immap + MPC83XX_SCCR_OFFS,
> + MPC83XX_SCCR_USB_MASK,
> + MPC83XX_SCCR_USB_DRCM_11);
>
> /* Configure pin mux for ULPI. There is no pin mux for UTMI */
> if (prop && !strcmp(prop, "ulpi")) {
- k
^ permalink raw reply
* Re: [BUILD FAILURE] 2.6.24-git7 section type conflict at various drivers on powerpc
From: Sam Ravnborg @ 2008-01-30 17:04 UTC (permalink / raw)
To: Kamalesh Babulal; +Cc: netdev, LKML, linuxppc-dev
In-Reply-To: <47A0A3AF.5050005@linux.vnet.ibm.com>
On Wed, Jan 30, 2008 at 09:49:59PM +0530, Kamalesh Babulal wrote:
> Hi,
>
> Following are the different build failure with 2.6.24-git7 kernel on the powerpc
>
> drivers/net/typhoon.c:181: error: typhoon_card_info causes a section type conflict
> make[2]: *** [drivers/net/typhoon.o] Error 1
>
> drivers/net/natsemi.c:259: error: natsemi_pci_info causes a section type conflict
> make[2]: *** [drivers/net/natsemi.o] Error 1
>
> drivers/net/bnx2.c:95: error: board_info causes a section type conflict
> make[2]: *** [drivers/net/bnx2.o] Error 1
>
> drivers/net/via-velocity.c:454: error: velocity_id_table causes a section type conflict
> make[2]: *** [drivers/net/via-velocity.o] Error 1
A quick look told me that they are all caused by const data
annotated with __devinitdata.
Try replacing all annotations of const variables
from __devinitdata to __devinitconst.
Sam
^ permalink raw reply
* [PATCH v2] powerpc: configure USB clock for MPC8315E
From: Kim Phillips @ 2008-01-30 17:08 UTC (permalink / raw)
To: linuxppc-dev, Kumar Gala; +Cc: Jerry Huang
SCCR USB bits are in a different location on the mpc8315.
Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
---
changed to match compatible on non-board specific "fsl,mpc8315-usb2-dr".
arch/powerpc/boot/dts/mpc8315erdb.dts | 2 +-
arch/powerpc/platforms/83xx/mpc83xx.h | 2 ++
arch/powerpc/platforms/83xx/usb.c | 12 ++++++++----
3 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/boot/dts/mpc8315erdb.dts b/arch/powerpc/boot/dts/mpc8315erdb.dts
index b582032..59b1f05 100644
--- a/arch/powerpc/boot/dts/mpc8315erdb.dts
+++ b/arch/powerpc/boot/dts/mpc8315erdb.dts
@@ -133,7 +133,7 @@
};
usb@23000 {
- compatible = "fsl-usb2-dr";
+ compatible = "fsl-usb2-dr", "fsl,mpc8315-usb2-dr";
reg = <0x23000 0x1000>;
#address-cells = <1>;
#size-cells = <0>;
diff --git a/arch/powerpc/platforms/83xx/mpc83xx.h b/arch/powerpc/platforms/83xx/mpc83xx.h
index 88bb748..68065e6 100644
--- a/arch/powerpc/platforms/83xx/mpc83xx.h
+++ b/arch/powerpc/platforms/83xx/mpc83xx.h
@@ -14,6 +14,8 @@
#define MPC83XX_SCCR_USB_DRCM_11 0x00300000
#define MPC83XX_SCCR_USB_DRCM_01 0x00100000
#define MPC83XX_SCCR_USB_DRCM_10 0x00200000
+#define MPC8315_SCCR_USB_MASK 0x00c00000
+#define MPC8315_SCCR_USB_DRCM_11 0x00c00000
#define MPC837X_SCCR_USB_DRCM_11 0x00c00000
/* system i/o configuration register low */
diff --git a/arch/powerpc/platforms/83xx/usb.c b/arch/powerpc/platforms/83xx/usb.c
index 681230a..14c83f1 100644
--- a/arch/powerpc/platforms/83xx/usb.c
+++ b/arch/powerpc/platforms/83xx/usb.c
@@ -124,10 +124,14 @@ int mpc831x_usb_cfg(void)
}
/* Configure clock */
- temp = in_be32(immap + MPC83XX_SCCR_OFFS);
- temp &= ~MPC83XX_SCCR_USB_MASK;
- temp |= MPC83XX_SCCR_USB_DRCM_11; /* 1:3 */
- out_be32(immap + MPC83XX_SCCR_OFFS, temp);
+ if (of_find_compatible_node(NULL, NULL, "fsl,mpc8315-usb2-dr"))
+ clrsetbits_be32(immap + MPC83XX_SCCR_OFFS,
+ MPC8315_SCCR_USB_MASK,
+ MPC8315_SCCR_USB_DRCM_11);
+ else
+ clrsetbits_be32(immap + MPC83XX_SCCR_OFFS,
+ MPC83XX_SCCR_USB_MASK,
+ MPC83XX_SCCR_USB_DRCM_11);
/* Configure pin mux for ULPI. There is no pin mux for UTMI */
if (prop && !strcmp(prop, "ulpi")) {
--
1.5.2.2
^ permalink raw reply related
* Re: [PATCH] [NET] cpmac: convert to new Fixed PHY infrastructure
From: Jeff Garzik @ 2008-01-30 17:09 UTC (permalink / raw)
To: avorontsov; +Cc: linuxppc-dev list, Eugene Konev, netdev
In-Reply-To: <20080121204953.GA11384@localhost.localdomain>
Anton Vorontsov wrote:
> On Mon, Jan 21, 2008 at 01:19:41PM -0600, Kumar Gala wrote:
>> Anton,
>>
>> it looks like the "TI AR7 CPMAC Ethernet support" uses FIXED_PHY and
>> was selecting FIXED_MII_100_FDX which is gone.
>>
>> Can you look into this. I get the following warning now:
>>
>> scripts/kconfig/conf -s arch/powerpc/Kconfig
>> drivers/net/Kconfig:1713:warning: 'select' used by config symbol
>> 'CPMAC' refers to undefined symbol 'FIXED_MII_100_FDX'
>
> Wow. I thought there were no Fixed PHY users. :-)
>
> Jeff, as you've already Acked Fixed PHY rework to go through powerpc
> tree, would you please Ack this patch in addition? I hope cpmac
> maintainer will fix remaining issues as time goes by.
>
> Thanks!
>
> - - - -
> From: Anton Vorontsov <avorontsov@ru.mvista.com>
> Subject: [PATCH] [NET] cpmac: convert to new Fixed PHY infrastructure
>
> This patch converts cpmac to the new Fixed PHY infrastructure, though it
> doesn't fix all the problems with that driver. I didn't even bother to
> test this patch to compile, because cpmac driver is broken in several ways:
>
> 1. This driver won't compile by itself because lack of its header describing
> platform data;
> 2. It assumes that fixed PHYs should be created by the ethernet driver.
> It is wrong assumption: fixed PHYs creation is platform code authority,
> driver must blindly accept bus_id and phy_id platform data variables
> instead.
>
> Also, it seem that that driver doesn't have actual in-tree users, so
> nothing to fix further.
>
> The main purpose of that patch is to get rid of the following Kconfig
> warning:
>
> scripts/kconfig/conf -s arch/powerpc/Kconfig
> drivers/net/Kconfig:1713:warning: 'select' used by config symbol
> 'CPMAC' refers to undefined symbol 'FIXED_MII_100_FDX'
>
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
ACK
^ permalink raw reply
* Re: [PATCH v2] powerpc: configure USB clock for MPC8315E
From: Kumar Gala @ 2008-01-30 17:24 UTC (permalink / raw)
To: Kim Phillips; +Cc: linuxppc-dev, Jerry Huang
In-Reply-To: <20080130110857.c66f98fb.kim.phillips@freescale.com>
On Jan 30, 2008, at 11:08 AM, Kim Phillips wrote:
> SCCR USB bits are in a different location on the mpc8315.
>
> Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
> ---
> changed to match compatible on non-board specific "fsl,mpc8315-usb2-
> dr".
Try again. The SCCR isn't a function of the USB block. Its more a
function of the mpc8315 soc platform.
- k
^ permalink raw reply
* Re: [PATCH] [NET] cpmac: convert to new Fixed PHY infrastructure
From: Kumar Gala @ 2008-01-30 17:24 UTC (permalink / raw)
To: Jeff Garzik; +Cc: linuxppc-dev list, Eugene Konev, netdev
In-Reply-To: <47A0AF56.3060804@garzik.org>
On Jan 30, 2008, at 11:09 AM, Jeff Garzik wrote:
> Anton Vorontsov wrote:
>> On Mon, Jan 21, 2008 at 01:19:41PM -0600, Kumar Gala wrote:
>>> Anton,
>>>
>>> it looks like the "TI AR7 CPMAC Ethernet support" uses FIXED_PHY
>>> and was selecting FIXED_MII_100_FDX which is gone.
>>>
>>> Can you look into this. I get the following warning now:
>>>
>>> scripts/kconfig/conf -s arch/powerpc/Kconfig
>>> drivers/net/Kconfig:1713:warning: 'select' used by config symbol
>>> 'CPMAC' refers to undefined symbol 'FIXED_MII_100_FDX'
>> Wow. I thought there were no Fixed PHY users. :-)
>> Jeff, as you've already Acked Fixed PHY rework to go through powerpc
>> tree, would you please Ack this patch in addition? I hope cpmac
>> maintainer will fix remaining issues as time goes by.
>> Thanks!
>> - - - -
>> From: Anton Vorontsov <avorontsov@ru.mvista.com>
>> Subject: [PATCH] [NET] cpmac: convert to new Fixed PHY infrastructure
>> This patch converts cpmac to the new Fixed PHY infrastructure,
>> though it
>> doesn't fix all the problems with that driver. I didn't even bother
>> to
>> test this patch to compile, because cpmac driver is broken in
>> several ways:
>> 1. This driver won't compile by itself because lack of its header
>> describing
>> platform data;
>> 2. It assumes that fixed PHYs should be created by the ethernet
>> driver.
>> It is wrong assumption: fixed PHYs creation is platform code
>> authority,
>> driver must blindly accept bus_id and phy_id platform data
>> variables
>> instead.
>> Also, it seem that that driver doesn't have actual in-tree users, so
>> nothing to fix further.
>> The main purpose of that patch is to get rid of the following Kconfig
>> warning:
>> scripts/kconfig/conf -s arch/powerpc/Kconfig
>> drivers/net/Kconfig:1713:warning: 'select' used by config symbol
>> 'CPMAC' refers to undefined symbol 'FIXED_MII_100_FDX'
>> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
>
> ACK
Is this going through netdev or do you want me to pick it via the
powerpc route?
- k
^ permalink raw reply
* RE: x86/non-x86: percpu, node ids, apic ids x86.git fixup
From: Luck, Tony @ 2008-01-30 17:13 UTC (permalink / raw)
To: Ingo Molnar, Mike Travis
Cc: sparclinux, linux-ia64, Linux Kernel Development,
Linux/PPC Development, Geert Uytterhoeven, Thomas Gleixner,
Linus Torvalds
In-Reply-To: <20080130161036.GA12293@elte.hu>
> > > This broke powerpc (and presumably ia64 and sparc64) in current=20
> > > linux-2.6.git:
> >=20
> > I'm generating a "fixup patch" right now...
>
> thanks! Sorry about that: we cross-built on ARM but not on SMP non-x86 =
> platforms so this dependency/breakage went unnoticed.
Yes ... all ia64 builds (UP and SMP) are broken at the moment. Please
Cc: me with the fixup patch.
Thanks
-Tony
^ permalink raw reply
* Re: [PATCH v2] powerpc: configure USB clock for MPC8315E
From: Olof Johansson @ 2008-01-30 17:27 UTC (permalink / raw)
To: Kim Phillips; +Cc: linuxppc-dev, Jerry Huang
In-Reply-To: <20080130110857.c66f98fb.kim.phillips@freescale.com>
Hi,
On Wed, Jan 30, 2008 at 11:08:57AM -0600, Kim Phillips wrote:
> diff --git a/arch/powerpc/platforms/83xx/usb.c b/arch/powerpc/platforms/83xx/usb.c
> index 681230a..14c83f1 100644
> --- a/arch/powerpc/platforms/83xx/usb.c
> +++ b/arch/powerpc/platforms/83xx/usb.c
> @@ -124,10 +124,14 @@ int mpc831x_usb_cfg(void)
> }
>
> /* Configure clock */
> - temp = in_be32(immap + MPC83XX_SCCR_OFFS);
> - temp &= ~MPC83XX_SCCR_USB_MASK;
> - temp |= MPC83XX_SCCR_USB_DRCM_11; /* 1:3 */
> - out_be32(immap + MPC83XX_SCCR_OFFS, temp);
> + if (of_find_compatible_node(NULL, NULL, "fsl,mpc8315-usb2-dr"))
> + clrsetbits_be32(immap + MPC83XX_SCCR_OFFS,
> + MPC8315_SCCR_USB_MASK,
> + MPC8315_SCCR_USB_DRCM_11);
You need an of_node_put here.
Also, it's weird to check for the global presence of a compatible
device. You already have the device node pointer in the function, why
don't you just check to see if that device is compatible instead?
-Olof
^ permalink raw reply
* Re: [PATCH] [NET] cpmac: convert to new Fixed PHY infrastructure
From: Jeff Garzik @ 2008-01-30 17:40 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev list, Eugene Konev, netdev
In-Reply-To: <02FAED2A-1154-4D8B-A245-4693BF283515@kernel.crashing.org>
Kumar Gala wrote:
>
> On Jan 30, 2008, at 11:09 AM, Jeff Garzik wrote:
>
>> Anton Vorontsov wrote:
>>> On Mon, Jan 21, 2008 at 01:19:41PM -0600, Kumar Gala wrote:
>>>> Anton,
>>>>
>>>> it looks like the "TI AR7 CPMAC Ethernet support" uses FIXED_PHY
>>>> and was selecting FIXED_MII_100_FDX which is gone.
>>>>
>>>> Can you look into this. I get the following warning now:
>>>>
>>>> scripts/kconfig/conf -s arch/powerpc/Kconfig
>>>> drivers/net/Kconfig:1713:warning: 'select' used by config symbol
>>>> 'CPMAC' refers to undefined symbol 'FIXED_MII_100_FDX'
>>> Wow. I thought there were no Fixed PHY users. :-)
>>> Jeff, as you've already Acked Fixed PHY rework to go through powerpc
>>> tree, would you please Ack this patch in addition? I hope cpmac
>>> maintainer will fix remaining issues as time goes by.
>>> Thanks!
>>> - - - -
>>> From: Anton Vorontsov <avorontsov@ru.mvista.com>
>>> Subject: [PATCH] [NET] cpmac: convert to new Fixed PHY infrastructure
>>> This patch converts cpmac to the new Fixed PHY infrastructure, though it
>>> doesn't fix all the problems with that driver. I didn't even bother to
>>> test this patch to compile, because cpmac driver is broken in several
>>> ways:
>>> 1. This driver won't compile by itself because lack of its header
>>> describing
>>> platform data;
>>> 2. It assumes that fixed PHYs should be created by the ethernet driver.
>>> It is wrong assumption: fixed PHYs creation is platform code
>>> authority,
>>> driver must blindly accept bus_id and phy_id platform data variables
>>> instead.
>>> Also, it seem that that driver doesn't have actual in-tree users, so
>>> nothing to fix further.
>>> The main purpose of that patch is to get rid of the following Kconfig
>>> warning:
>>> scripts/kconfig/conf -s arch/powerpc/Kconfig
>>> drivers/net/Kconfig:1713:warning: 'select' used by config symbol
>>> 'CPMAC' refers to undefined symbol 'FIXED_MII_100_FDX'
>>> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
>>
>> ACK
>
> Is this going through netdev or do you want me to pick it via the
> powerpc route?
Based on your comments I sorta assumed it was most convenient to lump in
with the rest of the powerpc changes...
Jeff
^ permalink raw reply
* Re: x86/non-x86: percpu, node ids, apic ids x86.git fixup
From: Ingo Molnar @ 2008-01-30 18:06 UTC (permalink / raw)
To: Luck, Tony
Cc: sparclinux, linux-ia64, Linux Kernel Development, Mike Travis,
Linux/PPC Development, Geert Uytterhoeven, Thomas Gleixner,
Linus Torvalds
In-Reply-To: <1FE6DD409037234FAB833C420AA843EC757C72@orsmsx424.amr.corp.intel.com>
* Luck, Tony <tony.luck@intel.com> wrote:
> > thanks! Sorry about that: we cross-built on ARM but not on SMP
> > non-x86 platforms so this dependency/breakage went unnoticed.
>
> Yes ... all ia64 builds (UP and SMP) are broken at the moment. Please
> Cc: me with the fixup patch.
Could you check the patch below? With this applied to latest -git, ia64
buils fine for me in a cross-compiling environment. (but i dont know
whether it boots ...)
Ingo
----------------->
Subject: generic: percpu infrastructure to rebase the per cpu area to zero
From: travis@sgi.com
* Support an option
CONFIG_HAVE_ZERO_BASED_PER_CPU
that makes offsets for per cpu variables to start at zero.
If a percpu area starts at zero then:
- We do not need RELOC_HIDE anymore
- Provides for the future capability of architectures providing
a per cpu allocator that returns offsets instead of pointers.
The offsets would be independent of the processor so that
address calculations can be done in a processor independent way.
Per cpu instructions can then add the processor specific offset
at the last minute possibly in an atomic instruction.
The data the linker provides is different for zero based percpu segments:
__per_cpu_load -> The address at which the percpu area was loaded
__per_cpu_size -> The length of the per cpu area
* Removes the &__per_cpu_x in lockdep. The __per_cpu_x are already
pointers. There is no need to take the address.
* Changes generic setup_per_cpu_areas to allocate per_cpu space in
node local memory. This requires a generic early_cpu_to_node function.
Signed-off-by: Mike Travis <travis@sgi.com>
Reviewed-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/ia64/Kconfig | 2 -
arch/ia64/kernel/module.c | 11 --------
arch/powerpc/Kconfig | 2 -
arch/sparc64/mm/init.c | 5 ++++
include/asm-alpha/topology.h | 1
include/asm-generic/percpu.h | 7 ++++-
include/asm-generic/sections.h | 10 ++++++++
include/asm-generic/topology.h | 3 ++
include/asm-generic/vmlinux.lds.h | 15 ++++++++++++
include/asm-ia64/percpu.h | 29 +++++------------------
include/asm-ia64/topology.h | 1
include/asm-mips/mach-ip27/topology.h | 1
include/asm-powerpc/percpu.h | 29 +----------------------
include/asm-powerpc/topology.h | 1
include/asm-s390/percpu.h | 42 +++++++---------------------------
include/asm-sparc64/percpu.h | 22 ++---------------
init/main.c | 18 ++++++++------
kernel/lockdep.c | 4 +--
18 files changed, 78 insertions(+), 125 deletions(-)
Index: linux-x86.q/arch/ia64/Kconfig
===================================================================
--- linux-x86.q.orig/arch/ia64/Kconfig
+++ linux-x86.q/arch/ia64/Kconfig
@@ -80,7 +80,7 @@ config GENERIC_TIME_VSYSCALL
bool
default y
-config ARCH_SETS_UP_PER_CPU_AREA
+config HAVE_SETUP_PER_CPU_AREA
def_bool y
config DMI
Index: linux-x86.q/arch/ia64/kernel/module.c
===================================================================
--- linux-x86.q.orig/arch/ia64/kernel/module.c
+++ linux-x86.q/arch/ia64/kernel/module.c
@@ -940,14 +940,3 @@ module_arch_cleanup (struct module *mod)
if (mod->arch.core_unw_table)
unw_remove_unwind_table(mod->arch.core_unw_table);
}
-
-#ifdef CONFIG_SMP
-void
-percpu_modcopy (void *pcpudst, const void *src, unsigned long size)
-{
- unsigned int i;
- for_each_possible_cpu(i) {
- memcpy(pcpudst + per_cpu_offset(i), src, size);
- }
-}
-#endif /* CONFIG_SMP */
Index: linux-x86.q/arch/powerpc/Kconfig
===================================================================
--- linux-x86.q.orig/arch/powerpc/Kconfig
+++ linux-x86.q/arch/powerpc/Kconfig
@@ -42,7 +42,7 @@ config GENERIC_HARDIRQS
bool
default y
-config ARCH_SETS_UP_PER_CPU_AREA
+config HAVE_SETUP_PER_CPU_AREA
def_bool PPC64
config IRQ_PER_CPU
Index: linux-x86.q/arch/sparc64/mm/init.c
===================================================================
--- linux-x86.q.orig/arch/sparc64/mm/init.c
+++ linux-x86.q/arch/sparc64/mm/init.c
@@ -1328,6 +1328,11 @@ pgd_t swapper_pg_dir[2048];
static void sun4u_pgprot_init(void);
static void sun4v_pgprot_init(void);
+/* Dummy function */
+void __init setup_per_cpu_areas(void)
+{
+}
+
void __init paging_init(void)
{
unsigned long end_pfn, pages_avail, shift, phys_base;
Index: linux-x86.q/include/asm-alpha/topology.h
===================================================================
--- linux-x86.q.orig/include/asm-alpha/topology.h
+++ linux-x86.q/include/asm-alpha/topology.h
@@ -6,6 +6,7 @@
#include <asm/machvec.h>
#ifdef CONFIG_NUMA
+#define early_cpu_to_node(cpu) cpu_to_node(cpu)
static inline int cpu_to_node(int cpu)
{
int node;
Index: linux-x86.q/include/asm-generic/percpu.h
===================================================================
--- linux-x86.q.orig/include/asm-generic/percpu.h
+++ linux-x86.q/include/asm-generic/percpu.h
@@ -43,7 +43,12 @@ extern unsigned long __per_cpu_offset[NR
* Only S390 provides its own means of moving the pointer.
*/
#ifndef SHIFT_PERCPU_PTR
-#define SHIFT_PERCPU_PTR(__p, __offset) RELOC_HIDE((__p), (__offset))
+# ifdef CONFIG_HAVE_ZERO_BASED_PER_CPU
+# define SHIFT_PERCPU_PTR(__p, __offset) \
+ ((__typeof(__p))(((void *)(__p)) + (__offset)))
+# else
+# define SHIFT_PERCPU_PTR(__p, __offset) RELOC_HIDE((__p), (__offset))
+# endif /* CONFIG_HAVE_ZERO_BASED_PER_CPU */
#endif
/*
Index: linux-x86.q/include/asm-generic/sections.h
===================================================================
--- linux-x86.q.orig/include/asm-generic/sections.h
+++ linux-x86.q/include/asm-generic/sections.h
@@ -11,7 +11,17 @@ extern char _sinittext[], _einittext[];
extern char _sextratext[] __attribute__((weak));
extern char _eextratext[] __attribute__((weak));
extern char _end[];
+#ifdef CONFIG_HAVE_ZERO_BASED_PER_CPU
+extern char __per_cpu_load[];
+extern char ____per_cpu_size[];
+#define __per_cpu_size ((unsigned long)&____per_cpu_size)
+#define __per_cpu_start ((char *)0)
+#define __per_cpu_end ((char *)__per_cpu_size)
+#else
extern char __per_cpu_start[], __per_cpu_end[];
+#define __per_cpu_load __per_cpu_start
+#define __per_cpu_size (__per_cpu_end - __per_cpu_start)
+#endif
extern char __kprobes_text_start[], __kprobes_text_end[];
extern char __initdata_begin[], __initdata_end[];
extern char __start_rodata[], __end_rodata[];
Index: linux-x86.q/include/asm-generic/topology.h
===================================================================
--- linux-x86.q.orig/include/asm-generic/topology.h
+++ linux-x86.q/include/asm-generic/topology.h
@@ -32,6 +32,9 @@
#ifndef cpu_to_node
#define cpu_to_node(cpu) (0)
#endif
+#ifndef early_cpu_to_node
+#define early_cpu_to_node(cpu) cpu_to_node(cpu)
+#endif
#ifndef parent_node
#define parent_node(node) (0)
#endif
Index: linux-x86.q/include/asm-generic/vmlinux.lds.h
===================================================================
--- linux-x86.q.orig/include/asm-generic/vmlinux.lds.h
+++ linux-x86.q/include/asm-generic/vmlinux.lds.h
@@ -341,6 +341,20 @@
*(.initcall7.init) \
*(.initcall7s.init)
+#ifdef CONFIG_HAVE_ZERO_BASED_PER_CPU
+#define PERCPU(align) \
+ . = ALIGN(align); \
+ percpu : { } :percpu \
+ __per_cpu_load = .; \
+ .data.percpu 0 : AT(__per_cpu_load - LOAD_OFFSET) { \
+ *(.data.percpu.first) \
+ *(.data.percpu) \
+ *(.data.percpu.shared_aligned) \
+ ____per_cpu_size = .; \
+ } \
+ . = __per_cpu_load + ____per_cpu_size; \
+ data : { } :data
+#else
#define PERCPU(align) \
. = ALIGN(align); \
__per_cpu_start = .; \
@@ -349,3 +363,4 @@
*(.data.percpu.shared_aligned) \
} \
__per_cpu_end = .;
+#endif
Index: linux-x86.q/include/asm-ia64/percpu.h
===================================================================
--- linux-x86.q.orig/include/asm-ia64/percpu.h
+++ linux-x86.q/include/asm-ia64/percpu.h
@@ -19,34 +19,14 @@
# define PER_CPU_ATTRIBUTES __attribute__((__model__ (__small__)))
#endif
-#define DECLARE_PER_CPU(type, name) \
- extern PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name
-
-/*
- * Pretty much a literal copy of asm-generic/percpu.h, except that percpu_modcopy() is an
- * external routine, to avoid include-hell.
- */
#ifdef CONFIG_SMP
-extern unsigned long __per_cpu_offset[NR_CPUS];
-#define per_cpu_offset(x) (__per_cpu_offset[x])
-
-/* Equal to __per_cpu_offset[smp_processor_id()], but faster to access: */
-DECLARE_PER_CPU(unsigned long, local_per_cpu_offset);
+#define __my_cpu_offset __ia64_per_cpu_var(local_per_cpu_offset)
-#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu]))
-#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __ia64_per_cpu_var(local_per_cpu_offset)))
-#define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __ia64_per_cpu_var(local_per_cpu_offset)))
-
-extern void percpu_modcopy(void *pcpudst, const void *src, unsigned long size);
-extern void setup_per_cpu_areas (void);
extern void *per_cpu_init(void);
#else /* ! SMP */
-#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var))
-#define __get_cpu_var(var) per_cpu__##var
-#define __raw_get_cpu_var(var) per_cpu__##var
#define per_cpu_init() (__phys_per_cpu_start)
#endif /* SMP */
@@ -57,7 +37,12 @@ extern void *per_cpu_init(void);
* On the positive side, using __ia64_per_cpu_var() instead of __get_cpu_var() is slightly
* more efficient.
*/
-#define __ia64_per_cpu_var(var) (per_cpu__##var)
+#define __ia64_per_cpu_var(var) per_cpu__##var
+
+#include <asm-generic/percpu.h>
+
+/* Equal to __per_cpu_offset[smp_processor_id()], but faster to access: */
+DECLARE_PER_CPU(unsigned long, local_per_cpu_offset);
#endif /* !__ASSEMBLY__ */
Index: linux-x86.q/include/asm-ia64/topology.h
===================================================================
--- linux-x86.q.orig/include/asm-ia64/topology.h
+++ linux-x86.q/include/asm-ia64/topology.h
@@ -31,6 +31,7 @@
* Returns the number of the node containing CPU 'cpu'
*/
#define cpu_to_node(cpu) (int)(cpu_to_node_map[cpu])
+#define early_cpu_to_node(cpu) cpu_to_node(cpu)
/*
* Returns a bitmask of CPUs on Node 'node'.
Index: linux-x86.q/include/asm-mips/mach-ip27/topology.h
===================================================================
--- linux-x86.q.orig/include/asm-mips/mach-ip27/topology.h
+++ linux-x86.q/include/asm-mips/mach-ip27/topology.h
@@ -23,6 +23,7 @@ struct cpuinfo_ip27 {
extern struct cpuinfo_ip27 sn_cpu_info[NR_CPUS];
#define cpu_to_node(cpu) (sn_cpu_info[(cpu)].p_nodeid)
+#define early_cpu_to_node(cpu) cpu_to_node(cpu)
#define parent_node(node) (node)
#define node_to_cpumask(node) (hub_data(node)->h_cpus)
#define node_to_first_cpu(node) (first_cpu(node_to_cpumask(node)))
Index: linux-x86.q/include/asm-powerpc/percpu.h
===================================================================
--- linux-x86.q.orig/include/asm-powerpc/percpu.h
+++ linux-x86.q/include/asm-powerpc/percpu.h
@@ -16,34 +16,9 @@
#define __my_cpu_offset() get_paca()->data_offset
#define per_cpu_offset(x) (__per_cpu_offset(x))
-/* var is in discarded region: offset to particular copy we want */
-#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu)))
-#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset()))
-#define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, local_paca->data_offset))
+#endif /* CONFIG_SMP */
+#endif /* __powerpc64__ */
-/* A macro to avoid #include hell... */
-#define percpu_modcopy(pcpudst, src, size) \
-do { \
- unsigned int __i; \
- for_each_possible_cpu(__i) \
- memcpy((pcpudst)+__per_cpu_offset(__i), \
- (src), (size)); \
-} while (0)
-
-extern void setup_per_cpu_areas(void);
-
-#else /* ! SMP */
-
-#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var))
-#define __get_cpu_var(var) per_cpu__##var
-#define __raw_get_cpu_var(var) per_cpu__##var
-
-#endif /* SMP */
-
-#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
-
-#else
#include <asm-generic/percpu.h>
-#endif
#endif /* _ASM_POWERPC_PERCPU_H_ */
Index: linux-x86.q/include/asm-powerpc/topology.h
===================================================================
--- linux-x86.q.orig/include/asm-powerpc/topology.h
+++ linux-x86.q/include/asm-powerpc/topology.h
@@ -15,6 +15,7 @@ static inline int cpu_to_node(int cpu)
return numa_cpu_lookup_table[cpu];
}
+#define early_cpu_to_node(cpu) cpu_to_node(cpu)
#define parent_node(node) (node)
static inline cpumask_t node_to_cpumask(int node)
Index: linux-x86.q/include/asm-s390/percpu.h
===================================================================
--- linux-x86.q.orig/include/asm-s390/percpu.h
+++ linux-x86.q/include/asm-s390/percpu.h
@@ -13,49 +13,25 @@
*/
#if defined(__s390x__) && defined(MODULE)
-#define __reloc_hide(var,offset) (*({ \
+#define SHIFT_PERCPU_PTR(ptr,offset) (({ \
extern int simple_identifier_##var(void); \
unsigned long *__ptr; \
- asm ( "larl %0,per_cpu__"#var"@GOTENT" \
- : "=a" (__ptr) : "X" (per_cpu__##var) ); \
- (typeof(&per_cpu__##var))((*__ptr) + (offset)); }))
+ asm ( "larl %0, %1@GOTENT" \
+ : "=a" (__ptr) : "X" (ptr) ); \
+ (typeof(ptr))((*__ptr) + (offset)); }))
#else
-#define __reloc_hide(var, offset) (*({ \
+#define SHIFT_PERCPU_PTR(ptr, offset) (({ \
extern int simple_identifier_##var(void); \
unsigned long __ptr; \
- asm ( "" : "=a" (__ptr) : "0" (&per_cpu__##var) ); \
- (typeof(&per_cpu__##var)) (__ptr + (offset)); }))
+ asm ( "" : "=a" (__ptr) : "0" (ptr) ); \
+ (typeof(ptr)) (__ptr + (offset)); }))
#endif
-#ifdef CONFIG_SMP
+#define __my_cpu_offset S390_lowcore.percpu_offset
-extern unsigned long __per_cpu_offset[NR_CPUS];
-
-#define __get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset)
-#define __raw_get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset)
-#define per_cpu(var,cpu) __reloc_hide(var,__per_cpu_offset[cpu])
-#define per_cpu_offset(x) (__per_cpu_offset[x])
-
-/* A macro to avoid #include hell... */
-#define percpu_modcopy(pcpudst, src, size) \
-do { \
- unsigned int __i; \
- for_each_possible_cpu(__i) \
- memcpy((pcpudst)+__per_cpu_offset[__i], \
- (src), (size)); \
-} while (0)
-
-#else /* ! SMP */
-
-#define __get_cpu_var(var) __reloc_hide(var,0)
-#define __raw_get_cpu_var(var) __reloc_hide(var,0)
-#define per_cpu(var,cpu) __reloc_hide(var,0)
-
-#endif /* SMP */
-
-#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
+#include <asm-generic/percpu.h>
#endif /* __ARCH_S390_PERCPU__ */
Index: linux-x86.q/include/asm-sparc64/percpu.h
===================================================================
--- linux-x86.q.orig/include/asm-sparc64/percpu.h
+++ linux-x86.q/include/asm-sparc64/percpu.h
@@ -7,7 +7,6 @@ register unsigned long __local_per_cpu_o
#ifdef CONFIG_SMP
-#define setup_per_cpu_areas() do { } while (0)
extern void real_setup_per_cpu_areas(void);
extern unsigned long __per_cpu_base;
@@ -16,29 +15,14 @@ extern unsigned long __per_cpu_shift;
(__per_cpu_base + ((unsigned long)(__cpu) << __per_cpu_shift))
#define per_cpu_offset(x) (__per_cpu_offset(x))
-/* var is in discarded region: offset to particular copy we want */
-#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu)))
-#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __local_per_cpu_offset))
-#define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __local_per_cpu_offset))
-
-/* A macro to avoid #include hell... */
-#define percpu_modcopy(pcpudst, src, size) \
-do { \
- unsigned int __i; \
- for_each_possible_cpu(__i) \
- memcpy((pcpudst)+__per_cpu_offset(__i), \
- (src), (size)); \
-} while (0)
+#define __my_cpu_offset __local_per_cpu_offset
+
#else /* ! SMP */
#define real_setup_per_cpu_areas() do { } while (0)
-#define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var))
-#define __get_cpu_var(var) per_cpu__##var
-#define __raw_get_cpu_var(var) per_cpu__##var
-
#endif /* SMP */
-#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
+#include <asm-generic/percpu.h>
#endif /* __ARCH_SPARC64_PERCPU__ */
Index: linux-x86.q/init/main.c
===================================================================
--- linux-x86.q.orig/init/main.c
+++ linux-x86.q/init/main.c
@@ -374,18 +374,20 @@ EXPORT_SYMBOL(__per_cpu_offset);
static void __init setup_per_cpu_areas(void)
{
- unsigned long size, i;
- char *ptr;
- unsigned long nr_possible_cpus = num_possible_cpus();
+ unsigned long size;
+ int cpu;
/* Copy section for each CPU (we discard the original) */
size = ALIGN(PERCPU_ENOUGH_ROOM, PAGE_SIZE);
- ptr = alloc_bootmem_pages(size * nr_possible_cpus);
- for_each_possible_cpu(i) {
- __per_cpu_offset[i] = ptr - __per_cpu_start;
- memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start);
- ptr += size;
+ printk(KERN_INFO "(generic)PERCPU: Allocating %lu bytes of per cpu data\n", size);
+
+ for_each_possible_cpu(cpu) {
+ char *ptr = alloc_bootmem_pages_node(
+ NODE_DATA(early_cpu_to_node(cpu)), size);
+
+ __per_cpu_offset[cpu] = ptr - __per_cpu_start;
+ memcpy(ptr, __per_cpu_load, __per_cpu_size);
}
}
#endif /* CONFIG_HAVE_SETUP_PER_CPU_AREA */
Index: linux-x86.q/kernel/lockdep.c
===================================================================
--- linux-x86.q.orig/kernel/lockdep.c
+++ linux-x86.q/kernel/lockdep.c
@@ -609,8 +609,8 @@ static int static_obj(void *obj)
* percpu var?
*/
for_each_possible_cpu(i) {
- start = (unsigned long) &__per_cpu_start + per_cpu_offset(i);
- end = (unsigned long) &__per_cpu_start + PERCPU_ENOUGH_ROOM
+ start = (unsigned long) __per_cpu_start + per_cpu_offset(i);
+ end = (unsigned long) __per_cpu_start + PERCPU_ENOUGH_ROOM
+ per_cpu_offset(i);
if ((addr >= start) && (addr < end))
^ permalink raw reply
* [PATCH 2/6] percpu: Change Kconfig to HAVE_SETUP_PER_CPU_AREA linux-2.6.git
From: travis @ 2008-01-30 18:09 UTC (permalink / raw)
To: Geert Uytterhoeven, Linus Torvalds, mingo, Thomas Gleixner
Cc: Tony Luck, linux-ia64, linuxppc-dev, Rusty Russell, Andi Kleen,
linux-kernel, linux-mm, Sam Ravnborg, David Miller,
Christoph Lameter
In-Reply-To: <20080130180940.022172000@sgi.com>
Change:
config ARCH_SETS_UP_PER_CPU_AREA
to:
config HAVE_SETUP_PER_CPU_AREA
Based on latest linux-2.6.git
Cc: Andi Kleen <ak@suse.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: David Miller <davem@davemloft.net>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: linuxppc-dev@ozlabs.org
Cc: linux-ia64@vger.kernel.org
Signed-off-by: Mike Travis <travis@sgi.com>
---
linux-2.6.git:
- added back in missing pieces from x86.git merge
The change to using "select xxx" as suggested by Sam
requires an addition to a non-existant file (arch/Kconfig)
so I went back to using "config xxx" to introduce the flag.
---
arch/ia64/Kconfig | 2 +-
arch/powerpc/Kconfig | 2 +-
arch/sparc64/Kconfig | 2 +-
init/main.c | 2 ++
4 files changed, 5 insertions(+), 3 deletions(-)
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -80,7 +80,7 @@ config GENERIC_TIME_VSYSCALL
bool
default y
-config ARCH_SETS_UP_PER_CPU_AREA
+config HAVE_SETUP_PER_CPU_AREA
def_bool y
config DMI
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -42,7 +42,7 @@ config GENERIC_HARDIRQS
bool
default y
-config ARCH_SETS_UP_PER_CPU_AREA
+config HAVE_SETUP_PER_CPU_AREA
def_bool PPC64
config IRQ_PER_CPU
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -66,7 +66,7 @@ config AUDIT_ARCH
bool
default y
-config ARCH_SETS_UP_PER_CPU_AREA
+config HAVE_SETUP_PER_CPU_AREA
def_bool y
config ARCH_NO_VIRT_TO_BUS
--- a/init/main.c
+++ b/init/main.c
@@ -380,6 +380,8 @@ static void __init setup_per_cpu_areas(v
/* Copy section for each CPU (we discard the original) */
size = ALIGN(PERCPU_ENOUGH_ROOM, PAGE_SIZE);
+ printk(KERN_INFO
+ "PERCPU: Allocating %lu bytes of per cpu data (main)\n", size);
ptr = alloc_bootmem_pages(size * nr_possible_cpus);
for_each_possible_cpu(i) {
--
^ permalink raw reply
* [PATCH 1/6] modules: Fold percpu_modcopy into module.c linux-2.6.git
From: travis @ 2008-01-30 18:09 UTC (permalink / raw)
To: Geert Uytterhoeven, Linus Torvalds, mingo, Thomas Gleixner
Cc: Tony Luck, linux-ia64, linuxppc-dev, Rusty Russell, Andi Kleen,
linux-kernel, linux-mm, David Miller, Christoph Lameter
In-Reply-To: <20080130180940.022172000@sgi.com>
percpu_modcopy() is defined multiple times in arch files. However, the only
user is module.c. Put a static definition into module.c and remove
the definitions from the arch files.
Based on latest linux-2.6.git
Cc: Andi Kleen <ak@suse.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: David Miller <davem@davemloft.net>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: linuxppc-dev@ozlabs.org
Cc: linux-ia64@vger.kernel.org
Signed-off-by: Mike Travis <travis@sgi.com>
---
linux-2.6.git:
- added back in missing pieces from x86.git merge
---
arch/ia64/kernel/module.c | 11 -----------
include/asm-ia64/percpu.h | 5 -----
include/asm-powerpc/percpu.h | 9 ---------
include/asm-s390/percpu.h | 9 ---------
4 files changed, 34 deletions(-)
--- a/arch/ia64/kernel/module.c
+++ b/arch/ia64/kernel/module.c
@@ -940,14 +940,3 @@ module_arch_cleanup (struct module *mod)
if (mod->arch.core_unw_table)
unw_remove_unwind_table(mod->arch.core_unw_table);
}
-
-#ifdef CONFIG_SMP
-void
-percpu_modcopy (void *pcpudst, const void *src, unsigned long size)
-{
- unsigned int i;
- for_each_possible_cpu(i) {
- memcpy(pcpudst + per_cpu_offset(i), src, size);
- }
-}
-#endif /* CONFIG_SMP */
--- a/include/asm-ia64/percpu.h
+++ b/include/asm-ia64/percpu.h
@@ -22,10 +22,6 @@
#define DECLARE_PER_CPU(type, name) \
extern PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name
-/*
- * Pretty much a literal copy of asm-generic/percpu.h, except that percpu_modcopy() is an
- * external routine, to avoid include-hell.
- */
#ifdef CONFIG_SMP
extern unsigned long __per_cpu_offset[NR_CPUS];
@@ -38,7 +34,6 @@ DECLARE_PER_CPU(unsigned long, local_per
#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __ia64_per_cpu_var(local_per_cpu_offset)))
#define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __ia64_per_cpu_var(local_per_cpu_offset)))
-extern void percpu_modcopy(void *pcpudst, const void *src, unsigned long size);
extern void setup_per_cpu_areas (void);
extern void *per_cpu_init(void);
--- a/include/asm-powerpc/percpu.h
+++ b/include/asm-powerpc/percpu.h
@@ -21,15 +21,6 @@
#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset()))
#define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, local_paca->data_offset))
-/* A macro to avoid #include hell... */
-#define percpu_modcopy(pcpudst, src, size) \
-do { \
- unsigned int __i; \
- for_each_possible_cpu(__i) \
- memcpy((pcpudst)+__per_cpu_offset(__i), \
- (src), (size)); \
-} while (0)
-
extern void setup_per_cpu_areas(void);
#else /* ! SMP */
--- a/include/asm-s390/percpu.h
+++ b/include/asm-s390/percpu.h
@@ -39,15 +39,6 @@ extern unsigned long __per_cpu_offset[NR
#define per_cpu(var,cpu) __reloc_hide(var,__per_cpu_offset[cpu])
#define per_cpu_offset(x) (__per_cpu_offset[x])
-/* A macro to avoid #include hell... */
-#define percpu_modcopy(pcpudst, src, size) \
-do { \
- unsigned int __i; \
- for_each_possible_cpu(__i) \
- memcpy((pcpudst)+__per_cpu_offset[__i], \
- (src), (size)); \
-} while (0)
-
#else /* ! SMP */
#define __get_cpu_var(var) __reloc_hide(var,0)
--
^ permalink raw reply
* Re: x86/non-x86: percpu, node ids, apic ids x86.git fixup
From: Mike Travis @ 2008-01-30 18:20 UTC (permalink / raw)
To: Ingo Molnar
Cc: sparclinux, Luck, Tony, linux-ia64, Linux Kernel Development,
Linux/PPC Development, Geert Uytterhoeven, Thomas Gleixner,
Linus Torvalds
In-Reply-To: <20080130180623.GA24881@elte.hu>
Ingo Molnar wrote:
> * Luck, Tony <tony.luck@intel.com> wrote:
>
>>> thanks! Sorry about that: we cross-built on ARM but not on SMP
>>> non-x86 platforms so this dependency/breakage went unnoticed.
>> Yes ... all ia64 builds (UP and SMP) are broken at the moment. Please
>> Cc: me with the fixup patch.
>
> Could you check the patch below? With this applied to latest -git, ia64
> buils fine for me in a cross-compiling environment. (but i dont know
> whether it boots ...)
>
> Ingo
This patch is from a different patch set (aka "zero-based" patch). That
one will be updated and resubmitted soon...
Thanks,
Mike
>
> ----------------->
> Subject: generic: percpu infrastructure to rebase the per cpu area to zero
> From: travis@sgi.com
>
> * Support an option
>
> CONFIG_HAVE_ZERO_BASED_PER_CPU
>
> that makes offsets for per cpu variables to start at zero.
>
> If a percpu area starts at zero then:
>
> - We do not need RELOC_HIDE anymore
>
> - Provides for the future capability of architectures providing
> a per cpu allocator that returns offsets instead of pointers.
> The offsets would be independent of the processor so that
> address calculations can be done in a processor independent way.
> Per cpu instructions can then add the processor specific offset
> at the last minute possibly in an atomic instruction.
>
> The data the linker provides is different for zero based percpu segments:
>
> __per_cpu_load -> The address at which the percpu area was loaded
> __per_cpu_size -> The length of the per cpu area
>
> * Removes the &__per_cpu_x in lockdep. The __per_cpu_x are already
> pointers. There is no need to take the address.
>
> * Changes generic setup_per_cpu_areas to allocate per_cpu space in
> node local memory. This requires a generic early_cpu_to_node function.
>
> Signed-off-by: Mike Travis <travis@sgi.com>
> Reviewed-by: Christoph Lameter <clameter@sgi.com>
> Signed-off-by: Ingo Molnar <mingo@elte.hu>
> ---
> arch/ia64/Kconfig | 2 -
> arch/ia64/kernel/module.c | 11 --------
> arch/powerpc/Kconfig | 2 -
> arch/sparc64/mm/init.c | 5 ++++
> include/asm-alpha/topology.h | 1
> include/asm-generic/percpu.h | 7 ++++-
> include/asm-generic/sections.h | 10 ++++++++
> include/asm-generic/topology.h | 3 ++
> include/asm-generic/vmlinux.lds.h | 15 ++++++++++++
> include/asm-ia64/percpu.h | 29 +++++------------------
> include/asm-ia64/topology.h | 1
> include/asm-mips/mach-ip27/topology.h | 1
> include/asm-powerpc/percpu.h | 29 +----------------------
> include/asm-powerpc/topology.h | 1
> include/asm-s390/percpu.h | 42 +++++++---------------------------
> include/asm-sparc64/percpu.h | 22 ++---------------
> init/main.c | 18 ++++++++------
> kernel/lockdep.c | 4 +--
> 18 files changed, 78 insertions(+), 125 deletions(-)
>
> Index: linux-x86.q/arch/ia64/Kconfig
> ===================================================================
> --- linux-x86.q.orig/arch/ia64/Kconfig
> +++ linux-x86.q/arch/ia64/Kconfig
> @@ -80,7 +80,7 @@ config GENERIC_TIME_VSYSCALL
> bool
> default y
>
> -config ARCH_SETS_UP_PER_CPU_AREA
> +config HAVE_SETUP_PER_CPU_AREA
> def_bool y
>
> config DMI
> Index: linux-x86.q/arch/ia64/kernel/module.c
> ===================================================================
> --- linux-x86.q.orig/arch/ia64/kernel/module.c
> +++ linux-x86.q/arch/ia64/kernel/module.c
> @@ -940,14 +940,3 @@ module_arch_cleanup (struct module *mod)
> if (mod->arch.core_unw_table)
> unw_remove_unwind_table(mod->arch.core_unw_table);
> }
> -
> -#ifdef CONFIG_SMP
> -void
> -percpu_modcopy (void *pcpudst, const void *src, unsigned long size)
> -{
> - unsigned int i;
> - for_each_possible_cpu(i) {
> - memcpy(pcpudst + per_cpu_offset(i), src, size);
> - }
> -}
> -#endif /* CONFIG_SMP */
> Index: linux-x86.q/arch/powerpc/Kconfig
> ===================================================================
> --- linux-x86.q.orig/arch/powerpc/Kconfig
> +++ linux-x86.q/arch/powerpc/Kconfig
> @@ -42,7 +42,7 @@ config GENERIC_HARDIRQS
> bool
> default y
>
> -config ARCH_SETS_UP_PER_CPU_AREA
> +config HAVE_SETUP_PER_CPU_AREA
> def_bool PPC64
>
> config IRQ_PER_CPU
> Index: linux-x86.q/arch/sparc64/mm/init.c
> ===================================================================
> --- linux-x86.q.orig/arch/sparc64/mm/init.c
> +++ linux-x86.q/arch/sparc64/mm/init.c
> @@ -1328,6 +1328,11 @@ pgd_t swapper_pg_dir[2048];
> static void sun4u_pgprot_init(void);
> static void sun4v_pgprot_init(void);
>
> +/* Dummy function */
> +void __init setup_per_cpu_areas(void)
> +{
> +}
> +
> void __init paging_init(void)
> {
> unsigned long end_pfn, pages_avail, shift, phys_base;
> Index: linux-x86.q/include/asm-alpha/topology.h
> ===================================================================
> --- linux-x86.q.orig/include/asm-alpha/topology.h
> +++ linux-x86.q/include/asm-alpha/topology.h
> @@ -6,6 +6,7 @@
> #include <asm/machvec.h>
>
> #ifdef CONFIG_NUMA
> +#define early_cpu_to_node(cpu) cpu_to_node(cpu)
> static inline int cpu_to_node(int cpu)
> {
> int node;
> Index: linux-x86.q/include/asm-generic/percpu.h
> ===================================================================
> --- linux-x86.q.orig/include/asm-generic/percpu.h
> +++ linux-x86.q/include/asm-generic/percpu.h
> @@ -43,7 +43,12 @@ extern unsigned long __per_cpu_offset[NR
> * Only S390 provides its own means of moving the pointer.
> */
> #ifndef SHIFT_PERCPU_PTR
> -#define SHIFT_PERCPU_PTR(__p, __offset) RELOC_HIDE((__p), (__offset))
> +# ifdef CONFIG_HAVE_ZERO_BASED_PER_CPU
> +# define SHIFT_PERCPU_PTR(__p, __offset) \
> + ((__typeof(__p))(((void *)(__p)) + (__offset)))
> +# else
> +# define SHIFT_PERCPU_PTR(__p, __offset) RELOC_HIDE((__p), (__offset))
> +# endif /* CONFIG_HAVE_ZERO_BASED_PER_CPU */
> #endif
>
> /*
> Index: linux-x86.q/include/asm-generic/sections.h
> ===================================================================
> --- linux-x86.q.orig/include/asm-generic/sections.h
> +++ linux-x86.q/include/asm-generic/sections.h
> @@ -11,7 +11,17 @@ extern char _sinittext[], _einittext[];
> extern char _sextratext[] __attribute__((weak));
> extern char _eextratext[] __attribute__((weak));
> extern char _end[];
> +#ifdef CONFIG_HAVE_ZERO_BASED_PER_CPU
> +extern char __per_cpu_load[];
> +extern char ____per_cpu_size[];
> +#define __per_cpu_size ((unsigned long)&____per_cpu_size)
> +#define __per_cpu_start ((char *)0)
> +#define __per_cpu_end ((char *)__per_cpu_size)
> +#else
> extern char __per_cpu_start[], __per_cpu_end[];
> +#define __per_cpu_load __per_cpu_start
> +#define __per_cpu_size (__per_cpu_end - __per_cpu_start)
> +#endif
> extern char __kprobes_text_start[], __kprobes_text_end[];
> extern char __initdata_begin[], __initdata_end[];
> extern char __start_rodata[], __end_rodata[];
> Index: linux-x86.q/include/asm-generic/topology.h
> ===================================================================
> --- linux-x86.q.orig/include/asm-generic/topology.h
> +++ linux-x86.q/include/asm-generic/topology.h
> @@ -32,6 +32,9 @@
> #ifndef cpu_to_node
> #define cpu_to_node(cpu) (0)
> #endif
> +#ifndef early_cpu_to_node
> +#define early_cpu_to_node(cpu) cpu_to_node(cpu)
> +#endif
> #ifndef parent_node
> #define parent_node(node) (0)
> #endif
> Index: linux-x86.q/include/asm-generic/vmlinux.lds.h
> ===================================================================
> --- linux-x86.q.orig/include/asm-generic/vmlinux.lds.h
> +++ linux-x86.q/include/asm-generic/vmlinux.lds.h
> @@ -341,6 +341,20 @@
> *(.initcall7.init) \
> *(.initcall7s.init)
>
> +#ifdef CONFIG_HAVE_ZERO_BASED_PER_CPU
> +#define PERCPU(align) \
> + . = ALIGN(align); \
> + percpu : { } :percpu \
> + __per_cpu_load = .; \
> + .data.percpu 0 : AT(__per_cpu_load - LOAD_OFFSET) { \
> + *(.data.percpu.first) \
> + *(.data.percpu) \
> + *(.data.percpu.shared_aligned) \
> + ____per_cpu_size = .; \
> + } \
> + . = __per_cpu_load + ____per_cpu_size; \
> + data : { } :data
> +#else
> #define PERCPU(align) \
> . = ALIGN(align); \
> __per_cpu_start = .; \
> @@ -349,3 +363,4 @@
> *(.data.percpu.shared_aligned) \
> } \
> __per_cpu_end = .;
> +#endif
> Index: linux-x86.q/include/asm-ia64/percpu.h
> ===================================================================
> --- linux-x86.q.orig/include/asm-ia64/percpu.h
> +++ linux-x86.q/include/asm-ia64/percpu.h
> @@ -19,34 +19,14 @@
> # define PER_CPU_ATTRIBUTES __attribute__((__model__ (__small__)))
> #endif
>
> -#define DECLARE_PER_CPU(type, name) \
> - extern PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name
> -
> -/*
> - * Pretty much a literal copy of asm-generic/percpu.h, except that percpu_modcopy() is an
> - * external routine, to avoid include-hell.
> - */
> #ifdef CONFIG_SMP
>
> -extern unsigned long __per_cpu_offset[NR_CPUS];
> -#define per_cpu_offset(x) (__per_cpu_offset[x])
> -
> -/* Equal to __per_cpu_offset[smp_processor_id()], but faster to access: */
> -DECLARE_PER_CPU(unsigned long, local_per_cpu_offset);
> +#define __my_cpu_offset __ia64_per_cpu_var(local_per_cpu_offset)
>
> -#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu]))
> -#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __ia64_per_cpu_var(local_per_cpu_offset)))
> -#define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __ia64_per_cpu_var(local_per_cpu_offset)))
> -
> -extern void percpu_modcopy(void *pcpudst, const void *src, unsigned long size);
> -extern void setup_per_cpu_areas (void);
> extern void *per_cpu_init(void);
>
> #else /* ! SMP */
>
> -#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var))
> -#define __get_cpu_var(var) per_cpu__##var
> -#define __raw_get_cpu_var(var) per_cpu__##var
> #define per_cpu_init() (__phys_per_cpu_start)
>
> #endif /* SMP */
> @@ -57,7 +37,12 @@ extern void *per_cpu_init(void);
> * On the positive side, using __ia64_per_cpu_var() instead of __get_cpu_var() is slightly
> * more efficient.
> */
> -#define __ia64_per_cpu_var(var) (per_cpu__##var)
> +#define __ia64_per_cpu_var(var) per_cpu__##var
> +
> +#include <asm-generic/percpu.h>
> +
> +/* Equal to __per_cpu_offset[smp_processor_id()], but faster to access: */
> +DECLARE_PER_CPU(unsigned long, local_per_cpu_offset);
>
> #endif /* !__ASSEMBLY__ */
>
> Index: linux-x86.q/include/asm-ia64/topology.h
> ===================================================================
> --- linux-x86.q.orig/include/asm-ia64/topology.h
> +++ linux-x86.q/include/asm-ia64/topology.h
> @@ -31,6 +31,7 @@
> * Returns the number of the node containing CPU 'cpu'
> */
> #define cpu_to_node(cpu) (int)(cpu_to_node_map[cpu])
> +#define early_cpu_to_node(cpu) cpu_to_node(cpu)
>
> /*
> * Returns a bitmask of CPUs on Node 'node'.
> Index: linux-x86.q/include/asm-mips/mach-ip27/topology.h
> ===================================================================
> --- linux-x86.q.orig/include/asm-mips/mach-ip27/topology.h
> +++ linux-x86.q/include/asm-mips/mach-ip27/topology.h
> @@ -23,6 +23,7 @@ struct cpuinfo_ip27 {
> extern struct cpuinfo_ip27 sn_cpu_info[NR_CPUS];
>
> #define cpu_to_node(cpu) (sn_cpu_info[(cpu)].p_nodeid)
> +#define early_cpu_to_node(cpu) cpu_to_node(cpu)
> #define parent_node(node) (node)
> #define node_to_cpumask(node) (hub_data(node)->h_cpus)
> #define node_to_first_cpu(node) (first_cpu(node_to_cpumask(node)))
> Index: linux-x86.q/include/asm-powerpc/percpu.h
> ===================================================================
> --- linux-x86.q.orig/include/asm-powerpc/percpu.h
> +++ linux-x86.q/include/asm-powerpc/percpu.h
> @@ -16,34 +16,9 @@
> #define __my_cpu_offset() get_paca()->data_offset
> #define per_cpu_offset(x) (__per_cpu_offset(x))
>
> -/* var is in discarded region: offset to particular copy we want */
> -#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu)))
> -#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset()))
> -#define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, local_paca->data_offset))
> +#endif /* CONFIG_SMP */
> +#endif /* __powerpc64__ */
>
> -/* A macro to avoid #include hell... */
> -#define percpu_modcopy(pcpudst, src, size) \
> -do { \
> - unsigned int __i; \
> - for_each_possible_cpu(__i) \
> - memcpy((pcpudst)+__per_cpu_offset(__i), \
> - (src), (size)); \
> -} while (0)
> -
> -extern void setup_per_cpu_areas(void);
> -
> -#else /* ! SMP */
> -
> -#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var))
> -#define __get_cpu_var(var) per_cpu__##var
> -#define __raw_get_cpu_var(var) per_cpu__##var
> -
> -#endif /* SMP */
> -
> -#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
> -
> -#else
> #include <asm-generic/percpu.h>
> -#endif
>
> #endif /* _ASM_POWERPC_PERCPU_H_ */
> Index: linux-x86.q/include/asm-powerpc/topology.h
> ===================================================================
> --- linux-x86.q.orig/include/asm-powerpc/topology.h
> +++ linux-x86.q/include/asm-powerpc/topology.h
> @@ -15,6 +15,7 @@ static inline int cpu_to_node(int cpu)
> return numa_cpu_lookup_table[cpu];
> }
>
> +#define early_cpu_to_node(cpu) cpu_to_node(cpu)
> #define parent_node(node) (node)
>
> static inline cpumask_t node_to_cpumask(int node)
> Index: linux-x86.q/include/asm-s390/percpu.h
> ===================================================================
> --- linux-x86.q.orig/include/asm-s390/percpu.h
> +++ linux-x86.q/include/asm-s390/percpu.h
> @@ -13,49 +13,25 @@
> */
> #if defined(__s390x__) && defined(MODULE)
>
> -#define __reloc_hide(var,offset) (*({ \
> +#define SHIFT_PERCPU_PTR(ptr,offset) (({ \
> extern int simple_identifier_##var(void); \
> unsigned long *__ptr; \
> - asm ( "larl %0,per_cpu__"#var"@GOTENT" \
> - : "=a" (__ptr) : "X" (per_cpu__##var) ); \
> - (typeof(&per_cpu__##var))((*__ptr) + (offset)); }))
> + asm ( "larl %0, %1@GOTENT" \
> + : "=a" (__ptr) : "X" (ptr) ); \
> + (typeof(ptr))((*__ptr) + (offset)); }))
>
> #else
>
> -#define __reloc_hide(var, offset) (*({ \
> +#define SHIFT_PERCPU_PTR(ptr, offset) (({ \
> extern int simple_identifier_##var(void); \
> unsigned long __ptr; \
> - asm ( "" : "=a" (__ptr) : "0" (&per_cpu__##var) ); \
> - (typeof(&per_cpu__##var)) (__ptr + (offset)); }))
> + asm ( "" : "=a" (__ptr) : "0" (ptr) ); \
> + (typeof(ptr)) (__ptr + (offset)); }))
>
> #endif
>
> -#ifdef CONFIG_SMP
> +#define __my_cpu_offset S390_lowcore.percpu_offset
>
> -extern unsigned long __per_cpu_offset[NR_CPUS];
> -
> -#define __get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset)
> -#define __raw_get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset)
> -#define per_cpu(var,cpu) __reloc_hide(var,__per_cpu_offset[cpu])
> -#define per_cpu_offset(x) (__per_cpu_offset[x])
> -
> -/* A macro to avoid #include hell... */
> -#define percpu_modcopy(pcpudst, src, size) \
> -do { \
> - unsigned int __i; \
> - for_each_possible_cpu(__i) \
> - memcpy((pcpudst)+__per_cpu_offset[__i], \
> - (src), (size)); \
> -} while (0)
> -
> -#else /* ! SMP */
> -
> -#define __get_cpu_var(var) __reloc_hide(var,0)
> -#define __raw_get_cpu_var(var) __reloc_hide(var,0)
> -#define per_cpu(var,cpu) __reloc_hide(var,0)
> -
> -#endif /* SMP */
> -
> -#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
> +#include <asm-generic/percpu.h>
>
> #endif /* __ARCH_S390_PERCPU__ */
> Index: linux-x86.q/include/asm-sparc64/percpu.h
> ===================================================================
> --- linux-x86.q.orig/include/asm-sparc64/percpu.h
> +++ linux-x86.q/include/asm-sparc64/percpu.h
> @@ -7,7 +7,6 @@ register unsigned long __local_per_cpu_o
>
> #ifdef CONFIG_SMP
>
> -#define setup_per_cpu_areas() do { } while (0)
> extern void real_setup_per_cpu_areas(void);
>
> extern unsigned long __per_cpu_base;
> @@ -16,29 +15,14 @@ extern unsigned long __per_cpu_shift;
> (__per_cpu_base + ((unsigned long)(__cpu) << __per_cpu_shift))
> #define per_cpu_offset(x) (__per_cpu_offset(x))
>
> -/* var is in discarded region: offset to particular copy we want */
> -#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu)))
> -#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __local_per_cpu_offset))
> -#define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __local_per_cpu_offset))
> -
> -/* A macro to avoid #include hell... */
> -#define percpu_modcopy(pcpudst, src, size) \
> -do { \
> - unsigned int __i; \
> - for_each_possible_cpu(__i) \
> - memcpy((pcpudst)+__per_cpu_offset(__i), \
> - (src), (size)); \
> -} while (0)
> +#define __my_cpu_offset __local_per_cpu_offset
> +
> #else /* ! SMP */
>
> #define real_setup_per_cpu_areas() do { } while (0)
>
> -#define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var))
> -#define __get_cpu_var(var) per_cpu__##var
> -#define __raw_get_cpu_var(var) per_cpu__##var
> -
> #endif /* SMP */
>
> -#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
> +#include <asm-generic/percpu.h>
>
> #endif /* __ARCH_SPARC64_PERCPU__ */
> Index: linux-x86.q/init/main.c
> ===================================================================
> --- linux-x86.q.orig/init/main.c
> +++ linux-x86.q/init/main.c
> @@ -374,18 +374,20 @@ EXPORT_SYMBOL(__per_cpu_offset);
>
> static void __init setup_per_cpu_areas(void)
> {
> - unsigned long size, i;
> - char *ptr;
> - unsigned long nr_possible_cpus = num_possible_cpus();
> + unsigned long size;
> + int cpu;
>
> /* Copy section for each CPU (we discard the original) */
> size = ALIGN(PERCPU_ENOUGH_ROOM, PAGE_SIZE);
> - ptr = alloc_bootmem_pages(size * nr_possible_cpus);
>
> - for_each_possible_cpu(i) {
> - __per_cpu_offset[i] = ptr - __per_cpu_start;
> - memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start);
> - ptr += size;
> + printk(KERN_INFO "(generic)PERCPU: Allocating %lu bytes of per cpu data\n", size);
> +
> + for_each_possible_cpu(cpu) {
> + char *ptr = alloc_bootmem_pages_node(
> + NODE_DATA(early_cpu_to_node(cpu)), size);
> +
> + __per_cpu_offset[cpu] = ptr - __per_cpu_start;
> + memcpy(ptr, __per_cpu_load, __per_cpu_size);
> }
> }
> #endif /* CONFIG_HAVE_SETUP_PER_CPU_AREA */
> Index: linux-x86.q/kernel/lockdep.c
> ===================================================================
> --- linux-x86.q.orig/kernel/lockdep.c
> +++ linux-x86.q/kernel/lockdep.c
> @@ -609,8 +609,8 @@ static int static_obj(void *obj)
> * percpu var?
> */
> for_each_possible_cpu(i) {
> - start = (unsigned long) &__per_cpu_start + per_cpu_offset(i);
> - end = (unsigned long) &__per_cpu_start + PERCPU_ENOUGH_ROOM
> + start = (unsigned long) __per_cpu_start + per_cpu_offset(i);
> + end = (unsigned long) __per_cpu_start + PERCPU_ENOUGH_ROOM
> + per_cpu_offset(i);
>
> if ((addr >= start) && (addr < end))
^ permalink raw reply
* RE: x86/non-x86: percpu, node ids, apic ids x86.git fixup
From: Luck, Tony @ 2008-01-30 18:31 UTC (permalink / raw)
To: Ingo Molnar
Cc: sparclinux, linux-ia64, Linux Kernel Development, Mike Travis,
Linux/PPC Development, Geert Uytterhoeven, Thomas Gleixner,
Linus Torvalds
In-Reply-To: <20080130180623.GA24881@elte.hu>
> Could you check the patch below? With this applied to latest -git, =
ia64=20
> buils fine for me in a cross-compiling environment. (but i dont know=20
> whether it boots ...)
Uni-processor build still fails with this patch (config is =
arch/ia64/configs/tiger_defconfig
with CONFIG_SMP switched from =3Dy to =3Dn).
arch/ia64/kernel/built-in.o(.text+0x5012): In function =
`show_interrupts':
: relocation truncated to fit: IMM22 per_cpu__kstat
arch/ia64/kernel/built-in.o(.text+0x53e1): In function =
`__bind_irq_vector':
: relocation truncated to fit: IMM22 per_cpu__vector_irq
arch/ia64/kernel/built-in.o(.text+0x5612): In function =
`__clear_irq_vector':
: relocation truncated to fit: IMM22 per_cpu__vector_irq
arch/ia64/kernel/built-in.o(.text+0x5a81): In function =
`__setup_vector_irq':
: relocation truncated to fit: IMM22 per_cpu__vector_irq
arch/ia64/kernel/built-in.o(.text+0x6231): In function =
`ia64_handle_irq':
: relocation truncated to fit: IMM22 per_cpu____irq_regs
arch/ia64/kernel/built-in.o(.text+0x6272): In function =
`ia64_handle_irq':
: relocation truncated to fit: IMM22 per_cpu__vector_irq
arch/ia64/kernel/built-in.o(.text+0x7b81): In function `cpu_idle_wait':
: relocation truncated to fit: IMM22 .text
arch/ia64/kernel/built-in.o(.text+0x7e21): In function `cpu_idle':
: relocation truncated to fit: IMM22 .text
arch/ia64/kernel/built-in.o(.text+0x7fd1): In function =
`ia64_save_extra':
: relocation truncated to fit: IMM22 per_cpu__pfm_syst_info
arch/ia64/kernel/built-in.o(.text+0x8071): In function =
`ia64_load_extra':
: relocation truncated to fit: IMM22 per_cpu__pfm_syst_info
arch/ia64/kernel/built-in.o(.text+0x95c0): In function =
`pfm_write_ibr_dbr':
: additional relocation overflows omitted from the output
ld: final link failed: Nonrepresentable section on output
make: *** [.tmp_vmlinux1] Error 1
SMP build (config zx1_defconfig) builds ok and boots ok too.
-Tony
^ permalink raw reply
* Re: x86/non-x86: percpu, node ids, apic ids x86.git fixup
From: Olof Johansson @ 2008-01-30 18:35 UTC (permalink / raw)
To: Ingo Molnar
Cc: Luck, Tony, linux-ia64, Linux Kernel Development, Mike Travis,
Linux/PPC Development, Geert Uytterhoeven, sparclinux,
Thomas Gleixner, Linus Torvalds
In-Reply-To: <20080130180623.GA24881@elte.hu>
On Wed, Jan 30, 2008 at 07:06:23PM +0100, Ingo Molnar wrote:
>
> * Luck, Tony <tony.luck@intel.com> wrote:
>
> > > thanks! Sorry about that: we cross-built on ARM but not on SMP
> > > non-x86 platforms so this dependency/breakage went unnoticed.
> >
> > Yes ... all ia64 builds (UP and SMP) are broken at the moment. Please
> > Cc: me with the fixup patch.
>
> Could you check the patch below? With this applied to latest -git, ia64
> buils fine for me in a cross-compiling environment. (but i dont know
> whether it boots ...)
powerpc (pasemi_defconfig) is broken in new ways from the original
breakage by this patch:
CHK include/linux/utsrelease.h
In file included from include/asm/pgtable-ppc64.h:10,
from include/asm/pgtable.h:13,
from include/linux/mm.h:39,
from include/linux/mman.h:14,
from arch/powerpc/kernel/asm-offsets.c:22:
include/asm/tlbflush.h: In function 'arch_enter_lazy_mmu_mode':
include/asm/tlbflush.h:112: error: '__my_cpu_offset' undeclared (first
use in this function)
include/asm/tlbflush.h:112: error: (Each undeclared identifier is
reported only once
include/asm/tlbflush.h:112: error: for each function it appears in.)
include/asm/tlbflush.h: In function 'arch_leave_lazy_mmu_mode':
include/asm/tlbflush.h:119: error: '__my_cpu_offset' undeclared (first
use in this function)
In file included from include/linux/mm.h:535,
from include/linux/mman.h:14,
from arch/powerpc/kernel/asm-offsets.c:22:
include/linux/vmstat.h: In function '__count_vm_event':
include/linux/vmstat.h:62: error: '__my_cpu_offset' undeclared (first
use in this function)
include/linux/vmstat.h: In function 'count_vm_event':
include/linux/vmstat.h:67: error: '__my_cpu_offset' undeclared (first
use in this function)
include/linux/vmstat.h: In function '__count_vm_events':
include/linux/vmstat.h:73: error: '__my_cpu_offset' undeclared (first
use in this function)
include/linux/vmstat.h: In function 'count_vm_events':
include/linux/vmstat.h:78: error: '__my_cpu_offset' undeclared (first
use in this function)
make[1]: *** [arch/powerpc/kernel/asm-offsets.s] Error 1
-Olof
^ permalink raw reply
* Re: [PATCH] [NET] cpmac: convert to new Fixed PHY infrastructure
From: Kumar Gala @ 2008-01-30 18:36 UTC (permalink / raw)
To: Jeff Garzik; +Cc: linuxppc-dev list, Eugene Konev, netdev
In-Reply-To: <47A0B6A6.5080903@garzik.org>
>>> Is this going through netdev or do you want me to pick it via the
>>> powerpc route?
>
> Based on your comments I sorta assumed it was most convenient to
> lump in with the rest of the powerpc changes...
That's fine. I'll push it via the powerpc trees.
- k
^ permalink raw reply
* Re: x86/non-x86: percpu, node ids, apic ids x86.git fixup
From: Mike Travis @ 2008-01-30 18:41 UTC (permalink / raw)
To: Luck, Tony
Cc: sparclinux, linux-ia64, Linux Kernel Development,
Linux/PPC Development, Geert Uytterhoeven, Ingo Molnar,
Linus Torvalds, Thomas Gleixner
In-Reply-To: <1FE6DD409037234FAB833C420AA843EC757DEA@orsmsx424.amr.corp.intel.com>
Luck, Tony wrote:
>> Could you check the patch below? With this applied to latest -git, ia64
>> buils fine for me in a cross-compiling environment. (but i dont know
>> whether it boots ...)
>
> Uni-processor build still fails with this patch (config is arch/ia64/configs/tiger_defconfig
> with CONFIG_SMP switched from =y to =n).
I'll add an ia64-nosmp config to our cross build test environment and fix this up...
Thanks,
Mike
>
> arch/ia64/kernel/built-in.o(.text+0x5012): In function `show_interrupts':
> : relocation truncated to fit: IMM22 per_cpu__kstat
> arch/ia64/kernel/built-in.o(.text+0x53e1): In function `__bind_irq_vector':
> : relocation truncated to fit: IMM22 per_cpu__vector_irq
> arch/ia64/kernel/built-in.o(.text+0x5612): In function `__clear_irq_vector':
> : relocation truncated to fit: IMM22 per_cpu__vector_irq
> arch/ia64/kernel/built-in.o(.text+0x5a81): In function `__setup_vector_irq':
> : relocation truncated to fit: IMM22 per_cpu__vector_irq
> arch/ia64/kernel/built-in.o(.text+0x6231): In function `ia64_handle_irq':
> : relocation truncated to fit: IMM22 per_cpu____irq_regs
> arch/ia64/kernel/built-in.o(.text+0x6272): In function `ia64_handle_irq':
> : relocation truncated to fit: IMM22 per_cpu__vector_irq
> arch/ia64/kernel/built-in.o(.text+0x7b81): In function `cpu_idle_wait':
> : relocation truncated to fit: IMM22 .text
> arch/ia64/kernel/built-in.o(.text+0x7e21): In function `cpu_idle':
> : relocation truncated to fit: IMM22 .text
> arch/ia64/kernel/built-in.o(.text+0x7fd1): In function `ia64_save_extra':
> : relocation truncated to fit: IMM22 per_cpu__pfm_syst_info
> arch/ia64/kernel/built-in.o(.text+0x8071): In function `ia64_load_extra':
> : relocation truncated to fit: IMM22 per_cpu__pfm_syst_info
> arch/ia64/kernel/built-in.o(.text+0x95c0): In function `pfm_write_ibr_dbr':
> : additional relocation overflows omitted from the output
> ld: final link failed: Nonrepresentable section on output
> make: *** [.tmp_vmlinux1] Error 1
>
> SMP build (config zx1_defconfig) builds ok and boots ok too.
>
> -Tony
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox