diff options
author | Stephen Warren <swarren@nvidia.com> | 2015-09-04 22:03:47 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2015-09-11 17:15:23 -0400 |
commit | 411c5e57e8cf7dd83627a24b5cde73a0e662b1b0 (patch) | |
tree | 7c0af86dcacd9cc1180e97218d79be953d63aff0 /drivers/dfu/dfu.c | |
parent | 806bd245b1ab392245e6adc56522c3473edbc805 (diff) | |
download | u-boot-imx-411c5e57e8cf7dd83627a24b5cde73a0e662b1b0.zip u-boot-imx-411c5e57e8cf7dd83627a24b5cde73a0e662b1b0.tar.gz u-boot-imx-411c5e57e8cf7dd83627a24b5cde73a0e662b1b0.tar.bz2 |
dfu: mmc: buffer file reads too
When writing to files in a filesystem on MMC, dfu_mmc.c buffers up the
entire file content until the end of the transaction, at which point the
file is written in one go. This allows writing files larger than the USB
transfer size (CONFIG_SYS_DFU_DATA_BUF_SIZE); the maximum written file
size is CONFIG_SYS_DFU_MAX_FILE_SIZE (the size of the temporary buffer).
The current file reading code does not do any buffering, and so limits
the maximum read file size to the USB transfer size. Enhance the code to
do the same kind of buffering as the write path, so the same file size
limits apply.
Remove the size checking code from dfu_read() since all read paths now
support larger files than the USB transfer buffer.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Tested-by: Lukasz Majewski <l.majewski@samsung.com>
Diffstat (limited to 'drivers/dfu/dfu.c')
-rw-r--r-- | drivers/dfu/dfu.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c index 6842aef..8f5915e 100644 --- a/drivers/dfu/dfu.c +++ b/drivers/dfu/dfu.c @@ -338,17 +338,6 @@ int dfu_read(struct dfu_entity *dfu, void *buf, int size, int blk_seq_num) dfu->r_left = dfu->get_medium_size(dfu); if (dfu->r_left < 0) return dfu->r_left; - switch (dfu->layout) { - case DFU_RAW_ADDR: - case DFU_RAM_ADDR: - break; - default: - if (dfu->r_left > dfu_buf_size) { - printf("%s: File too big for buffer\n", - __func__); - return -EOVERFLOW; - } - } debug("%s: %s %ld [B]\n", __func__, dfu->name, dfu->r_left); |