Skip to content

Commit 74ffe79

Browse files
Sebastian Andrzej SiewiorRussell King
authored andcommitted
ARM: 8840/1: use a raw_spinlock_t in unwind
Mostly unwind is done with irqs enabled however SLUB may call it with irqs disabled while creating a new SLUB cache. I had system freeze while loading a module which called kmem_cache_create() on init. That means SLUB's __slab_alloc() disabled interrupts and then ->new_slab_objects() ->new_slab() ->setup_object() ->setup_object_debug() ->init_tracking() ->set_track() ->save_stack_trace() ->save_stack_trace_tsk() ->walk_stackframe() ->unwind_frame() ->unwind_find_idx() =>spin_lock_irqsave(&unwind_lock); Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
1 parent 143c2a8 commit 74ffe79

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

arch/arm/kernel/unwind.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ extern const struct unwind_idx __start_unwind_idx[];
9393
static const struct unwind_idx *__origin_unwind_idx;
9494
extern const struct unwind_idx __stop_unwind_idx[];
9595

96-
static DEFINE_SPINLOCK(unwind_lock);
96+
static DEFINE_RAW_SPINLOCK(unwind_lock);
9797
static LIST_HEAD(unwind_tables);
9898

9999
/* Convert a prel31 symbol to an absolute address */
@@ -201,7 +201,7 @@ static const struct unwind_idx *unwind_find_idx(unsigned long addr)
201201
/* module unwind tables */
202202
struct unwind_table *table;
203203

204-
spin_lock_irqsave(&unwind_lock, flags);
204+
raw_spin_lock_irqsave(&unwind_lock, flags);
205205
list_for_each_entry(table, &unwind_tables, list) {
206206
if (addr >= table->begin_addr &&
207207
addr < table->end_addr) {
@@ -213,7 +213,7 @@ static const struct unwind_idx *unwind_find_idx(unsigned long addr)
213213
break;
214214
}
215215
}
216-
spin_unlock_irqrestore(&unwind_lock, flags);
216+
raw_spin_unlock_irqrestore(&unwind_lock, flags);
217217
}
218218

219219
pr_debug("%s: idx = %p\n", __func__, idx);
@@ -529,9 +529,9 @@ struct unwind_table *unwind_table_add(unsigned long start, unsigned long size,
529529
tab->begin_addr = text_addr;
530530
tab->end_addr = text_addr + text_size;
531531

532-
spin_lock_irqsave(&unwind_lock, flags);
532+
raw_spin_lock_irqsave(&unwind_lock, flags);
533533
list_add_tail(&tab->list, &unwind_tables);
534-
spin_unlock_irqrestore(&unwind_lock, flags);
534+
raw_spin_unlock_irqrestore(&unwind_lock, flags);
535535

536536
return tab;
537537
}
@@ -543,9 +543,9 @@ void unwind_table_del(struct unwind_table *tab)
543543
if (!tab)
544544
return;
545545

546-
spin_lock_irqsave(&unwind_lock, flags);
546+
raw_spin_lock_irqsave(&unwind_lock, flags);
547547
list_del(&tab->list);
548-
spin_unlock_irqrestore(&unwind_lock, flags);
548+
raw_spin_unlock_irqrestore(&unwind_lock, flags);
549549

550550
kfree(tab);
551551
}

0 commit comments

Comments
 (0)