Bug 4856

Summary: [PATCH] correct nanddump behaviour
Product: Busybox Reporter: richard.genoud
Component: Standard ComplianceAssignee: unassigned
Status: NEW ---    
Severity: normal CC: busybox-cvs, volchok
Priority: P5    
Version: 1.18.x   
Target Milestone: ---   
Hardware: Other   
OS: Linux   
Host: Target:
Build:
Attachments: patch correcting nanddump behaviour with bad blocks
[PATCH 1/2] nanddump: correct rounding to next page
[PATCH 2/2] nanddump: dump rigth length when jumping bad blocks

Description richard.genoud 2012-03-06 09:56:37 UTC
Created attachment 4076 [details]
patch correcting nanddump behaviour with bad blocks

There's an infinite loop in nanddump when dumping a bad block.
Moreover, bad blocks are dumped even if the -b option is given.

The attached patch corrects those points:
- dump the specified length when -b is given
- do not dump the bad blocks when -b is given
- when dumping a bad block, len should be aligned on next page aligned only if it's not already page aligned in order to dump the right size.
Comment 1 richard.genoud 2013-04-24 13:36:18 UTC
Comment on attachment 4076 [details]
patch correcting nanddump behaviour with bad blocks

patch forward ported on 1.21.0
Comment 2 richard.genoud 2013-04-24 13:40:59 UTC
Created attachment 4850 [details]
[PATCH 1/2] nanddump: correct rounding to next page
Comment 3 richard.genoud 2013-04-24 13:42:25 UTC
Created attachment 4856 [details]
[PATCH 2/2] nanddump: dump rigth length when jumping bad blocks
Comment 4 richard.genoud 2013-04-24 13:46:54 UTC
For an easier review, the original patch has been forward ported to v1.21.0 and split in 2 functional patches.

Patch 1:
Correct wrong page rounding formula on nanddump causing an (almost) infinite loop when dumping bad blocks.

Patch 2:
with the "skip bad blocks" options, nanddump is not dumping the right len when there's bad bocks. (It is dumping len - bad_block_number * erase_size).
It should skip bad blocks and still dump the requested size.

Richard.