Commit 0ef0a8e3 authored by Thomas Gleixner's avatar Thomas Gleixner

oprofile: Covert to atomic_spinlock

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 87f163a2
...@@ -48,9 +48,9 @@ static int op_arm_setup(void) ...@@ -48,9 +48,9 @@ static int op_arm_setup(void)
{ {
int ret; int ret;
spin_lock(&oprofilefs_lock); atomic_spin_lock(&oprofilefs_lock);
ret = op_arm_model->setup_ctrs(); ret = op_arm_model->setup_ctrs();
spin_unlock(&oprofilefs_lock); atomic_spin_unlock(&oprofilefs_lock);
return ret; return ret;
} }
......
...@@ -125,9 +125,9 @@ static void nmi_cpu_setup(void *dummy) ...@@ -125,9 +125,9 @@ static void nmi_cpu_setup(void *dummy)
{ {
int cpu = smp_processor_id(); int cpu = smp_processor_id();
struct op_msrs *msrs = &per_cpu(cpu_msrs, cpu); struct op_msrs *msrs = &per_cpu(cpu_msrs, cpu);
spin_lock(&oprofilefs_lock); atomic_spin_lock(&oprofilefs_lock);
model->setup_ctrs(msrs); model->setup_ctrs(msrs);
spin_unlock(&oprofilefs_lock); atomic_spin_unlock(&oprofilefs_lock);
per_cpu(saved_lvtpc, cpu) = apic_read(APIC_LVTPC); per_cpu(saved_lvtpc, cpu) = apic_read(APIC_LVTPC);
apic_write(APIC_LVTPC, APIC_DM_NMI); apic_write(APIC_LVTPC, APIC_DM_NMI);
} }
......
...@@ -72,10 +72,10 @@ int alloc_event_buffer(void) ...@@ -72,10 +72,10 @@ int alloc_event_buffer(void)
int err = -ENOMEM; int err = -ENOMEM;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&oprofilefs_lock, flags); atomic_spin_lock_irqsave(&oprofilefs_lock, flags);
buffer_size = oprofile_buffer_size; buffer_size = oprofile_buffer_size;
buffer_watershed = oprofile_buffer_watershed; buffer_watershed = oprofile_buffer_watershed;
spin_unlock_irqrestore(&oprofilefs_lock, flags); atomic_spin_unlock_irqrestore(&oprofilefs_lock, flags);
if (buffer_watershed >= buffer_size) if (buffer_watershed >= buffer_size)
return -EINVAL; return -EINVAL;
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#define OPROFILEFS_MAGIC 0x6f70726f #define OPROFILEFS_MAGIC 0x6f70726f
DEFINE_SPINLOCK(oprofilefs_lock); DEFINE_ATOMIC_SPINLOCK(oprofilefs_lock);
static struct inode *oprofilefs_get_inode(struct super_block *sb, int mode) static struct inode *oprofilefs_get_inode(struct super_block *sb, int mode)
{ {
...@@ -75,9 +75,9 @@ int oprofilefs_ulong_from_user(unsigned long *val, char const __user *buf, size_ ...@@ -75,9 +75,9 @@ int oprofilefs_ulong_from_user(unsigned long *val, char const __user *buf, size_
if (copy_from_user(tmpbuf, buf, count)) if (copy_from_user(tmpbuf, buf, count))
return -EFAULT; return -EFAULT;
spin_lock_irqsave(&oprofilefs_lock, flags); atomic_spin_lock_irqsave(&oprofilefs_lock, flags);
*val = simple_strtoul(tmpbuf, NULL, 0); *val = simple_strtoul(tmpbuf, NULL, 0);
spin_unlock_irqrestore(&oprofilefs_lock, flags); atomic_spin_unlock_irqrestore(&oprofilefs_lock, flags);
return 0; return 0;
} }
......
...@@ -153,7 +153,7 @@ ssize_t oprofilefs_ulong_to_user(unsigned long val, char __user * buf, size_t co ...@@ -153,7 +153,7 @@ ssize_t oprofilefs_ulong_to_user(unsigned long val, char __user * buf, size_t co
int oprofilefs_ulong_from_user(unsigned long * val, char const __user * buf, size_t count); int oprofilefs_ulong_from_user(unsigned long * val, char const __user * buf, size_t count);
/** lock for read/write safety */ /** lock for read/write safety */
extern spinlock_t oprofilefs_lock; extern atomic_spinlock_t oprofilefs_lock;
/** /**
* Add the contents of a circular buffer to the event buffer. * Add the contents of a circular buffer to the event buffer.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment