Re: [PATCH] mtd: rawnand: samsung: fix pages_per_eraseblock calculation
From: Miquel Raynal
Date: Tue Nov 17 2026 - 08:48:12 EST
On Fri, 23 Oct 2026 16:16:07 +0800, Shuai Liu wrote:
> In samsung_nand_decode_id(), the division by memorg->pagesize binds
> tighter than the left shift due to C operator precedence, so the
> expression is evaluated as:
>
> (128 * 1024) << (shift / pagesize)
>
> The shift amount is at most 7 while pagesize is at least 2048, so the
> integer division always yields 0 and pages_per_eraseblock ends up
> being 131072 regardless of the actual chip geometry.
>
> [...]
Applied to mtd/fixes, thanks!
[1/1] mtd: rawnand: samsung: fix pages_per_eraseblock calculation
commit: 9aec4c3b18530bc936eb339c96ea2258c4aa50ac
Patche(s) should be available on mtd/linux.git and will be
part of the next PR (provided that no robot complains by then).
Kind regards,
Miquèl