u-boot/drivers/fastboot
Mattijs Korpershoek b1aade87ca lib: sparse: allocate FASTBOOT_MAX_BLK_WRITE instead of small number
Commit 62649165cb ("lib: sparse: Make CHUNK_TYPE_RAW buffer aligned")
fixed cache alignment for systems with a D-CACHE.

However it introduced some performance regressions [1] on system
flashing huge images, such as Android.

On AM62x SK EVM, we also observe such performance penalty:
Sending sparse 'super' 1/2 (768793 KB)             OKAY [ 23.954s]
Writing 'super'                                    OKAY [ 75.926s]
Sending sparse 'super' 2/2 (629819 KB)             OKAY [ 19.641s]
Writing 'super'                                    OKAY [ 62.849s]
Finished. Total time: 182.474s

The reason for this is that we use an arbitrary small buffer
(info->blksz * 100) for transferring.

Fix it by using a bigger buffer (info->blksz * FASTBOOT_MAX_BLK_WRITE)
as suggested in the original's patch review [2].

With this patch, performance impact is mitigated:
Sending sparse 'super' 1/2 (768793 KB)             OKAY [ 23.912s]
Writing 'super'                                    OKAY [ 15.780s]
Sending sparse 'super' 2/2 (629819 KB)             OKAY [ 19.581s]
Writing 'super'                                    OKAY [ 17.192s]
Finished. Total time: 76.569s

[1] https://lore.kernel.org/r/20221118121323.4009193-1-gary.bisson@boundarydevices.com
[2] https://lore.kernel.org/r/all/43e4c17c-4483-ec8e-f843-9b4c5569bd18@seco.com/

Fixes: 62649165cb ("lib: sparse: Make CHUNK_TYPE_RAW buffer aligned")
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2023-07-25 12:44:46 -04:00
..
fb_command.c Correct SPL uses of FASTBOOT_FLASH_NAND 2023-02-10 07:41:41 -05:00
fb_common.c fastboot: Only call the bootm command if it is enabled 2023-05-31 17:23:01 -04:00
fb_getvar.c Correct SPL uses of FASTBOOT_FLASH_NAND 2023-02-10 07:41:41 -05:00
fb_mmc.c lib: sparse: allocate FASTBOOT_MAX_BLK_WRITE instead of small number 2023-07-25 12:44:46 -04:00
fb_nand.c Audit <flash.h> inclusion 2022-08-04 16:18:47 -04:00
Kconfig net: add fastboot TCP support 2023-05-05 17:48:44 -04:00
Makefile Revert "fastboot: Add default fastboot_set_reboot_flag implementation" 2021-02-07 19:22:54 +01:00