X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=arch%2Fparisc%2Fkernel%2Fperf.c;h=75099efb3bf37bc4c2695611b5f04162b4eb67de;hb=29a41e9e029d21c306e3ad6e723700348b04706a;hp=89d6d5ad44b5258f4ff61ae487c8ed1020bf115b;hpb=22b1a9203ea634ac0ee5240e021613da3328275f;p=linux-2.6-omap-h63xx.git diff --git a/arch/parisc/kernel/perf.c b/arch/parisc/kernel/perf.c index 89d6d5ad44b..75099efb3bf 100644 --- a/arch/parisc/kernel/perf.c +++ b/arch/parisc/kernel/perf.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -260,13 +261,16 @@ printk("Preparing to start counters\n"); */ static int perf_open(struct inode *inode, struct file *file) { + lock_kernel(); spin_lock(&perf_lock); if (perf_enabled) { spin_unlock(&perf_lock); + unlock_kernel(); return -EBUSY; } perf_enabled = 1; spin_unlock(&perf_lock); + unlock_kernel(); return 0; } @@ -537,9 +541,9 @@ static int __init perf_init(void) spin_lock_init(&perf_lock); /* TODO: this only lets us access the first cpu.. what to do for SMP? */ - cpu_device = cpu_data[0].dev; + cpu_device = per_cpu(cpu_data, 0).dev; printk("Performance monitoring counters enabled for %s\n", - cpu_data[0].dev->name); + per_cpu(cpu_data, 0).dev->name); return 0; }