All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/2] tools/env: minor fixes plus resend
@ 2016-08-17 21:41 Andreas Fenkart
  2016-08-17 21:41 ` [U-Boot] [PATCH 1/2] tools/env: return with error if redundant environments have unequal size Andreas Fenkart
  2016-08-17 21:41 ` [U-Boot] [PATCH 2/2] tools/env: soften warning about erase block alignment Andreas Fenkart
  0 siblings, 2 replies; 7+ messages in thread
From: Andreas Fenkart @ 2016-08-17 21:41 UTC (permalink / raw)
  To: u-boot

The redundant environment patch was already submitted once,
but not applied due to a merge conflict.
The second patch is an addon to 183923d3e as suggested by Stefan Agner

Andreas Fenkart (2):
  tools/env: return with error if redundant environments have unequal
    size
  tools/env: soften warning about erase block alignment

 tools/env/fw_env.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

-- 
2.8.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 1/2] tools/env: return with error if redundant environments have unequal size
  2016-08-17 21:41 [U-Boot] [PATCH 0/2] tools/env: minor fixes plus resend Andreas Fenkart
@ 2016-08-17 21:41 ` Andreas Fenkart
  2016-08-19 19:55   ` Tom Rini
  2016-08-21 15:09   ` [U-Boot] [U-Boot, " Tom Rini
  2016-08-17 21:41 ` [U-Boot] [PATCH 2/2] tools/env: soften warning about erase block alignment Andreas Fenkart
  1 sibling, 2 replies; 7+ messages in thread
From: Andreas Fenkart @ 2016-08-17 21:41 UTC (permalink / raw)
  To: u-boot

For double buffering to work, the target buffer must always be big
enough to hold all data. This can only be ensured if buffers are of
equal size, otherwise one must be smaller and we risk data loss
when copying from the bigger to the smaller buffer.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
---
 tools/env/fw_env.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index d2b167d..7cc7488 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -1423,10 +1423,9 @@ static int parse_config(struct env_opts *opts)
 			return rc;
 
 		if (ENVSIZE(0) != ENVSIZE(1)) {
-			ENVSIZE(0) = ENVSIZE(1) = min(ENVSIZE(0), ENVSIZE(1));
 			fprintf(stderr,
-				"Redundant environments have inequal size, set to 0x%08lx\n",
-				ENVSIZE(1));
+				"Redundant environments have unequal size");
+			return -1;
 		}
 	}
 
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 2/2] tools/env: soften warning about erase block alignment
  2016-08-17 21:41 [U-Boot] [PATCH 0/2] tools/env: minor fixes plus resend Andreas Fenkart
  2016-08-17 21:41 ` [U-Boot] [PATCH 1/2] tools/env: return with error if redundant environments have unequal size Andreas Fenkart
@ 2016-08-17 21:41 ` Andreas Fenkart
  2016-08-19 19:55   ` Tom Rini
  2016-08-21 15:09   ` [U-Boot] [U-Boot, " Tom Rini
  1 sibling, 2 replies; 7+ messages in thread
From: Andreas Fenkart @ 2016-08-17 21:41 UTC (permalink / raw)
  To: u-boot

addon 183923d3e
MMC/SATA have no erase blocks, only blocks. Hence the warning
about erase block alignment might be confusing in such environment.

Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
---
 tools/env/fw_env.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 7cc7488..d27f57e 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -1295,7 +1295,7 @@ static int check_device_config(int dev)
 	int fd, rc = 0;
 
 	if (DEVOFFSET(dev) % DEVESIZE(dev) != 0) {
-		fprintf(stderr, "Environment does not start on erase block boundary\n");
+		fprintf(stderr, "Environment does not start on (erase) block boundary\n");
 		errno = EINVAL;
 		return -1;
 	}
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 1/2] tools/env: return with error if redundant environments have unequal size
  2016-08-17 21:41 ` [U-Boot] [PATCH 1/2] tools/env: return with error if redundant environments have unequal size Andreas Fenkart
@ 2016-08-19 19:55   ` Tom Rini
  2016-08-21 15:09   ` [U-Boot] [U-Boot, " Tom Rini
  1 sibling, 0 replies; 7+ messages in thread
From: Tom Rini @ 2016-08-19 19:55 UTC (permalink / raw)
  To: u-boot

On Wed, Aug 17, 2016 at 11:41:53PM +0200, Andreas Fenkart wrote:

> For double buffering to work, the target buffer must always be big
> enough to hold all data. This can only be ensured if buffers are of
> equal size, otherwise one must be smaller and we risk data loss
> when copying from the bigger to the smaller buffer.
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>

Reviewed-by: Tom Rini <trini@konsulko.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160819/1d0194e8/attachment.sig>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 2/2] tools/env: soften warning about erase block alignment
  2016-08-17 21:41 ` [U-Boot] [PATCH 2/2] tools/env: soften warning about erase block alignment Andreas Fenkart
