Merge pull request #44 from resin-os/alta

Release v2.13.6+rev1
This commit is contained in:
Florin Sarbu 2018-07-13 17:32:04 +03:00 committed by GitHub
commit 5351da8fe9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 85 additions and 2 deletions

View file

@ -1,6 +1,13 @@
Change log
-----------
# v2.13.6+rev1
## (2018-07-13)
* Update the meta-resin submodule to version v2.13.6 [Sebastian]
* linux-mainline: Revert "random: fix crng_ready() test" patch [Sebastian]
* coffeescript: Add instructions for flashing OrangePi Plus2 [Thodoris]
# v2.13.5+rev1
## (2018-07-09)

View file

@ -1 +1 @@
2.13.5+rev1
2.13.6+rev1

@ -1 +1 @@
Subproject commit 84cfe72157abf81a1615b927eec5575839123c1c
Subproject commit e167839b84b4e93313942a47078a896a6e32b6a2

View file

@ -0,0 +1,75 @@
From 454598f8cef2fc2dead0e139e6844d7b5da624e8 Mon Sep 17 00:00:00 2001
From: Sebastian Panceac <sebastian@resin.io>
Date: Fri, 13 Jul 2018 15:49:58 +0300
Subject: [PATCH] Revert "random: fix crng_ready() test"
This reverts commit 43838a23a05fbd13e47d750d3dfd77001536dd33.
The reason for reverting this commit is that entropy gets acquired very
hard on Orange Pi Plus2.
The hardware crypto module is not supported yet for H3 SoC in this kernel version.
It is expected to be included in 4.18 kernel.
As NetworkManager is depending on randomness to succesfully set its connections, if we don't revert
this commit, the board can get blocked for minutes until it succesfully connects to a network.
This patch should be reverted immediately when upgrading to a kernel where hw crypto is supported.
Upstream-Status: Inappropriate [configuration]
Signed-off-by: Sebastian Panceac <sebastian@resin.io>
---
drivers/char/random.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/char/random.c b/drivers/char/random.c
index cd888d4..02fa271 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -428,7 +428,7 @@ struct crng_state primary_crng = {
* its value (from 0->1->2).
*/
static int crng_init = 0;
-#define crng_ready() (likely(crng_init > 1))
+#define crng_ready() (likely(crng_init > 0))
static int crng_init_cnt = 0;
static unsigned long crng_global_init_time = 0;
#define CRNG_INIT_CNT_THRESH (2*CHACHA20_KEY_SIZE)
@@ -843,7 +843,7 @@ static int crng_fast_load(const char *cp, size_t len)
if (!spin_trylock_irqsave(&primary_crng.lock, flags))
return 0;
- if (crng_init != 0) {
+ if (crng_ready()) {
spin_unlock_irqrestore(&primary_crng.lock, flags);
return 0;
}
@@ -966,6 +966,7 @@ static void _extract_crng(struct crng_state *crng,
if (crng_ready() &&
(time_after(crng_global_init_time, crng->init_time) ||
time_after(jiffies, crng->init_time + CRNG_RESEED_INTERVAL)))
+
crng_reseed(crng, crng == &primary_crng ? &input_pool : NULL);
spin_lock_irqsave(&crng->lock, flags);
if (arch_get_random_long(&v))
@@ -1245,7 +1246,7 @@ void add_interrupt_randomness(int irq, int irq_flags)
fast_mix(fast_pool);
add_interrupt_bench(cycles);
- if (unlikely(crng_init == 0)) {
+ if (!crng_ready()) {
if ((fast_pool->count >= 64) &&
crng_fast_load((char *) fast_pool->pool,
sizeof(fast_pool->pool))) {
@@ -2314,7 +2315,7 @@ void add_hwgenerator_randomness(const char *buffer, size_t count,
{
struct entropy_store *poolp = &input_pool;
- if (unlikely(crng_init == 0)) {
+ if (!crng_ready()) {
crng_fast_load(buffer, count);
return;
}
--
2.7.4

View file

@ -23,4 +23,5 @@ SRC_URI = "https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-${PV}.tar.xz \
file://defconfig \
file://don-t-default-activate-regdb.patch \
file://0001-Enable-i2c0-on-OrangePi-Plus2-board.patch \
file://0001-Revert-random-fix-crng_ready-test.patch \
"