public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] x86: remove superflous goal definition of tsc_sync
@ 2011-03-03 20:04 Henrik Kretzschmar
  2011-03-03 20:04 ` [PATCH 2/7] x86: make some apic symbols init Henrik Kretzschmar
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Henrik Kretzschmar @ 2011-03-03 20:04 UTC (permalink / raw)
  To: mingo; +Cc: tglx, hpa, x86, linux-kernel, Henrik Kretzschmar

This goal definition is superflous.
CONFIG_X86_64_SMP depends on CONFIG_SMP
and tsc_sync.o is already in the definition of CONFIG_SMP.

Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
---
 arch/x86/kernel/Makefile |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index 4ad4509..6b61081 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -69,7 +69,6 @@ obj-$(CONFIG_APM)		+= apm.o
 obj-$(CONFIG_SMP)		+= smp.o
 obj-$(CONFIG_SMP)		+= smpboot.o tsc_sync.o
 obj-$(CONFIG_SMP)		+= setup_percpu.o
-obj-$(CONFIG_X86_64_SMP)	+= tsc_sync.o
 obj-$(CONFIG_X86_MPPARSE)	+= mpparse.o
 obj-y				+= apic/
 obj-$(CONFIG_X86_REBOOTFIXUPS)	+= reboot_fixups_32.o
-- 
1.7.2.3


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

* [PATCH 2/7] x86: make some apic symbols init
  2011-03-03 20:04 [PATCH 1/7] x86: remove superflous goal definition of tsc_sync Henrik Kretzschmar
@ 2011-03-03 20:04 ` Henrik Kretzschmar
  2011-03-03 21:19   ` Cyrill Gorcunov
  2011-03-03 20:04 ` [PATCH 3/7] x86: make apic_disable() static and init Henrik Kretzschmar
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Henrik Kretzschmar @ 2011-03-03 20:04 UTC (permalink / raw)
  To: mingo; +Cc: tglx, hpa, x86, linux-kernel, Henrik Kretzschmar

apic_force_enable(), apic_verify() and the variable
force_enable_local_apic are only used by init code
and now get marked as such.

Global __initdata variables may better be initialized,
since they are in the data section and not in the bss.

Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
---
 arch/x86/include/asm/apic.h |    2 +-
 arch/x86/kernel/apic/apic.c |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index dbd558c..afe69e1 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -240,7 +240,7 @@ extern void setup_boot_APIC_clock(void);
 extern void setup_secondary_APIC_clock(void);
 extern int APIC_init_uniprocessor(void);
 extern void enable_NMI_through_LVT0(void);
-extern int apic_force_enable(unsigned long addr);
+extern int apic_force_enable(unsigned long addr) __init;
 
 /*
  * On 32bit this is mach-xxx local
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 6c464a3..022afb9 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -93,7 +93,7 @@ DEFINE_EARLY_PER_CPU(int, x86_cpu_to_logical_apicid, BAD_APICID);
  *
  * +1=force-enable
  */
-static int force_enable_local_apic;
+static int force_enable_local_apic __initdata = 0;
 /*
  * APIC command line parameters
  */
@@ -1560,7 +1560,7 @@ static int __init detect_init_APIC(void)
 }
 #else
 
-static int apic_verify(void)
+static int __init apic_verify(void)
 {
 	u32 features, h, l;
 
@@ -1585,7 +1585,7 @@ static int apic_verify(void)
 	return 0;
 }
 
