[PATCH] mtd: nand: Fix nand write error with bad block addresses above 32-bit

Tom Rini trini at konsulko.com
Mon Sep 14 21:40:57 CEST 2020


On Mon, Aug 31, 2020 at 02:27:37PM +0200, Michal Simek wrote:

> From: T Karthik Reddy <t.karthik.reddy at xilinx.com>
> 
> Nand writes should skip the bad blocks with "nand write" command.
> In case of bad blocks with above 32-bit address, nand_block_isbad()
> returns false due to truncated bad block address.
> 
> In below code segment,
> 
> 	if (nand_block_isbad(mtd, offset & ~(mtd->erasesize - 1)))
> 
> offset is 64-bit and mtd->erasesize is 32-bit, hence the truncation is
> happening. Cast 'mtd->erasesize' with loff_t to fix this issue.
> 
> Signed-off-by: T Karthik Reddy <t.karthik.reddy at xilinx.com>
> Signed-off-by: Michal Simek <michal.simek at xilinx.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200914/0e7208cb/attachment.sig>


More information about the U-Boot mailing list