Skip to content

Commit

Permalink
jump_label: Make it possible for arches to invoke jump_label_init() e…
Browse files Browse the repository at this point in the history
…arlier

Some arches (powerpc at least) would like to invoke jump_label_init()
much earlier in boot. So check static_key_initialized in order to make
sure this function runs only once.

LGTM-by: Ingo (http://marc.info/?l=linux-kernel&m=144049104329961&w=2)
Signed-off-by: Kevin Hao <[email protected]>
Signed-off-by: Aneesh Kumar K.V <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
  • Loading branch information
haokexin authored and mpe committed Aug 1, 2016
1 parent b8f1b4f commit e3f9108
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kernel/jump_label.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ void __init jump_label_init(void)
struct static_key *key = NULL;
struct jump_entry *iter;

if (static_key_initialized)
return;

jump_label_lock();
jump_label_sort_entries(iter_start, iter_stop);

Expand Down

0 comments on commit e3f9108

Please sign in to comment.