Skip to content

Commit 1d4c79e

Browse files
committed
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fix from Herbert Xu: "This reverts a number of changes to the khwrng thread which feeds the kernel random number pool from hwrng drivers. They were trying to fix issues with suspend-and-resume but ended up causing regressions" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: Revert "hwrng: core - Freeze khwrng thread during suspend"
2 parents fe30021 + 08e97ae commit 1d4c79e

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

drivers/char/hw_random/core.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include <linux/delay.h>
1414
#include <linux/device.h>
1515
#include <linux/err.h>
16-
#include <linux/freezer.h>
1716
#include <linux/fs.h>
1817
#include <linux/hw_random.h>
1918
#include <linux/kernel.h>
@@ -422,9 +421,7 @@ static int hwrng_fillfn(void *unused)
422421
{
423422
long rc;
424423

425-
set_freezable();
426-
427-
while (!kthread_freezable_should_stop(NULL)) {
424+
while (!kthread_should_stop()) {
428425
struct hwrng *rng;
429426

430427
rng = get_current_rng();

drivers/char/random.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@
327327
#include <linux/percpu.h>
328328
#include <linux/cryptohash.h>
329329
#include <linux/fips.h>
330-
#include <linux/freezer.h>
331330
#include <linux/ptrace.h>
332331
#include <linux/workqueue.h>
333332
#include <linux/irq.h>
@@ -2500,8 +2499,7 @@ void add_hwgenerator_randomness(const char *buffer, size_t count,
25002499
* We'll be woken up again once below random_write_wakeup_thresh,
25012500
* or when the calling thread is about to terminate.
25022501
*/
2503-
wait_event_freezable(random_write_wait,
2504-
kthread_should_stop() ||
2502+
wait_event_interruptible(random_write_wait, kthread_should_stop() ||
25052503
ENTROPY_BITS(&input_pool) <= random_write_wakeup_bits);
25062504
mix_pool_bytes(poolp, buffer, count);
25072505
credit_entropy_bits(poolp, entropy);

0 commit comments

Comments
 (0)