fastboot: sparse: fix block addressing for don't care chunk type
PATCH v2 1/2 fastboot: sparse: fix block addressing for don't care chunk type
When 7bfc3b1 (sparse: Refactor chunk parsing function) was implemented, it dropped 9981945 (aboot: fix block addressing for don't care chunk type).
This re-implements the required fix for the "don't care chunk type"...
---
Changes in v2:
Handle MMC device differently than the NAND device.
common/image-sparse.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
common/image-sparse.c +8 -4
@@ -330,9 +330,13 @@ int store_sparse_image(sparse_storage_t *storage, void *storage_priv,* and go on parsing the rest of the chunks */ if (chunk_header->chunk_type ==CHUNK_TYPE_DONT_CARE ) { - skipped +=sparse_block_size_to_storage (chunk_header->chunk_sz, - storage, - sparse_header); + blkcnt =sparse_block_size_to_storage (chunk_header->chunk_sz, + storage, + sparse_header); +#ifdef CONFIG_FASTBOOT_FLASH_MMC_DEV + total_blocks += blkcnt; +#endif + skipped += blkcnt;continue ; }
@@ -380,7 +384,7 @@ int store_sparse_image(sparse_storage_t *storage, void *storage_priv,printf ("........ wrote %d blocks to '%s'\n" , total_blocks, storage->name); -if ((total_blocks + skipped) != +if (total_blocks !=sparse_block_size_to_storage (sparse_header->total_blks, storage, sparse_header)) {printf ("sparse image write failure\n" );
Signature · 1 line
1.8.5
PATCH v2 2/2 fastboot: sparse: remove unnecessary logging
remove logging of the 'skipped' blocks
---
Changes in v2: None
common/image-sparse.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
common/image-sparse.c +2 -4
@@ -275,7 +275,6 @@ int store_sparse_image(sparse_storage_t *storage, void *storage_priv,sparse_buffer_t *buffer;uint32_t start;uint32_t total_blocks =0 ; -uint32_t skipped =0 ;int i;debug ("=== Storage ===\n" );
@@ -336,7 +335,6 @@ int store_sparse_image(sparse_storage_t *storage, void *storage_priv,#ifdef CONFIG_FASTBOOT_FLASH_MMC_DEV total_blocks += blkcnt;#endif - skipped += blkcnt;continue ; }
@@ -377,8 +375,8 @@ int store_sparse_image(sparse_storage_t *storage, void *storage_priv,sparse_put_data_buffer (buffer); } -debug ("Wrote %d blocks, skipped %d, expected to write %d blocks\n" , - total_blocks, skipped, +debug ("Wrote %d blocks, expected to write %d blocks\n" , + total_blocks,sparse_block_size_to_storage (sparse_header->total_blks, storage, sparse_header)); printf("........ wrote %d blocks to '%s'\n", total_blocks,
Signature · 1 line
1.8.5
PATCH v2 2/2 fastboot: sparse: remove unnecessary logging
please, can this be accepted?
Quoted 48 lines · Steve Rae
remove logging of the 'skipped' blocks
Signed-off-by Steve Rae <[email protected]>---
Changes in v2: None
common/image-sparse.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)common/image-sparse.c +0
-1@@ -275,7 +275,6 @@ int store_sparse_image(sparse_storage_t *storage, void *storage_priv, sparse_buffer_t *buffer;uint32_t start;uint32_t total_blocks =0 ; -uint32_t skipped =0 ;int i;debug("=== Storage ===\n");common/image-sparse.c +2
-3@@ -336,7 +335,6 @@ int store_sparse_image(sparse_storage_t *storage, void *storage_priv,#ifdef CONFIG_FASTBOOT_FLASH_MMC_DEV total_blocks += blkcnt;#endif - skipped += blkcnt;continue ; }@@ -377,8 +375,8 @@ int store_sparse_image(sparse_storage_t *storage, void *storage_priv,sparse_put_data_buffer (buffer); } -debug ("Wrote %d blocks, skipped %d, expected to write %d blocks\n" , - total_blocks, skipped, +debug ("Wrote %d blocks, expected to write %d blocks\n" , + total_blocks,sparse_block_size_to_storage (sparse_header->total_blks, storage, sparse_header));printf("........ wrote %d blocks to '%s'\n", total_blocks,--
1.8.5
PATCH v2 2/2 fastboot: sparse: remove unnecessary logging
In reply to Steve RaeQuoted 3 lines · Steve Rae
remove logging of the 'skipped' blocks
Signed-off-by Steve Rae <[email protected]>
Thanks!
Maxime
Signature · 10 lines
Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com -------------- 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/20160309/dba9603d/attachment.sig>
PATCH v2 2/2 fastboot: sparse: remove unnecessary logging
Quoted 7 lines · Maxime Ripard
Quoted 3 lines · Steve Rae
remove logging of the 'skipped' blocks
Signed-off-by Steve Rae <[email protected]>Acked-by Maxime Ripard <[email protected]>
Quoted 7 lines
Thanks!
Maxime--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
can this be applied? Thanks
PATCH v2 2/2 fastboot: sparse: remove unnecessary logging
In reply to Steve RaeQuoted 4 lines · Steve Rae
remove logging of the 'skipped' blocks
Signed-off-by Steve Rae <[email protected]>Acked-by Maxime Ripard <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
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/20160411/60ed7743/attachment.sig>
PATCH v2 1/2 fastboot: sparse: fix block addressing for don't care chunk type
In reply to Steve Raeplease, can this be accepted?
Quoted 54 lines · Steve Rae
When 7bfc3b1 (sparse: Refactor chunk parsing function) was implemented, it dropped 9981945 (aboot: fix block addressing for don't care chunk type).
This re-implements the required fix for the "don't care chunk type"...
Signed-off-by Steve Rae <[email protected]>---
Changes in v2:
Handle MMC device differently than the NAND device.common/image-sparse.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)common/image-sparse.c +1
-3@@ -330,9 +330,13 @@ int store_sparse_image(sparse_storage_t *storage,void *storage_priv, * and go on parsing the rest of the chunks */ if (chunk_header->chunk_type ==CHUNK_TYPE_DONT_CARE ) { - skipped +=sparse_block_size_to_storage (chunk_header->chunk_sz, - storage, - sparse_header); + blkcnt =sparse_block_size_to_storage(chunk_header->chunk_sz,
common/image-sparse.c +7
-1+ storage, + sparse_header); +#ifdef CONFIG_FASTBOOT_FLASH_MMC_DEV + total_blocks += blkcnt; +#endif + skipped += blkcnt;continue ; }@@ -380,7 +384,7 @@ int store_sparse_image(sparse_storage_t *storage, void *storage_priv,printf ("........ wrote %d blocks to '%s'\n" , total_blocks, storage->name); -if ((total_blocks + skipped) != +if (total_blocks !=sparse_block_size_to_storage (sparse_header->total_blks, storage, sparse_header)) {printf("sparse image write failure\n");--
1.8.5
PATCH v2 1/2 fastboot: sparse: fix block addressing for don't care chunk type
In reply to Steve RaeQuoted 6 lines · Steve Rae
When 7bfc3b1 (sparse: Refactor chunk parsing function) was implemented, it dropped 9981945 (aboot: fix block addressing for don't care chunk type).
This re-implements the required fix for the "don't care chunk type"...
Signed-off-by Steve Rae <[email protected]>
Thanks!
Maxime
Signature · 10 lines
Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com -------------- 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/20160309/7dc7e660/attachment.sig>
PATCH v2 1/2 fastboot: sparse: fix block addressing for don't care chunk type
Quoted 10 lines · Maxime Ripard
Quoted 6 lines · Steve Rae
When 7bfc3b1 (sparse: Refactor chunk parsing function) was implemented, it dropped 9981945 (aboot: fix block addressing for don't care chunk type).
This re-implements the required fix for the "don't care chunk type"...
Signed-off-by Steve Rae <[email protected]>Acked-by Maxime Ripard <[email protected]>
Quoted 7 lines
Thanks!
Maxime--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
can this be applied? Thanks
PATCH v2 1/2 fastboot: sparse: fix block addressing for don't care chunk type
In reply to Steve RaeQuoted 7 lines · Steve Rae
When 7bfc3b1 (sparse: Refactor chunk parsing function) was implemented, it dropped 9981945 (aboot: fix block addressing for don't care chunk type).
This re-implements the required fix for the "don't care chunk type"...
Signed-off-by Steve Rae <[email protected]>Acked-by Maxime Ripard <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
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/20160411/b64aa96b/attachment.sig>