diff mbox

[U-Boot] aboot: fix block addressing for don't care chunk type

Message ID 1413429576-15336-1-git-send-email-robherring2@gmail.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Rob Herring Oct. 16, 2014, 3:19 a.m. UTC
From: Rob Herring <robh@kernel.org>

CHUNK_TYPE_DONT_CARE should skip over the specified number of blocks, but
currently fails to increment the device block address. This results in
filesystem images getting written incorrectly. Add the missing block
address incrementing.

Cc: Steve Rae <srae@broadcom.com>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 common/aboot.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Steve Rae Oct. 17, 2014, 5:17 p.m. UTC | #1
Hi Rob:

THANKS!

On 14-10-15 08:19 PM, Rob Herring wrote:
> From: Rob Herring <robh@kernel.org>
>
> CHUNK_TYPE_DONT_CARE should skip over the specified number of blocks, but
> currently fails to increment the device block address. This results in
> filesystem images getting written incorrectly. Add the missing block
> address incrementing.
>
> Cc: Steve Rae <srae@broadcom.com>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>   common/aboot.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/common/aboot.c b/common/aboot.c
> index d5c464b..fba8e3e 100644
> --- a/common/aboot.c
> +++ b/common/aboot.c
> @@ -208,6 +208,7 @@ void write_sparse_image(block_dev_desc_t *dev_desc,
>   			break;
>
>   			case CHUNK_TYPE_DONT_CARE:
> +			blk += blkcnt;
>   			total_blocks += chunk_header->chunk_sz;
>   			break;
>
>

Reviewed-by: Steve Rae <srae@broadcom.com>
Tom Rini Oct. 27, 2014, 10:21 p.m. UTC | #2
On Thu, Oct 16, 2014 at 11:19:36AM +0800, Rob Herring wrote:

> From: Rob Herring <robh@kernel.org>
> 
> CHUNK_TYPE_DONT_CARE should skip over the specified number of blocks, but
> currently fails to increment the device block address. This results in
> filesystem images getting written incorrectly. Add the missing block
> address incrementing.
> 
> Cc: Steve Rae <srae@broadcom.com>
> Signed-off-by: Rob Herring <robh@kernel.org>
> Reviewed-by: Steve Rae <srae@broadcom.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/common/aboot.c b/common/aboot.c
index d5c464b..fba8e3e 100644
--- a/common/aboot.c
+++ b/common/aboot.c
@@ -208,6 +208,7 @@  void write_sparse_image(block_dev_desc_t *dev_desc,
 			break;
 
 			case CHUNK_TYPE_DONT_CARE:
+			blk += blkcnt;
 			total_blocks += chunk_header->chunk_sz;
 			break;