[patch 00/16] Remove old style lock initializers

View: New views
20 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 | Next >

[patch 00/16] Remove old style lock initializers

by Thomas Gleixner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The old style lock initializers SPIN_LOCK_UNLOCKED and
RW_LOCK_UNLOCKED are deprecated for several years. The series fixes
the remaining users and removes the defines.

Thanks,

        tglx

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

[patch 01/16] arm: Replace old style lock initializer

by Thomas Gleixner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

SPIN_LOCK_UNLOCKED is deprecated. Initialize the per cpu ipi locks via
spin_lock_init.

Signed-off-by: Thomas Gleixner <tglx@...>
Cc: patches@...
Cc: Russell King <rmk+kernel@...>

---
 arch/arm/kernel/smp.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Index: linux-2.6/arch/arm/kernel/smp.c
===================================================================
--- linux-2.6.orig/arch/arm/kernel/smp.c
+++ linux-2.6/arch/arm/kernel/smp.c
@@ -55,9 +55,7 @@ struct ipi_data {
  unsigned long bits;
 };
 
-static DEFINE_PER_CPU(struct ipi_data, ipi_data) = {
- .lock = SPIN_LOCK_UNLOCKED,
-};
+static DEFINE_PER_CPU(struct ipi_data, ipi_data);
 
 enum ipi_msg_type {
  IPI_TIMER,
@@ -329,6 +327,9 @@ void __init smp_prepare_boot_cpu(void)
  unsigned int cpu = smp_processor_id();
 
  per_cpu(cpu_data, cpu).idle = current;
+
+ for_each_possible_cpu(cpu)
+ spin_lock_init(&per_cpu(ipi_data, cpu).lock);
 }
 
 static void send_ipi_message(const struct cpumask *mask, enum ipi_msg_type msg)


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

[patch 02/16] mips: Replace old style spin lock initializer

by Thomas Gleixner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

SPIN_LOCK_UNLOCKED is deprecated. Use __SPIN_LOCK_UNLOCKED instead.

Signed-off-by: Thomas Gleixner <tglx@...>
Cc: Ralf Baechle <ralf@...>
---
 arch/mips/kernel/vpe.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6/arch/mips/kernel/vpe.c
===================================================================
--- linux-2.6.orig/arch/mips/kernel/vpe.c
+++ linux-2.6/arch/mips/kernel/vpe.c
@@ -149,9 +149,9 @@ struct {
  spinlock_t tc_list_lock;
  struct list_head tc_list; /* Thread contexts */
 } vpecontrol = {
- .vpe_list_lock = SPIN_LOCK_UNLOCKED,
+ .vpe_list_lock = __SPIN_LOCK_UNLOCKED(vpecontrol.vpe_list_lock),
  .vpe_list = LIST_HEAD_INIT(vpecontrol.vpe_list),
- .tc_list_lock = SPIN_LOCK_UNLOCKED,
+ .tc_list_lock = __SPIN_LOCK_UNLOCKED(vpecontrol.tc_list_lock),
  .tc_list = LIST_HEAD_INIT(vpecontrol.tc_list)
 };
 


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

[patch 03/16] net: Replace old style lock initializer

by Thomas Gleixner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

SPIN_LOCK_UNLOCKED is deprecated. Use DEFINE_SPINLOCK instead.

Signed-off-by: Thomas Gleixner <tglx@...>
Cc: netdev@...
Cc: David S. Miller <davem@...>
---
 net/core/drop_monitor.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/net/core/drop_monitor.c
