rk27xx: copy a page of every plane at a time

copy_sectors() copied one destination raw page at a time, so on a
two-plane part every page of a copy took two programs and two tPROG.
Its buffer already holds a page of every plane: copy that much at once,
and flash_program() programs the planes together.

Copies are most of the programs when the FTL closes blocks that random
writes left part written. Over USB mass storage on a Samsung YP-CP3 a
stress test that ran 66792 one-plane programs ran 692 now, with 43958
two-plane ones, and its program time fell from 85 s to 59 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change-Id: Icc60d250ecc75c83c2d817efb7678333bffe3137
This commit is contained in:
Marcin Bukat 2026-10-01 22:59:14 +02:00
parent 21d5dacdb8
commit 8eb47f474b

View file

@ -714,9 +714,9 @@ static int copy_sectors(uint32_t src, uint32_t dst, unsigned n,
{
while (k < n && ret == 0)
{
/* one destination raw page at a time */
uint32_t len = geo.sec_per_page_raw
- (dst + k) % geo.sec_per_page_raw;
/* one destination page of every plane at a time, for
* flash_program() to program the planes together */
uint32_t len = geo.sec_per_page - (dst + k) % geo.sec_per_page;
uint32_t i = 0;
if (len > n - k)