@ 2016-08-19 19:55   ` Tom Rini
  2016-08-21 15:09   ` [U-Boot] [U-Boot, " Tom Rini
  1 sibling, 0 replies; 7+ messages in thread
From: Tom Rini @ 2016-08-19 19:55 UTC (permalink / raw)
  To: u-boot

On Wed, Aug 17, 2016 at 11:41:54PM +0200, Andreas Fenkart wrote:

> addon 183923d3e
> MMC/SATA have no erase blocks, only blocks. Hence the warning
> about erase block alignment might be confusing in such environment.
> 
> Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>

Reviewed-by: Tom Rini <trini@konsulko.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160819/90a70d0c/attachment.sig>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [U-Boot, 1/2] tools/env: return with error if redundant environments have unequal size
  2016-08-17 21:41 ` [U-Boot] [PATCH 1/2] tools/env: return with error if redundant environments have unequal size Andreas Fenkart
  2016-08-19 19:55   ` Tom Rini
@ 2016-08-21 15:09   ` Tom Rini
  1 sibling, 0 replies; 7+ messages in thread
From: Tom Rini @ 2016-08-21 15:09 UTC (permalink / raw)
  To: u-boot

On Wed, Aug 17, 2016 at 11:41:53PM +0200, Andreas Fenkart wrote:

> For double buffering to work, the target buffer must always be big
> enough to hold all data. This can only be ensured if buffers are of
> equal size, otherwise one must be smaller and we risk data loss
> when copying from the bigger to the smaller buffer.
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
> Reviewed-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160821/3a773b1a/attachment.sig>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [U-Boot, 2/2] tools/env: soften warning about erase block alignment
  2016-08-17 21:41 ` [U-Boot] [PATCH 2/2] tools/env: soften warning about erase block alignment Andreas Fenkart
  2016-08-19 19:55   ` Tom Rini
@ 2016-08-21 15:09   ` Tom Rini
  1 sibling, 0 replies; 7+ messages in thread
From: Tom Rini @ 2016-08-21 15:09 UTC (permalink / raw)
  To: u-boot

On Wed, Aug 17, 2016 at 11:41:54PM +0200, Andreas Fenkart wrote:

> addon 183923d3e
> MMC/SATA have no erase blocks, only blocks. Hence the warning
> about erase block alignment might be confusing in such environment.
> 
> Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
> Reviewed-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160821/b2e33612/attachment.sig>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-08-21 15:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-17 21:41 [U-Boot] [PATCH 0/2] tools/env: minor fixes plus resend Andreas Fenkart
2016-08-17 21:41 ` [U-Boot] [PATCH 1/2] tools/env: return with error if redundant environments have unequal size Andreas Fenkart
2016-08-19 19:55   ` Tom Rini
2016-08-21 15:09   ` [U-Boot] [U-Boot, " Tom Rini
2016-08-17 21:41 ` [U-Boot] [PATCH 2/2] tools/env: soften warning about erase block alignment Andreas Fenkart
2016-08-19 19:55   ` Tom Rini
2016-08-21 15:09   ` [U-Boot] [U-Boot, " Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.