===================================================================
--- linux-2.6.orig/net/core/drop_monitor.c
+++ linux-2.6/net/core/drop_monitor.c
@@ -41,7 +41,7 @@ static void send_dm_alert(struct work_st
  * netlink alerts
  */
 static int trace_state = TRACE_OFF;
-static spinlock_t trace_state_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(trace_state_lock);
 
 struct per_cpu_dm_data {
  struct work_struct dm_alert_work;


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

[patch 04/16] cred: Replace old style lock initializer

by Thomas Gleixner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

SPIN_LOCK_UNLOCKED is deprecated. Use __SPIN_LOCK_UNLOCKED instead.

Signed-off-by: Thomas Gleixner <tglx@...>
---
 kernel/cred.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/kernel/cred.c
===================================================================
--- linux-2.6.orig/kernel/cred.c
+++ linux-2.6/kernel/cred.c
@@ -39,7 +39,7 @@ static struct kmem_cache *cred_jar;
 static struct thread_group_cred init_tgcred = {
  .usage = ATOMIC_INIT(2),
  .tgid = 0,
- .lock = SPIN_LOCK_UNLOCKED,
+ .lock = __SPIN_LOCK_UNLOCKED(init_tgcred.lock),
 };
 #endif
 


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

[patch 05/16] pci: Replace old style lock initializer

by Thomas Gleixner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

SPIN_LOCK_UNLOCKED is deprecated. Use DEFINE_SPINLOCK instead.

Make the lock static while at it.

Signed-off-by: Thomas Gleixner <tglx@...>
Cc: Jesse Barnes <jbarnes@...>
---
 drivers/pci/pci.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/drivers/pci/pci.c
===================================================================
--- linux-2.6.orig/drivers/pci/pci.c
+++ linux-2.6/drivers/pci/pci.c
@@ -2590,7 +2590,7 @@ int pci_set_vga_state(struct pci_dev *de
 
 #define RESOURCE_ALIGNMENT_PARAM_SIZE COMMAND_LINE_SIZE
 static char resource_alignment_param[RESOURCE_ALIGNMENT_PARAM_SIZE] = {0};
-spinlock_t resource_alignment_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(resource_alignment_lock);
 
 /**
  * pci_specified_resource_alignment - get resource alignment specified by user.


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

[patch 06/16] sound: Replace old style lock initializer

by Thomas Gleixner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

SPIN_LOCK_UNLOCKED is deprecated. Use __SPIN_LOCK_UNLOCKED instead.

Signed-off-by: Thomas Gleixner <tglx@...>
Cc: Takashi Iwai <tiwai@...>
---
 sound/oss/dmasound/dmasound_core.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: linux-2.6/sound/oss/dmasound/dmasound_core.c
===================================================================
--- linux-2.6.orig/sound/oss/dmasound/dmasound_core.c
+++ linux-2.6/sound/oss/dmasound/dmasound_core.c
@@ -219,7 +219,9 @@ static int shared_resources_initialised;
      *  Mid level stuff
      */
 
-struct sound_settings dmasound = { .lock = SPIN_LOCK_UNLOCKED };
+struct sound_settings dmasound = {
+ .lock = __SPIN_LOCK_UNLOCKED(dmasound.lock)
+};
 
 static inline void sound_silence(void)
 {


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

[patch 07/16] um: Replace old style lock initializer

by Thomas Gleixner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

SPIN_LOCK_UNLOCKED is deprecated since quite a while. Runtime init the
locks instead.

Signed-off-by: Thomas Gleixner <tglx@...>
Cc: Jeff Dike <jdike@...>
---
 arch/um/drivers/ubd_kern.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/arch/um/drivers/ubd_kern.c
===================================================================
--- linux-2.6.orig/arch/um/drivers/ubd_kern.c
+++ linux-2.6/arch/um/drivers/ubd_kern.c
@@ -180,7 +180,6 @@ struct ubd {
  .no_cow =               0, \
  .shared = 0, \
  .cow = DEFAULT_COW, \
- .lock = SPIN_LOCK_UNLOCKED, \
  .request = NULL, \
  .start_sg = 0, \
  .end_sg = 0, \
@@ -838,6 +837,7 @@ static int ubd_add(int n, char **error_o
 
  ubd_dev->size = ROUND_BLOCK(ubd_dev->size);
 
+ spin_lock_init(&ubd_dev->lock);
  INIT_LIST_HEAD(&ubd_dev->restart);
  sg_init_table(ubd_dev->sg, MAX_SG);
 


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

[patch 08/16] sparc: Make atomic locks raw

by Thomas Gleixner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

SPIN_LOCK_UNLOCKED is deprecated and the locks which protect the
atomic operations have no dependency on other locks and the code is
well tested so the conversion to a raw lock is safe.

Make the lock array static while at it.

Signed-off-by: Thomas Gleixner <tglx@...>
Cc: David S. Miller <davem@...>
Cc: sparclinux@...
---
 arch/sparc/lib/atomic32.c |   36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

Index: linux-2.6/arch/sparc/lib/atomic32.c
===================================================================
--- linux-2.6.orig/arch/sparc/lib/atomic32.c
+++ linux-2.6/arch/sparc/lib/atomic32.c
@@ -15,8 +15,8 @@
 #define ATOMIC_HASH_SIZE 4
 #define ATOMIC_HASH(a) (&__atomic_hash[(((unsigned long)a)>>8) & (ATOMIC_HASH_SIZE-1)])
 
-spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] = {
- [0 ... (ATOMIC_HASH_SIZE-1)] = SPIN_LOCK_UNLOCKED
+static raw_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] = {
+ [0 ... (ATOMIC_HASH_SIZE-1)] = __RAW_SPIN_LOCK_UNLOCKED
 };
 
 #else /* SMP */
@@ -31,11 +31,11 @@ int __atomic_add_return(int i, atomic_t
 {
  int ret;
  unsigned long flags;
- spin_lock_irqsave(ATOMIC_HASH(v), flags);
+ __raw_spin_lock_irqsave(ATOMIC_HASH(v), flags);
 
  ret = (v->counter += i);
 
- spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
+ __raw_spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
  return ret;
 }
 EXPORT_SYMBOL(__atomic_add_return);
@@ -45,12 +45,12 @@ int atomic_cmpxchg(atomic_t *v, int old,
  int ret;
  unsigned long flags;
 
- spin_lock_irqsave(ATOMIC_HASH(v), flags);
+ __raw_spin_lock_irqsave(ATOMIC_HASH(v), flags);
  ret = v->counter;
  if (likely(ret == old))
  v->counter = new;
 
- spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
+ __raw_spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
  return ret;
 }
 EXPORT_SYMBOL(atomic_cmpxchg);
@@ -60,11 +60,11 @@ int atomic_add_unless(atomic_t *v, int a
  int ret;
  unsigned long flags;
 
- spin_lock_irqsave(ATOMIC_HASH(v), flags);
+ __raw_spin_lock_irqsave(ATOMIC_HASH(v), flags);
  ret = v->counter;
  if (ret != u)
  v->counter += a;
- spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
+ __raw_spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
  return ret != u;
 }
 EXPORT_SYMBOL(atomic_add_unless);
@@ -74,9 +74,9 @@ void atomic_set(atomic_t *v, int i)
 {
  unsigned long flags;
 
- spin_lock_irqsave(ATOMIC_HASH(v), flags);
+ __raw_spin_lock_irqsave(ATOMIC_HASH(v), flags);
  v->counter = i;
- spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
+ __raw_spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
 }
 EXPORT_SYMBOL(atomic_set);
 
@@ -84,10 +84,10 @@ unsigned long ___set_bit(unsigned long *
 {
  unsigned long old, flags;
 
- spin_lock_irqsave(ATOMIC_HASH(addr), flags);
+ __raw_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
  old = *addr;
  *addr = old | mask;
- spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
+ __raw_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
 
  return old & mask;
 }
@@ -97,10 +97,10 @@ unsigned long ___clear_bit(unsigned long
 {
  unsigned long old, flags;
 
- spin_lock_irqsave(ATOMIC_HASH(addr), flags);
+ __raw_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
  old = *addr;
  *addr = old & ~mask;
- spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
+ __raw_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
 
  return old & mask;
 }
@@ -110,10 +110,10 @@ unsigned long ___change_bit(unsigned lon
 {
  unsigned long old, flags;
 
- spin_lock_irqsave(ATOMIC_HASH(addr), flags);
+ __raw_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
  old = *addr;
  *addr = old ^ mask;
- spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
+ __raw_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
 
  return old & mask;
 }
@@ -124,10 +124,10 @@ unsigned long __cmpxchg_u32(volatile u32
  unsigned long flags;
  u32 prev;
 
- spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
+ __raw_spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
  if ((prev = *ptr) == old)
  *ptr = new;
- spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
+ __raw_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
 
  return (unsigned long)prev;
 }


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

[patch 09/16] powerpc: Replace old style lock initializer

by Thomas Gleixner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

SPIN_LOCK_UNLOCKED is deprecated. Init the lock array at runtime
instead.

Signed-off-by: Thomas Gleixner <tglx@...>
Cc: Benjamin Herrenschmidt <benh@...>
Cc: linuxppc-dev@...
---
 arch/powerpc/platforms/iseries/htab.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Index: linux-2.6/arch/powerpc/platforms/iseries/htab.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/iseries/htab.c
+++ linux-2.6/arch/powerpc/platforms/iseries/htab.c
@@ -19,8 +19,7 @@
 
 #include "call_hpt.h"
 
-static spinlock_t iSeries_hlocks[64] __cacheline_aligned_in_smp =
- { [0 ... 63] = SPIN_LOCK_UNLOCKED};
+static spinlock_t iSeries_hlocks[64] __cacheline_aligned_in_smp;
 
 /*
  * Very primitive algorithm for picking up a lock
@@ -245,6 +244,11 @@ static void iSeries_hpte_invalidate(unsi
 
 void __init hpte_init_iSeries(void)
 {
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(iSeries_hlocks); i++)
+ spin_lock_init(&iSeries_hlocks[i]);
+
  ppc_md.hpte_invalidate = iSeries_hpte_invalidate;
  ppc_md.hpte_updatepp = iSeries_hpte_updatepp;
  ppc_md.hpte_updateboltedpp = iSeries_hpte_updateboltedpp;


_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@...
https://lists.ozlabs.org/listinfo/linuxppc-dev

[patch 10/16] parisc: Replace old style lock init

by Thomas Gleixner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

SPIN_LOCK_UNLOCKED is deprecated. Init the per cpu locks at runtime
instead.

Signed-off-by: Thomas Gleixner <tglx@...>
Cc: Kyle McMartin <kyle@...>
Cc: linux-parisc@...
---
 arch/parisc/kernel/smp.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Index: linux-2.6/arch/parisc/kernel/smp.c
===================================================================
--- linux-2.6.orig/arch/parisc/kernel/smp.c
+++ linux-2.6/arch/parisc/kernel/smp.c
@@ -60,8 +60,6 @@ static int smp_debug_lvl = 0;
 #define smp_debug(lvl, ...) do { } while(0)
 #endif /* DEBUG_SMP */
 
-DEFINE_SPINLOCK(smp_lock);
-
 volatile struct task_struct *smp_init_current_idle_task;
 
 /* track which CPU is booting */
@@ -69,7 +67,7 @@ static volatile int cpu_now_booting __cp
 
 static int parisc_max_cpus __cpuinitdata = 1;
 
-DEFINE_PER_CPU(spinlock_t, ipi_lock) = SPIN_LOCK_UNLOCKED;
+static DEFINE_PER_CPU(spinlock_t, ipi_lock);
 
 enum ipi_message_type {
  IPI_NOP=0,
@@ -438,6 +436,11 @@ void __init smp_prepare_boot_cpu(void)
 */
 void __init smp_prepare_cpus(unsigned int max_cpus)
 {
+ int cpu;
+
+ for_each_possible_cpu(cpu)
+ spin_lock_init(&per_cpu(ipi_lock, cpu));
+
  init_cpu_present(cpumask_of(0));
 
  parisc_max_cpus = max_cpus;


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

[patch 11/16] alpha: Replace old style lock initializer

by Thomas Gleixner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

SPIN_LOCK_UNLOCKED is deprecated. Use __SPIN_LOCK_UNLOCKED instead.

Signed-off-by: Thomas Gleixner <tglx@...>
Cc: Richard Henderson <rth@...>
Cc: linux-alpha@...
---
 arch/alpha/include/asm/rwsem.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/arch/alpha/include/asm/rwsem.h
===================================================================
--- linux-2.6.orig/arch/alpha/include/asm/rwsem.h
+++ linux-2.6/arch/alpha/include/asm/rwsem.h
@@ -39,7 +39,7 @@ struct rw_semaphore {
 };
 
 #define __RWSEM_INITIALIZER(name) \
- { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \
+ { RWSEM_UNLOCKED_VALUE, __SPIN_LOCK_UNLOCKED((name).wait_lock), \
  LIST_HEAD_INIT((name).wait_list) }
 
 #define DECLARE_RWSEM(name) \


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

[patch 12/16] ia64: Replace old style lock initializer

by Thomas Gleixner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

SPIN_LOCK_UNLOCKED is deprecated. Use __SPIN_LOCK_UNLOCKED instead.

Signed-off-by: Thomas Gleixner <tglx@...>
Cc: Tony Luck <tony.luck@...>
Cc: linux-ia64@...
---
 arch/ia64/include/asm/rwsem.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/arch/ia64/include/asm/rwsem.h
===================================================================
--- linux-2.6.orig/arch/ia64/include/asm/rwsem.h
+++ linux-2.6/arch/ia64/include/asm/rwsem.h
@@ -47,7 +47,7 @@ struct rw_semaphore {
 #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
 
 #define __RWSEM_INITIALIZER(name) \
- { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \
+ { RWSEM_UNLOCKED_VALUE, __SPIN_LOCK_UNLOCKED((name).wait_lock), \
   LIST_HEAD_INIT((name).wait_list) }
 
 #define DECLARE_RWSEM(name) \


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

[patch 13/16] sh: Replace old style lock initializer

by Thomas Gleixner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

SPIN_LOCK_UNLOCKED is deprecated. Use __SPIN_LOCK_UNLOCKED instead.

Signed-off-by: Thomas Gleixner <tglx@...>
Cc: Paul Mundt <lethal@...>
Cc: linux-sh@...
---
 arch/sh/include/asm/rwsem.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/arch/sh/include/asm/rwsem.h
===================================================================
--- linux-2.6.orig/arch/sh/include/asm/rwsem.h
+++ linux-2.6/arch/sh/include/asm/rwsem.h
@@ -41,7 +41,7 @@ struct rw_semaphore {
 #endif
 
 #define __RWSEM_INITIALIZER(name) \
- { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \
+ { RWSEM_UNLOCKED_VALUE, __SPIN_LOCK_UNLOCKED((name).wait_lock), \
   LIST_HEAD_INIT((name).wait_list) \
   __RWSEM_DEP_MAP_INIT(name) }
 


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

[patch 14/16] sparc: Replace old style lock initializer

by Thomas Gleixner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

SPIN_LOCK_UNLOCKED is deprecated. Use __SPIN_LOCK_UNLOCKED instead.

Signed-off-by: Thomas Gleixner <tglx@...>
Cc: David S. Miller <davem@...>
Cc: sparclinux@...
---
 arch/sparc/include/asm/rwsem.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6/arch/sparc/include/asm/rwsem.h
===================================================================
--- linux-2.6.orig/arch/sparc/include/asm/rwsem.h
+++ linux-2.6/arch/sparc/include/asm/rwsem.h
@@ -35,8 +35,8 @@ struct rw_semaphore {
 #endif
 
 #define __RWSEM_INITIALIZER(name) \
-{ RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) \
-  __RWSEM_DEP_MAP_INIT(name) }
+{ RWSEM_UNLOCKED_VALUE, __SPIN_LOCK_UNLOCKED((name).wait_lock),
+  LIST_HEAD_INIT((name).wait_list) __RWSEM_DEP_MAP_INIT(name) }
 
 #define DECLARE_RWSEM(name) \
  struct rw_semaphore name = __RWSEM_INITIALIZER(name)


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

[patch 15/16] xtensa: Replace old style lock initializer

by Thomas Gleixner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

SPIN_LOCK_UNLOCKED is deprecated. Use __SPIN_LOCK_UNLOCKED instead.

Signed-off-by: Thomas Gleixner <tglx@...>
Cc: Chris Zankel <chris@...>
---
 arch/xtensa/include/asm/rwsem.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/arch/xtensa/include/asm/rwsem.h
===================================================================
--- linux-2.6.orig/arch/xtensa/include/asm/rwsem.h
+++ linux-2.6/arch/xtensa/include/asm/rwsem.h
@@ -38,7 +38,7 @@ struct rw_semaphore {
 };
 
 #define __RWSEM_INITIALIZER(name) \
- { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \
+ { RWSEM_UNLOCKED_VALUE, __SPIN_LOCK_UNLOCKED((name).wait_lock), \
   LIST_HEAD_INIT((name).wait_list) }
 
 #define DECLARE_RWSEM(name) \


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

[patch 16/16] locking: Remove old style lock initializers

by Thomas Gleixner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

SPIN_LOCK_UNLOCKED and RW_LOCK_UNLOCKED have been deprecated for
years. Now the last users are gone. Remove the cruft.

Signed-off-by: Thomas Gleixner <tglx@...>
---
 include/linux/spinlock.h       |    4 ++--
 include/linux/spinlock_types.h |    9 ---------
 2 files changed, 2 insertions(+), 11 deletions(-)

Index: linux-2.6/include/linux/spinlock.h
===================================================================
--- linux-2.6.orig/include/linux/spinlock.h
+++ linux-2.6/include/linux/spinlock.h
@@ -102,7 +102,7 @@ do { \
 
 #else
 # define spin_lock_init(lock) \
- do { *(lock) = SPIN_LOCK_UNLOCKED; } while (0)
+ do { *(lock) = __SPIN_LOCK_UNLOCKED(lock); } while (0)
 #endif
 
 #ifdef CONFIG_DEBUG_SPINLOCK
@@ -116,7 +116,7 @@ do { \
 } while (0)
 #else
 # define rwlock_init(lock) \
- do { *(lock) = RW_LOCK_UNLOCKED; } while (0)
+ do { *(lock) = __RW_LOCK_UNLOCKED(lock); } while (0)
 #endif
 
 #define spin_is_locked(lock) __raw_spin_is_locked(&(lock)->raw_lock)
Index: linux-2.6/include/linux/spinlock_types.h
===================================================================
--- linux-2.6.orig/include/linux/spinlock_types.h
+++ linux-2.6/include/linux/spinlock_types.h
@@ -85,15 +85,6 @@ typedef struct {
  RW_DEP_MAP_INIT(lockname) }
 #endif
 
-/*
- * SPIN_LOCK_UNLOCKED and RW_LOCK_UNLOCKED defeat lockdep state tracking and
- * are hence deprecated.
- * Please use DEFINE_SPINLOCK()/DEFINE_RWLOCK() or
- * __SPIN_LOCK_UNLOCKED()/__RW_LOCK_UNLOCKED() as appropriate.
- */
-#define SPIN_LOCK_UNLOCKED __SPIN_LOCK_UNLOCKED(old_style_spin_init)
-#define RW_LOCK_UNLOCKED __RW_LOCK_UNLOCKED(old_style_rw_init)
-
 #define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x)
 #define DEFINE_RWLOCK(x) rwlock_t x = __RW_LOCK_UNLOCKED(x)
 


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

Re: [patch 09/16] powerpc: Replace old style lock initializer

by Benjamin Herrenschmidt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, 2009-11-06 at 22:41 +0000, Thomas Gleixner wrote:
> plain text document attachment
> (power-replace-old-style-lock-init.patch)
> SPIN_LOCK_UNLOCKED is deprecated. Init the lock array at runtime
> instead.
>
> Signed-off-by: Thomas Gleixner <tglx@...>
> Cc: Benjamin Herrenschmidt <benh@...>
> Cc: linuxppc-dev@...
> ---

Looks reasonable. But iseries can be a bitch, so we do need to test it
on monday.

Cheers,
Ben.

>  arch/powerpc/platforms/iseries/htab.c |    8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> Index: linux-2.6/arch/powerpc/platforms/iseries/htab.c
> ===================================================================
> --- linux-2.6.orig/arch/powerpc/platforms/iseries/htab.c
> +++ linux-2.6/arch/powerpc/platforms/iseries/htab.c
> @@ -19,8 +19,7 @@
>  
>  #include "call_hpt.h"
>  
> -static spinlock_t iSeries_hlocks[64] __cacheline_aligned_in_smp =
> - { [0 ... 63] = SPIN_LOCK_UNLOCKED};
> +static spinlock_t iSeries_hlocks[64] __cacheline_aligned_in_smp;
>  
>  /*
>   * Very primitive algorithm for picking up a lock
> @@ -245,6 +244,11 @@ static void iSeries_hpte_invalidate(unsi
>  
>  void __init hpte_init_iSeries(void)
>  {
> + int i;
> +
> + for (i = 0; i < ARRAY_SIZE(iSeries_hlocks); i++)
> + spin_lock_init(&iSeries_hlocks[i]);
> +
>   ppc_md.hpte_invalidate = iSeries_hpte_invalidate;
>   ppc_md.hpte_updatepp = iSeries_hpte_updatepp;
>   ppc_md.hpte_updateboltedpp = iSeries_hpte_updateboltedpp;
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@...
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [patch 05/16] pci: Replace old style lock initializer

by Jesse Barnes-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, 06 Nov 2009 22:41:23 -0000
Thomas Gleixner <tglx@...> wrote:

> SPIN_LOCK_UNLOCKED is deprecated. Use DEFINE_SPINLOCK instead.
>
> Make the lock static while at it.
>
> Signed-off-by: Thomas Gleixner <tglx@...>
> Cc: Jesse Barnes <jbarnes@...>
> ---
>  drivers/pci/pci.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Index: linux-2.6/drivers/pci/pci.c
> ===================================================================
> --- linux-2.6.orig/drivers/pci/pci.c
> +++ linux-2.6/drivers/pci/pci.c
> @@ -2590,7 +2590,7 @@ int pci_set_vga_state(struct pci_dev *de
>  
>  #define RESOURCE_ALIGNMENT_PARAM_SIZE COMMAND_LINE_SIZE
>  static char resource_alignment_param[RESOURCE_ALIGNMENT_PARAM_SIZE]
> = {0}; -spinlock_t resource_alignment_lock = SPIN_LOCK_UNLOCKED;
> +static DEFINE_SPINLOCK(resource_alignment_lock);
>  
>  /**
>   * pci_specified_resource_alignment - get resource alignment
> specified by user.

Applied to my linux-next branch, thanks.

--
Jesse Barnes, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Re: [patch 08/16] sparc: Make atomic locks raw

by David Miller-13 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

From: Thomas Gleixner <tglx@...>
Date: Fri, 06 Nov 2009 22:41:39 -0000

> SPIN_LOCK_UNLOCKED is deprecated and the locks which protect the
> atomic operations have no dependency on other locks and the code is
> well tested so the conversion to a raw lock is safe.
>
> Make the lock array static while at it.
>
> Signed-off-by: Thomas Gleixner <tglx@...>

Applied to sparc-next-2.6, thanks!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
< Prev | 1 - 2 | Next >