summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlrich Ölmann <u.oelmann@pengutronix.de>2018-12-18 14:57:44 +0100
committerRoland Hieber <rhi@pengutronix.de>2019-01-07 12:26:50 +0100
commit5b6b6daa2dece53ed2b789758365323015e2adca (patch)
treec97e15c9d9bc48d2df6ed251ba4981d46f71590c
parent42035d76ede17b30bbc3b08175b2d954dd2c4b25 (diff)
downloaddt-utils-5b6b6daa2dece53ed2b789758365323015e2adca.tar.gz
dt-utils-5b6b6daa2dece53ed2b789758365323015e2adca.tar.xz
state: add debugging help
This ports the following barebox commit: | commit b6a35329fe07bc4e4d34506d541853c076692140 | Author: Juergen Borleis <jbe@pengutronix.de> | Date: Tue Aug 15 15:46:35 2017 +0200 | | state: add debugging help | | While working on the state documentation it turns out to be helpful to have | more debug messages while a developer implements a 'state' variable set | and tries to configure it correctly. | | Signed-off-by: Juergen Borleis <jbe@pengutronix.de> | 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.c7
-rw-r--r--src/barebox-state/state.c2
2 files changed, 8 insertions, 1 deletions
diff --git a/src/barebox-state/backend_storage.c b/src/barebox-state/backend_storage.c
index db38553..b36c956 100644
--- a/src/barebox-state/backend_storage.c
+++ b/src/barebox-state/backend_storage.c
@@ -146,6 +146,7 @@ int state_storage_read(struct state_backend_storage *storage,
struct state_backend_storage_bucket *bucket, *bucket_used = NULL;
int ret;
+ dev_dbg(storage->dev, "Checking redundant buckets...\n");
/*
* Iterate over all buckets. The first valid one we find is the
* one we want to use.
@@ -164,8 +165,12 @@ int state_storage_read(struct state_backend_storage *storage,
ret = format->verify(format, magic, bucket->buf, &bucket->len, flags);
if (!ret && !bucket_used)
bucket_used = bucket;
+ if (ret)
+ dev_info(storage->dev, "Ignoring broken bucket %d@0x%08lx...\n", bucket->num, bucket->offset);
}
+ dev_dbg(storage->dev, "Checking redundant buckets finished.\n");
+
if (!bucket_used) {
dev_err(storage->dev, "Failed to find any valid state copy in any bucket\n");
@@ -384,7 +389,7 @@ int state_storage_init(struct state *state, const char *path,
dev_warn(storage->dev, "using old format circular storage type.\n");
circular = false;
} else {
- dev_warn(storage->dev, "unknown storage type '%s'\n", storagetype);
+ dev_dbg(storage->dev, "unknown storage type '%s'\n", storagetype);
return -EINVAL;
}
return state_storage_mtd_buckets_init(storage, &meminfo, circular);
diff --git a/src/barebox-state/state.c b/src/barebox-state/state.c
index 94c1203..7ac4b53 100644
--- a/src/barebox-state/state.c
+++ b/src/barebox-state/state.c
@@ -608,11 +608,13 @@ struct state *state_new_from_node(struct device_node *node, char *path,
ret = of_property_read_string(node, "backend-type", &backend_type);
if (ret) {
+ dev_dbg(&state->dev, "Missing 'backend-type' property\n");
goto out_release_state;
}
ret = of_property_read_u32(node, "backend-stridesize", &stridesize);
if (ret) {
+ dev_dbg(&state->dev, "'backend-stridesize' property undefined, trying to continue without\n");
stridesize = 0;
}