Re: [patch 2/4] x86, apic: Switch wait_for_init_deassert to bool

2014-02-05 Thread Thomas Gleixner
On Tue, 4 Feb 2014, David Rientjes wrote:

> Now that there is only a single wait_for_init_deassert() function, just
> convert the member of struct apic to a bool to determine whether we need
> to wait for init_deassert to become non-zero.
> 
> There are no more callers of default_wait_for_init_deassert(), so fold
> it into the caller.
> 
> Signed-off-by: David Rientjes 

Reviewed-by: Thomas Gleixner 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 2/4] x86, apic: Switch wait_for_init_deassert to bool

2014-02-04 Thread David Rientjes
Now that there is only a single wait_for_init_deassert() function, just
convert the member of struct apic to a bool to determine whether we need
to wait for init_deassert to become non-zero.

There are no more callers of default_wait_for_init_deassert(), so fold
it into the caller.

Signed-off-by: David Rientjes 
---
 arch/x86/include/asm/apic.h   | 8 +---
 arch/x86/kernel/apic/apic_flat_64.c   | 4 ++--
 arch/x86/kernel/apic/apic_noop.c  | 3 +--
 arch/x86/kernel/apic/apic_numachip.c  | 2 +-
 arch/x86/kernel/apic/bigsmp_32.c  | 3 +--
 arch/x86/kernel/apic/es7000_32.c  | 6 ++
 arch/x86/kernel/apic/numaq_32.c   | 3 +--
 arch/x86/kernel/apic/probe_32.c   | 3 +--
 arch/x86/kernel/apic/summit_32.c  | 3 +--
 arch/x86/kernel/apic/x2apic_cluster.c | 2 +-
 arch/x86/kernel/apic/x2apic_phys.c| 2 +-
 arch/x86/kernel/apic/x2apic_uv_x.c| 2 +-
 arch/x86/kernel/smpboot.c | 5 +++--
 13 files changed, 17 insertions(+), 29 deletions(-)

diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -351,7 +351,7 @@ struct apic {
int trampoline_phys_low;
int trampoline_phys_high;
 
-   void (*wait_for_init_deassert)(atomic_t *deassert);
+   bool wait_for_init_deassert;
void (*smp_callin_clear_local_apic)(void);
void (*inquire_remote_apic)(int apicid);
 
@@ -517,12 +517,6 @@ extern int default_cpu_present_to_apicid(int mps_cpu);
 extern int default_check_phys_apicid_present(int phys_apicid);
 #endif
 
-static inline void default_wait_for_init_deassert(atomic_t *deassert)
-{
-   while (!atomic_read(deassert))
-   cpu_relax();
-}
-
 extern void generic_bigsmp_probe(void);
 
 
diff --git a/arch/x86/kernel/apic/apic_flat_64.c 
b/arch/x86/kernel/apic/apic_flat_64.c
--- a/arch/x86/kernel/apic/apic_flat_64.c
+++ b/arch/x86/kernel/apic/apic_flat_64.c
@@ -198,7 +198,7 @@ static struct apic apic_flat =  {
 
.trampoline_phys_low= DEFAULT_TRAMPOLINE_PHYS_LOW,
.trampoline_phys_high   = DEFAULT_TRAMPOLINE_PHYS_HIGH,
-   .wait_for_init_deassert = NULL,
+   .wait_for_init_deassert = false,
.smp_callin_clear_local_apic= NULL,
.inquire_remote_apic= default_inquire_remote_apic,
 
@@ -314,7 +314,7 @@ static struct apic apic_physflat =  {
 
.trampoline_phys_low= DEFAULT_TRAMPOLINE_PHYS_LOW,
.trampoline_phys_high   = DEFAULT_TRAMPOLINE_PHYS_HIGH,
-   .wait_for_init_deassert = NULL,
+   .wait_for_init_deassert = false,
.smp_callin_clear_local_apic= NULL,
.inquire_remote_apic= default_inquire_remote_apic,
 
diff --git a/arch/x86/kernel/apic/apic_noop.c b/arch/x86/kernel/apic/apic_noop.c
--- a/arch/x86/kernel/apic/apic_noop.c
+++ b/arch/x86/kernel/apic/apic_noop.c
@@ -172,8 +172,7 @@ struct apic apic_noop = {
.trampoline_phys_low= DEFAULT_TRAMPOLINE_PHYS_LOW,
.trampoline_phys_high   = DEFAULT_TRAMPOLINE_PHYS_HIGH,
 
-   .wait_for_init_deassert = NULL,
-
+   .wait_for_init_deassert = false,
.smp_callin_clear_local_apic= NULL,
.inquire_remote_apic= NULL,
 
diff --git a/arch/x86/kernel/apic/apic_numachip.c 
b/arch/x86/kernel/apic/apic_numachip.c
--- a/arch/x86/kernel/apic/apic_numachip.c
+++ b/arch/x86/kernel/apic/apic_numachip.c
@@ -248,7 +248,7 @@ static const struct apic apic_numachip __refconst = {
.wakeup_secondary_cpu   = numachip_wakeup_secondary,
.trampoline_phys_low= DEFAULT_TRAMPOLINE_PHYS_LOW,
.trampoline_phys_high   = DEFAULT_TRAMPOLINE_PHYS_HIGH,
-   .wait_for_init_deassert = NULL,
+   .wait_for_init_deassert = false,
.smp_callin_clear_local_apic= NULL,
.inquire_remote_apic= NULL, /* REMRD not supported */
 
diff --git a/arch/x86/kernel/apic/bigsmp_32.c b/arch/x86/kernel/apic/bigsmp_32.c
--- a/arch/x86/kernel/apic/bigsmp_32.c
+++ b/arch/x86/kernel/apic/bigsmp_32.c
@@ -199,8 +199,7 @@ static struct apic apic_bigsmp = {
.trampoline_phys_low= DEFAULT_TRAMPOLINE_PHYS_LOW,
.trampoline_phys_high   = DEFAULT_TRAMPOLINE_PHYS_HIGH,
 
-   .wait_for_init_deassert = default_wait_for_init_deassert,
-
+   .wait_for_init_deassert = true,
.smp_callin_clear_local_apic= NULL,
.inquire_remote_apic= default_inquire_remote_apic,
 
diff --git a/arch/x86/kernel/apic/es7000_32.c b/arch/x86/kernel/apic/es7000_32.c
--- a/arch/x86/kernel/apic/es7000_32.c
+++ b/arch/x86/kernel/apic/es7000_32.c
@@ -652,8 +652,7 @@ static struct apic __refdata apic_es7000_cluster = {
.trampoline_phys_low= 0x467,
.trampoline_phys_high   = 0x469,
 
-   .wait_for_init_deassert = NULL,
-