-int apic_force_enable(unsigned long addr)
+int __init apic_force_enable(unsigned long addr)
 {
 	u32 h, l;
 
-- 
1.7.2.3


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

* [PATCH 3/7] x86: make apic_disable() static and init
  2011-03-03 20:04 [PATCH 1/7] x86: remove superflous goal definition of tsc_sync Henrik Kretzschmar
  2011-03-03 20:04 ` [PATCH 2/7] x86: make some apic symbols init Henrik Kretzschmar
@ 2011-03-03 20:04 ` Henrik Kretzschmar
  2011-03-03 20:45   ` Cyrill Gorcunov
  2011-03-03 20:04 ` [PATCH 4/7] x86: remove enable_NMI_through_LVT0() entirely Henrik Kretzschmar
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Henrik Kretzschmar @ 2011-03-03 20:04 UTC (permalink / raw)
  To: mingo; +Cc: tglx, hpa, x86, linux-kernel, Henrik Kretzschmar

apic_disable() is only used in apic.c, so it does not
need the prototype which was introduced inc commit
08306ce61d6848e6fbf74fa4cc693c3fb29e943f .
Therefore we remove it from the header and make it static.

It is also called only from init code, so we mark it as such.

Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
---
 arch/x86/include/asm/apic.h |    2 --
 arch/x86/kernel/apic/apic.c |    2 +-
 2 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index afe69e1..6d74dd37 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -220,7 +220,6 @@ extern void enable_IR_x2apic(void);
 
 extern int get_physical_broadcast(void);
 
-extern void apic_disable(void);
 extern int lapic_get_maxlvt(void);
 extern void clear_local_APIC(void);
 extern void connect_bsp_APIC(void);
@@ -261,7 +260,6 @@ static inline void lapic_shutdown(void) { }
 #define local_apic_timer_c2_ok		1
 static inline void init_apic_mappings(void) { }
 static inline void disable_local_APIC(void) { }
-static inline void apic_disable(void) { }
 # define setup_boot_APIC_clock x86_init_noop
 # define setup_secondary_APIC_clock x86_init_noop
 #endif /* !CONFIG_X86_LOCAL_APIC */
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 022afb9..5177aaa 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -248,7 +248,7 @@ static int modern_apic(void)
  * right after this call apic become NOOP driven
  * so apic->write/read doesn't do anything
  */
-void apic_disable(void)
+static void __init apic_disable(void)
 {
 	pr_info("APIC: switched to apic NOOP\n");
 	apic = &apic_noop;
-- 
1.7.2.3


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

* [PATCH 4/7] x86: remove enable_NMI_through_LVT0() entirely
  2011-03-03 20:04 [PATCH 1/7] x86: remove superflous goal definition of tsc_sync Henrik Kretzschmar
  2011-03-03 20:04 ` [PATCH 2/7] x86: make some apic symbols init Henrik Kretzschmar
  2011-03-03 20:04 ` [PATCH 3/7] x86: make apic_disable() static and init Henrik Kretzschmar
@ 2011-03-03 20:04 ` Henrik Kretzschmar
  2011-03-03 20:54   ` Cyrill Gorcunov
  2011-03-03 20:04 ` [PATCH 5/7] x86: remove ancient crufty prototype Henrik Kretzschmar
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Henrik Kretzschmar @ 2011-03-03 20:04 UTC (permalink / raw)
  To: mingo; +Cc: tglx, hpa, x86, linux-kernel, Henrik Kretzschmar

This function is not used anywhere in the tree,
since commit 072b198a4ad48bd722ec6d203d65422a4698eae7
so it can be removed.

Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
---
 arch/x86/include/asm/apic.h |    1 -
 arch/x86/kernel/apic/apic.c |   17 -----------------
 2 files changed, 0 insertions(+), 18 deletions(-)

diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index 6d74dd37..f17d7c5 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -238,7 +238,6 @@ void register_lapic_address(unsigned long address);
 extern void setup_boot_APIC_clock(void);
 extern void setup_secondary_APIC_clock(void);
 extern int APIC_init_uniprocessor(void);
-extern void enable_NMI_through_LVT0(void);
 extern int apic_force_enable(unsigned long addr) __init;
 
 /*
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 5177aaa..a0e9c1f 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -292,23 +292,6 @@ u64 native_apic_icr_read(void)
 	return icr1 | ((u64)icr2 << 32);
 }
 
-/**
- * enable_NMI_through_LVT0 - enable NMI through local vector table 0
- */
-void __cpuinit enable_NMI_through_LVT0(void)
-{
-	unsigned int v;
-
-	/* unmask and set to NMI */
-	v = APIC_DM_NMI;
-
-	/* Level triggered for 82489DX (32bit mode) */
-	if (!lapic_is_integrated())
-		v |= APIC_LVT_LEVEL_TRIGGER;
-
-	apic_write(APIC_LVT0, v);
-}
-
 #ifdef CONFIG_X86_32
 /**
  * get_physical_broadcast - Get number of physical broadcast IDs
-- 
1.7.2.3


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

* [PATCH 5/7] x86: remove ancient crufty prototype
  2011-03-03 20:04 [PATCH 1/7] x86: remove superflous goal definition of tsc_sync Henrik Kretzschmar
                   ` (2 preceding siblings ...)
  2011-03-03 20:04 ` [PATCH 4/7] x86: remove enable_NMI_through_LVT0() entirely Henrik Kretzschmar
@ 2011-03-03 20:04 ` Henrik Kretzschmar
  2011-03-03 21:03   ` Cyrill Gorcunov
  2011-03-03 20:05 ` [PATCH 6/7] x86: remove unneeded prototypes Henrik Kretzschmar
  2011-03-03 20:05 ` [PATCH 7/7] x86: fix section of a disable_apic_timer Henrik Kretzschmar
  5 siblings, 1 reply; 15+ messages in thread
From: Henrik Kretzschmar @ 2011-03-03 20:04 UTC (permalink / raw)
  To: mingo; +Cc: tglx, hpa, x86, linux-kernel, Henrik Kretzschmar

The function cache_APIC_registers() does not exist in
the whole git history, so it can be removed.

Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
---
 arch/x86/include/asm/apic.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index f17d7c5..142fd7a 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -227,7 +227,6 @@ extern void disconnect_bsp_APIC(int virt_wire_setup);
 extern void disable_local_APIC(void);
 extern void lapic_shutdown(void);
 extern int verify_local_APIC(void);
-extern void cache_APIC_registers(void);
 extern void sync_Arb_IDs(void);
 extern void init_bsp_APIC(void);
 extern void setup_local_APIC(void);
-- 
1.7.2.3


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

* [PATCH 6/7] x86: remove unneeded prototypes
  2011-03-03 20:04 [PATCH 1/7] x86: remove superflous goal definition of tsc_sync Henrik Kretzschmar
                   ` (3 preceding siblings ...)
  2011-03-03 20:04 ` [PATCH 5/7] x86: remove ancient crufty prototype Henrik Kretzschmar
@ 2011-03-03 20:05 ` Henrik Kretzschmar
  2011-03-03 21:13   ` Cyrill Gorcunov
  2011-03-03 20:05 ` [PATCH 7/7] x86: fix section of a disable_apic_timer Henrik Kretzschmar
  5 siblings, 1 reply; 15+ messages in thread
From: Henrik Kretzschmar @ 2011-03-03 20:05 UTC (permalink / raw)
  To: mingo; +Cc: tglx, hpa, x86, linux-kernel, Henrik Kretzschmar

lapic_clockevent is moved, that we can get rid of some
unneeded prototypes.

Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
---
 arch/x86/kernel/apic/apic.c |   38 +++++++++++++++++---------------------
 1 files changed, 17 insertions(+), 21 deletions(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index a0e9c1f..64efb2d 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -187,29 +187,8 @@ static struct resource lapic_resource = {
 
 static unsigned int calibration_result;
 
-static int lapic_next_event(unsigned long delta,
-			    struct clock_event_device *evt);
-static void lapic_timer_setup(enum clock_event_mode mode,
-			      struct clock_event_device *evt);
-static void lapic_timer_broadcast(const struct cpumask *mask);
 static void apic_pm_activate(void);
 
-/*
- * The local apic timer can be used for any function which is CPU local.
- */
-static struct clock_event_device lapic_clockevent = {
-	.name		= "lapic",
-	.features	= CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT
-			| CLOCK_EVT_FEAT_C3STOP | CLOCK_EVT_FEAT_DUMMY,
-	.shift		= 32,
-	.set_mode	= lapic_timer_setup,
-	.set_next_event	= lapic_next_event,
-	.broadcast	= lapic_timer_broadcast,
-	.rating		= 100,
-	.irq		= -1,
-};
-static DEFINE_PER_CPU(struct clock_event_device, lapic_events);
-
 static unsigned long apic_phys;
 
 /*
@@ -501,6 +480,23 @@ static void lapic_timer_broadcast(const struct cpumask *mask)
 #endif
 }
 
+
+/*
+ * The local apic timer can be used for any function which is CPU local.
+ */
+static struct clock_event_device lapic_clockevent = {
+	.name		= "lapic",
+	.features	= CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT
+			| CLOCK_EVT_FEAT_C3STOP | CLOCK_EVT_FEAT_DUMMY,
+	.shift		= 32,
+	.set_mode	= lapic_timer_setup,
+	.set_next_event	= lapic_next_event,
+	.broadcast	= lapic_timer_broadcast,
+	.rating		= 100,
+	.irq		= -1,
+};
+static DEFINE_PER_CPU(struct clock_event_device, lapic_events);
+
 /*
  * Setup the local APIC timer for this CPU. Copy the initialized values
  * of the boot CPU and register the clock event in the framework.
-- 
1.7.2.3


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

* [PATCH 7/7] x86: fix section of a disable_apic_timer
  2011-03-03 20:04 [PATCH 1/7] x86: remove superflous goal definition of tsc_sync Henrik Kretzschmar
                   ` (4 preceding siblings ...)
  2011-03-03 20:05 ` [PATCH 6/7] x86: remove unneeded prototypes Henrik Kretzschmar
@ 2011-03-03 20:05 ` Henrik Kretzschmar
  2011-03-03 21:18   ` Cyrill Gorcunov
  5 siblings, 1 reply; 15+ messages in thread
From: Henrik Kretzschmar @ 2011-03-03 20:05 UTC (permalink / raw)
  To: mingo; +Cc: tglx, hpa, x86, linux-kernel, Henrik Kretzschmar

This variable placed better into section .init.data,
since its only accessed by __init code.

Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
---
 arch/x86/kernel/apic/apic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 64efb2d..dab58b6 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -163,7 +163,7 @@ early_param("nox2apic", setup_nox2apic);
 unsigned long mp_lapic_addr;
 int disable_apic;
 /* Disable local APIC timer from the kernel commandline or via dmi quirk */
-static int disable_apic_timer __cpuinitdata;
+static int disable_apic_timer __initdata = 0;
 /* Local APIC timer works in C2 */
 int local_apic_timer_c2_ok;
 EXPORT_SYMBOL_GPL(local_apic_timer_c2_ok);
-- 
1.7.2.3


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

* Re: [PATCH 3/7] x86: make apic_disable() static and init
  2011-03-03 20:04 ` [PATCH 3/7] x86: make apic_disable() static and init Henrik Kretzschmar
@ 2011-03-03 20:45   ` Cyrill Gorcunov
  0 siblings, 0 replies; 15+ messages in thread
From: Cyrill Gorcunov @ 2011-03-03 20:45 UTC (permalink / raw)
  To: Henrik Kretzschmar; +Cc: mingo, tglx, hpa, x86, linux-kernel

On 03/03/2011 11:04 PM, Henrik Kretzschmar wrote:
> apic_disable() is only used in apic.c, so it does not
> need the prototype which was introduced inc commit
> 08306ce61d6848e6fbf74fa4cc693c3fb29e943f .
> Therefore we remove it from the header and make it static.
> 
> It is also called only from init code, so we mark it as such.
> 
> Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
> ---

Thanks for cleanup Henrik!
(nb: Please always CC an commit's author next time.)

Acked-by: Cyrill Gorunov <gorcunov@openvz.org>
-- 
    Cyrill

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

* Re: [PATCH 4/7] x86: remove enable_NMI_through_LVT0() entirely
  2011-03-03 20:04 ` [PATCH 4/7] x86: remove enable_NMI_through_LVT0() entirely Henrik Kretzschmar
@ 2011-03-03 20:54   ` Cyrill Gorcunov
  0 siblings, 0 replies; 15+ messages in thread
From: Cyrill Gorcunov @ 2011-03-03 20:54 UTC (permalink / raw)
  To: Henrik Kretzschmar; +Cc: mingo, tglx, hpa, x86, linux-kernel, Don Zickus

On 03/03/2011 11:04 PM, Henrik Kretzschmar wrote:
> This function is not used anywhere in the tree,
> since commit 072b198a4ad48bd722ec6d203d65422a4698eae7
> so it can be removed.
> 
> Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
> ---
>  arch/x86/include/asm/apic.h |    1 -
>  arch/x86/kernel/apic/apic.c |   17 -----------------
>  2 files changed, 0 insertions(+), 18 deletions(-)
> 
> diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
> index 6d74dd37..f17d7c5 100644
> --- a/arch/x86/include/asm/apic.h
> +++ b/arch/x86/include/asm/apic.h
> @@ -238,7 +238,6 @@ void register_lapic_address(unsigned long address);
>  extern void setup_boot_APIC_clock(void);
>  extern void setup_secondary_APIC_clock(void);
>  extern int APIC_init_uniprocessor(void);
> -extern void enable_NMI_through_LVT0(void);
>  extern int apic_force_enable(unsigned long addr) __init;
>  
>  /*
> diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
> index 5177aaa..a0e9c1f 100644
> --- a/arch/x86/kernel/apic/apic.c
> +++ b/arch/x86/kernel/apic/apic.c
> @@ -292,23 +292,6 @@ u64 native_apic_icr_read(void)
>  	return icr1 | ((u64)icr2 << 32);
>  }
>  
> -/**
> - * enable_NMI_through_LVT0 - enable NMI through local vector table 0
> - */
> -void __cpuinit enable_NMI_through_LVT0(void)
> -{
> -	unsigned int v;
> -
> -	/* unmask and set to NMI */
> -	v = APIC_DM_NMI;
> -
> -	/* Level triggered for 82489DX (32bit mode) */
> -	if (!lapic_is_integrated())
> -		v |= APIC_LVT_LEVEL_TRIGGER;
> -
> -	apic_write(APIC_LVT0, v);
> -}
> -
>  #ifdef CONFIG_X86_32
>  /**
>   * get_physical_broadcast - Get number of physical broadcast IDs

Seems to be a leftover since nmi-watchdog via io-apic. Good for me.
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>

CC'ing Don.
-- 
    Cyrill

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

* Re: [PATCH 5/7] x86: remove ancient crufty prototype
  2011-03-03 20:04 ` [PATCH 5/7] x86: remove ancient crufty prototype Henrik Kretzschmar
@ 2011-03-03 21:03   ` Cyrill Gorcunov
  0 siblings, 0 replies; 15+ messages in thread
From: Cyrill Gorcunov @ 2011-03-03 21:03 UTC (permalink / raw)
  To: Henrik Kretzschmar; +Cc: mingo, tglx, hpa, x86, linux-kernel

On 03/03/2011 11:04 PM, Henrik Kretzschmar wrote:
> The function cache_APIC_registers() does not exist in
> the whole git history, so it can be removed.
> 
> Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
> ---

Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>

-- 
    Cyrill

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

* Re: [PATCH 6/7] x86: remove unneeded prototypes
  2011-03-03 20:05 ` [PATCH 6/7] x86: remove unneeded prototypes Henrik Kretzschmar
@ 2011-03-03 21:13   ` Cyrill Gorcunov
  0 siblings, 0 replies; 15+ messages in thread
From: Cyrill Gorcunov @ 2011-03-03 21:13 UTC (permalink / raw)
  To: Henrik Kretzschmar; +Cc: mingo, tglx, hpa, x86, linux-kernel

On 03/03/2011 11:05 PM, Henrik Kretzschmar wrote:
> lapic_clockevent is moved, that we can get rid of some
> unneeded prototypes.
> 
> Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
> ---
>  arch/x86/kernel/apic/apic.c |   38 +++++++++++++++++---------------------
>  1 files changed, 17 insertions(+), 21 deletions(-)
> 
> diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
> index a0e9c1f..64efb2d 100644
> --- a/arch/x86/kernel/apic/apic.c
> +++ b/arch/x86/kernel/apic/apic.c
> @@ -187,29 +187,8 @@ static struct resource lapic_resource = {
>  
>  static unsigned int calibration_result;
>  
> -static int lapic_next_event(unsigned long delta,
> -			    struct clock_event_device *evt);
> -static void lapic_timer_setup(enum clock_event_mode mode,
> -			      struct clock_event_device *evt);
> -static void lapic_timer_broadcast(const struct cpumask *mask);
>  static void apic_pm_activate(void);
>  
> -/*
> - * The local apic timer can be used for any function which is CPU local.
> - */
> -static struct clock_event_device lapic_clockevent = {
> -	.name		= "lapic",
> -	.features	= CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT
> -			| CLOCK_EVT_FEAT_C3STOP | CLOCK_EVT_FEAT_DUMMY,
> -	.shift		= 32,
> -	.set_mode	= lapic_timer_setup,
> -	.set_next_event	= lapic_next_event,
> -	.broadcast	= lapic_timer_broadcast,
> -	.rating		= 100,
> -	.irq		= -1,
> -};
> -static DEFINE_PER_CPU(struct clock_event_device, lapic_events);
> -
>  static unsigned long apic_phys;
>  
>  /*
> @@ -501,6 +480,23 @@ static void lapic_timer_broadcast(const struct cpumask *mask)
>  #endif
>  }
>  
> +
> +/*
> + * The local apic timer can be used for any function which is CPU local.
> + */
> +static struct clock_event_device lapic_clockevent = {
> +	.name		= "lapic",
> +	.features	= CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT
> +			| CLOCK_EVT_FEAT_C3STOP | CLOCK_EVT_FEAT_DUMMY,
> +	.shift		= 32,
> +	.set_mode	= lapic_timer_setup,
> +	.set_next_event	= lapic_next_event,
> +	.broadcast	= lapic_timer_broadcast,
> +	.rating		= 100,
> +	.irq		= -1,
> +};
> +static DEFINE_PER_CPU(struct clock_event_device, lapic_events);
> +
>  /*
>   * Setup the local APIC timer for this CPU. Copy the initialized values
>   * of the boot CPU and register the clock event in the framework.

Looks good to me  -- now this snippets are near the place we refer them.

-- 
    Cyrill

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

* Re: [PATCH 7/7] x86: fix section of a disable_apic_timer
  2011-03-03 20:05 ` [PATCH 7/7] x86: fix section of a disable_apic_timer Henrik Kretzschmar
@ 2011-03-03 21:18   ` Cyrill Gorcunov
  2011-03-04  9:06     ` Henrik Kretzschmar
  0 siblings, 1 reply; 15+ messages in thread
From: Cyrill Gorcunov @ 2011-03-03 21:18 UTC (permalink / raw)
  To: Henrik Kretzschmar; +Cc: mingo, tglx, hpa, x86, linux-kernel

On 03/03/2011 11:05 PM, Henrik Kretzschmar wrote:
> This variable placed better into section .init.data,
> since its only accessed by __init code.
> 
> Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
> ---
>  arch/x86/kernel/apic/apic.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
> index 64efb2d..dab58b6 100644
> --- a/arch/x86/kernel/apic/apic.c
> +++ b/arch/x86/kernel/apic/apic.c
> @@ -163,7 +163,7 @@ early_param("nox2apic", setup_nox2apic);
>  unsigned long mp_lapic_addr;
>  int disable_apic;
>  /* Disable local APIC timer from the kernel commandline or via dmi quirk */
> -static int disable_apic_timer __cpuinitdata;
> +static int disable_apic_timer __initdata = 0;
>  /* Local APIC timer works in C2 */
>  int local_apic_timer_c2_ok;
>  EXPORT_SYMBOL_GPL(local_apic_timer_c2_ok);

Good to me, though I don't get why we need 0 here.

-- 
    Cyrill

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

* Re: [PATCH 2/7] x86: make some apic symbols init
  2011-03-03 20:04 ` [PATCH 2/7] x86: make some apic symbols init Henrik Kretzschmar
@ 2011-03-03 21:19   ` Cyrill Gorcunov
  2011-03-04  9:09     ` Henrik Kretzschmar
  0 siblings, 1 reply; 15+ messages in thread
From: Cyrill Gorcunov @ 2011-03-03 21:19 UTC (permalink / raw)
  To: Henrik Kretzschmar; +Cc: mingo, tglx, hpa, x86, linux-kernel

On 03/03/2011 11:04 PM, Henrik Kretzschmar wrote:
> apic_force_enable(), apic_verify() and the variable
> force_enable_local_apic are only used by init code
> and now get marked as such.
> 
> Global __initdata variables may better be initialized,
> since they are in the data section and not in the bss.
> 
> Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
> ---
>  arch/x86/include/asm/apic.h |    2 +-
>  arch/x86/kernel/apic/apic.c |    6 +++---
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
> index dbd558c..afe69e1 100644
> --- a/arch/x86/include/asm/apic.h
> +++ b/arch/x86/include/asm/apic.h
> @@ -240,7 +240,7 @@ extern void setup_boot_APIC_clock(void);
>  extern void setup_secondary_APIC_clock(void);
>  extern int APIC_init_uniprocessor(void);
>  extern void enable_NMI_through_LVT0(void);
> -extern int apic_force_enable(unsigned long addr);
> +extern int apic_force_enable(unsigned long addr) __init;

Nope, we either should _check_ all the prototipes and fix them
either left them untouched. This will confuse code readers with "for
what reason some functions have __init, some -- not". So I rather
would fix this nit in different patch later which would address
all of them (if this would not break someone's queue).

>  
>  /*
>   * On 32bit this is mach-xxx local
> diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
> index 6c464a3..022afb9 100644
> --- a/arch/x86/kernel/apic/apic.c
> +++ b/arch/x86/kernel/apic/apic.c
> @@ -93,7 +93,7 @@ DEFINE_EARLY_PER_CPU(int, x86_cpu_to_logical_apicid, BAD_APICID);
>   *
>   * +1=force-enable
>   */
> -static int force_enable_local_apic;
> +static int force_enable_local_apic __initdata = 0;

Hmm, I fail to see why we need to set it to 0.

>  /*
>   * APIC command line parameters
>   */
> @@ -1560,7 +1560,7 @@ static int __init detect_init_APIC(void)
>  }
>  #else
>  
> -static int apic_verify(void)
> +static int __init apic_verify(void)
>  {
>  	u32 features, h, l;
>  
> @@ -1585,7 +1585,7 @@ static int apic_verify(void)
>  	return 0;
>  }
>  
> -int apic_force_enable(unsigned long addr)
> +int __init apic_force_enable(unsigned long addr)
>  {
>  	u32 h, l;
>  

Other looks good to me.

-- 
    Cyrill

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

* Re: [PATCH 7/7] x86: fix section of a disable_apic_timer
  2011-03-03 21:18   ` Cyrill Gorcunov
@ 2011-03-04  9:06     ` Henrik Kretzschmar
  0 siblings, 0 replies; 15+ messages in thread
From: Henrik Kretzschmar @ 2011-03-04  9:06 UTC (permalink / raw)
  To: Cyrill Gorcunov; +Cc: mingo, tglx, hpa, x86, linux-kernel

Am 03.03.2011 22:18, schrieb Cyrill Gorcunov:
> On 03/03/2011 11:05 PM, Henrik Kretzschmar wrote:
>> This variable placed better into section .init.data,
>> since its only accessed by __init code.
>>
>> Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
>> ---
>>  arch/x86/kernel/apic/apic.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
>> index 64efb2d..dab58b6 100644
>> --- a/arch/x86/kernel/apic/apic.c
>> +++ b/arch/x86/kernel/apic/apic.c
>> @@ -163,7 +163,7 @@ early_param("nox2apic", setup_nox2apic);
>>  unsigned long mp_lapic_addr;
>>  int disable_apic;
>>  /* Disable local APIC timer from the kernel commandline or via dmi quirk */
>> -static int disable_apic_timer __cpuinitdata;
>> +static int disable_apic_timer __initdata = 0;
>>  /* Local APIC timer works in C2 */
>>  int local_apic_timer_c2_ok;
>>  EXPORT_SYMBOL_GPL(local_apic_timer_c2_ok);
> 
> Good to me, though I don't get why we need 0 here.
> 

I wanted to help gcc, but some tests showed me that gcc is much cleverer than I thought.
So I verified that you are right and I'll change that gladly.






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

* Re: [PATCH 2/7] x86: make some apic symbols init
  2011-03-03 21:19   ` Cyrill Gorcunov
@ 2011-03-04  9:09     ` Henrik Kretzschmar
  0 siblings, 0 replies; 15+ messages in thread
From: Henrik Kretzschmar @ 2011-03-04  9:09 UTC (permalink / raw)
  To: Cyrill Gorcunov; +Cc: mingo, tglx, hpa, x86, linux-kernel

Am 03.03.2011 22:19, schrieb Cyrill Gorcunov:
> On 03/03/2011 11:04 PM, Henrik Kretzschmar wrote:
>> apic_force_enable(), apic_verify() and the variable
>> force_enable_local_apic are only used by init code
>> and now get marked as such.
>>
>> Global __initdata variables may better be initialized,
>> since they are in the data section and not in the bss.
>>
>> Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
>> ---
>>  arch/x86/include/asm/apic.h |    2 +-
>>  arch/x86/kernel/apic/apic.c |    6 +++---
>>  2 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
>> index dbd558c..afe69e1 100644
>> --- a/arch/x86/include/asm/apic.h
>> +++ b/arch/x86/include/asm/apic.h
>> @@ -240,7 +240,7 @@ extern void setup_boot_APIC_clock(void);
>>  extern void setup_secondary_APIC_clock(void);
>>  extern int APIC_init_uniprocessor(void);
>>  extern void enable_NMI_through_LVT0(void);
>> -extern int apic_force_enable(unsigned long addr);
>> +extern int apic_force_enable(unsigned long addr) __init;
> 
> Nope, we either should _check_ all the prototipes and fix them
> either left them untouched. This will confuse code readers with "for
> what reason some functions have __init, some -- not". So I rather
> would fix this nit in different patch later which would address
> all of them (if this would not break someone's queue).
> 
Ack, I'll fix it.

>>   */
>> -static int force_enable_local_apic;
>> +static int force_enable_local_apic __initdata = 0;
> 
> Hmm, I fail to see why we need to set it to 0.

Ack, I'll fix this also.
 

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

end of thread, other threads:[~2011-03-04  9:09 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-03 20:04 [PATCH 1/7] x86: remove superflous goal definition of tsc_sync Henrik Kretzschmar
2011-03-03 20:04 ` [PATCH 2/7] x86: make some apic symbols init Henrik Kretzschmar
2011-03-03 21:19   ` Cyrill Gorcunov
2011-03-04  9:09     ` Henrik Kretzschmar
2011-03-03 20:04 ` [PATCH 3/7] x86: make apic_disable() static and init Henrik Kretzschmar
2011-03-03 20:45   ` Cyrill Gorcunov
2011-03-03 20:04 ` [PATCH 4/7] x86: remove enable_NMI_through_LVT0() entirely Henrik Kretzschmar
2011-03-03 20:54   ` Cyrill Gorcunov
2011-03-03 20:04 ` [PATCH 5/7] x86: remove ancient crufty prototype Henrik Kretzschmar
2011-03-03 21:03   ` Cyrill Gorcunov
2011-03-03 20:05 ` [PATCH 6/7] x86: remove unneeded prototypes Henrik Kretzschmar
2011-03-03 21:13   ` Cyrill Gorcunov
2011-03-03 20:05 ` [PATCH 7/7] x86: fix section of a disable_apic_timer Henrik Kretzschmar
2011-03-03 21:18   ` Cyrill Gorcunov
2011-03-04  9:06     ` Henrik Kretzschmar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox