]> git.baikalelectronics.ru Git - kernel.git/commit
random: remove preempt disabled region
authorIngo Molnar <mingo@elte.hu>
Sun, 22 Jul 2018 14:51:50 +0000 (10:51 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 24 Jul 2018 19:44:32 +0000 (15:44 -0400)
commitd444fee14a44e79c66598e0e55a4f713a887b094
tree856e8498c1293498a443b2007759cd36f54a5df6
parente16c57df55069b1fb9719e353547799ab957ed2a
random: remove preempt disabled region

No need to keep preemption disabled across the whole function.

mix_pool_bytes() uses a spin_lock() to protect the pool and there are
other places like write_pool() whhich invoke mix_pool_bytes() without
disabling preemption.
credit_entropy_bits() is invoked from other places like
add_hwgenerator_randomness() without disabling preemption.

Before commit 69f30eb8b3e6 ("random: drop trickle mode") the function
used __this_cpu_inc_return() which would require disabled preemption.
The preempt_disable() section was added in commit 43d5d3018c37 ("[PATCH]
random driver preempt robustness", history tree).  It was claimed that
the code relied on "vt_ioctl() being called under BKL".

Cc: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
[bigeasy: enhance the commit message]
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
drivers/char/random.c