diff options
author | Alex Shi <alex.shi@linaro.org> | 2016-04-11 10:23:11 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2016-04-11 10:23:11 +0800 |
commit | bfbd381ea0ca274e4c07ea62acaaeac31829cd5d (patch) | |
tree | 0531122e023ecbf1ecf9416fc1111955b10ea68b /arch/arm64/kernel/debug-monitors.c | |
parent | 906d9eadd3b6698fa6ceb9bcdf41da6aa56d0a24 (diff) | |
parent | 115d588693b6f8f9cfad409c091225d4095159e3 (diff) |
Merge tag 'v4.1.20-rt23' of git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-stable-rt into linux-linaro-lsk-v4.1-rt
Linux 4.1.20-rt23
Diffstat (limited to 'arch/arm64/kernel/debug-monitors.c')
-rw-r--r-- | arch/arm64/kernel/debug-monitors.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c index 70654d843d9b..0d1d675f2cce 100644 --- a/arch/arm64/kernel/debug-monitors.c +++ b/arch/arm64/kernel/debug-monitors.c @@ -184,20 +184,21 @@ static void clear_regs_spsr_ss(struct pt_regs *regs) /* EL1 Single Step Handler hooks */ static LIST_HEAD(step_hook); -static DEFINE_RWLOCK(step_hook_lock); +static DEFINE_SPINLOCK(step_hook_lock); void register_step_hook(struct step_hook *hook) { - write_lock(&step_hook_lock); - list_add(&hook->node, &step_hook); - write_unlock(&step_hook_lock); + spin_lock(&step_hook_lock); + list_add_rcu(&hook->node, &step_hook); + spin_unlock(&step_hook_lock); } void unregister_step_hook(struct step_hook *hook) { - write_lock(&step_hook_lock); - list_del(&hook->node); - write_unlock(&step_hook_lock); + spin_lock(&step_hook_lock); + list_del_rcu(&hook->node); + spin_unlock(&step_hook_lock); + synchronize_rcu(); } /* @@ -211,15 +212,15 @@ static int call_step_hook(struct pt_regs *regs, unsigned int esr) struct step_hook *hook; int retval = DBG_HOOK_ERROR; - read_lock(&step_hook_lock); + rcu_read_lock(); - list_for_each_entry(hook, &step_hook, node) { + list_for_each_entry_rcu(hook, &step_hook, node) { retval = hook->fn(regs, esr); if (retval == DBG_HOOK_HANDLED) break; } - read_unlock(&step_hook_lock); + rcu_read_unlock(); return retval; } |