Commit 76cffeb6 authored by Helge Deller's avatar Helge Deller

parisc: Static initialization of spinlocks in perf and unwind code

While testing UBSAN I saw this BUG:
 BUG: spinlock bad magic on CPU#0, swapper/0
in unwind code. Let's avoid that by static initialization.
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent 54ac8fcb
...@@ -69,7 +69,7 @@ struct rdr_tbl_ent { ...@@ -69,7 +69,7 @@ struct rdr_tbl_ent {
static int perf_processor_interface __read_mostly = UNKNOWN_INTF; static int perf_processor_interface __read_mostly = UNKNOWN_INTF;
static int perf_enabled __read_mostly; static int perf_enabled __read_mostly;
static spinlock_t perf_lock; static DEFINE_SPINLOCK(perf_lock);
struct parisc_device *cpu_device __read_mostly; struct parisc_device *cpu_device __read_mostly;
/* RDRs to write for PCX-W */ /* RDRs to write for PCX-W */
...@@ -533,8 +533,6 @@ static int __init perf_init(void) ...@@ -533,8 +533,6 @@ static int __init perf_init(void)
/* Patch the images to match the system */ /* Patch the images to match the system */
perf_patch_images(); perf_patch_images();
spin_lock_init(&perf_lock);
/* TODO: this only lets us access the first cpu.. what to do for SMP? */ /* TODO: this only lets us access the first cpu.. what to do for SMP? */
cpu_device = per_cpu(cpu_data, 0).dev; cpu_device = per_cpu(cpu_data, 0).dev;
printk("Performance monitoring counters enabled for %s\n", printk("Performance monitoring counters enabled for %s\n",
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
extern struct unwind_table_entry __start___unwind[]; extern struct unwind_table_entry __start___unwind[];
extern struct unwind_table_entry __stop___unwind[]; extern struct unwind_table_entry __stop___unwind[];
static spinlock_t unwind_lock; static DEFINE_SPINLOCK(unwind_lock);
/* /*
* the kernel unwind block is not dynamically allocated so that * the kernel unwind block is not dynamically allocated so that
* we can call unwind_init as early in the bootup process as * we can call unwind_init as early in the bootup process as
...@@ -181,8 +181,6 @@ int __init unwind_init(void) ...@@ -181,8 +181,6 @@ int __init unwind_init(void)
start = (long)&__start___unwind[0]; start = (long)&__start___unwind[0];
stop = (long)&__stop___unwind[0]; stop = (long)&__stop___unwind[0];
spin_lock_init(&unwind_lock);
printk("unwind_init: start = 0x%lx, end = 0x%lx, entries = %lu\n", printk("unwind_init: start = 0x%lx, end = 0x%lx, entries = %lu\n",
start, stop, start, stop,
(stop - start) / sizeof(struct unwind_table_entry)); (stop - start) / sizeof(struct unwind_table_entry));
......
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