summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlrich Ölmann <u.oelmann@pengutronix.de>2018-12-18 14:57:30 +0100
committerRoland Hieber <rhi@pengutronix.de>2019-01-07 12:26:49 +0100
commite51096e54f8638f8b657d594b4cc81e3dda8870c (patch)
tree79873079a056bac32b09d3ae5bebe5cec93be131
parent02ca39f0ff1cf5bb32df1dcf744cb19a052eef7b (diff)
downloaddt-utils-e51096e54f8638f8b657d594b4cc81e3dda8870c.tar.gz
dt-utils-e51096e54f8638f8b657d594b4cc81e3dda8870c.tar.xz
state: backend_storage: Set needs_refresh back to 0 after refreshing
This ports the following barebox commit: | commit 275f35461a454be350ca18a25042be8800ac5008 | Author: Sascha Hauer <s.hauer@pengutronix.de> | Date: Wed Apr 19 10:18:42 2017 +0200 | | state: backend_storage: Set needs_refresh back to 0 after refreshing | | Set needs_refresh back to 0 after refreshing so that we do not refresh | it again without need. This would only happen when we read the state | from the storage multiple times, which normally is not the case. | However, it's more consistent like this. | | Reported-by: Sam Ravnborg <sam@ravnborg.org> | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
-rw-r--r--src/barebox-state/backend_storage.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/barebox-state/backend_storage.c b/src/barebox-state/backend_storage.c
index c9bbfd8..8812d73 100644
--- a/src/barebox-state/backend_storage.c
+++ b/src/barebox-state/backend_storage.c
@@ -110,12 +110,14 @@ static int bucket_refresh(struct state_backend_storage *storage,
refresh:
ret = bucket->write(bucket, buf, len);
- if (ret)
+ if (ret) {
dev_warn(storage->dev, "Failed to restore bucket %d@0x%08lx\n",
bucket->num, bucket->offset);
- else
+ } else {
dev_info(storage->dev, "restored bucket %d@0x%08lx\n",
bucket->num, bucket->offset);
+ bucket->needs_refresh = 0;
+ }
return ret;
}