[U-Boot] [RFC PATCH 2/2] usb: dfu: correct dfu buffer inited value

Marek Vasut marex at denx.de
Wed Nov 6 14:51:22 CET 2013


Dear Lukasz Majewski,

> Hi Bo,
> 
> First of all, sorry for a little delay.
> 
> > Hi Lukasz,
> > 
> > On 11/4/2013 18:17, Lukasz Majewski wrote:
> > > Hi Bo,
> > > 
> > >> After dfu buffer is initialized, the buffer should be all
> > >> available, while not 0. Initialize its value to min(dfu_buf_size,
> > >> dfu->r_left).
> > >> 
> > >> Signed-off-by: Bo Shen <voice.shen at atmel.com>
> > >> 
> > >> ---
> > >> 
> > >>   drivers/dfu/dfu.c |    2 +-
> > >>   1 file changed, 1 insertion(+), 1 deletion(-)
> > >> 
> > >> diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
> > >> index 65c6984..b8c8aa4 100644
> > >> --- a/drivers/dfu/dfu.c
> > >> +++ b/drivers/dfu/dfu.c
> > >> @@ -288,7 +288,7 @@ int dfu_read(struct dfu_entity *dfu, void *buf,
> > >> int size, int blk_seq_num) dfu->offset = 0;
> > >> 
> > >>   		dfu->i_buf_end = dfu_get_buf() + dfu_buf_size;
> > >>   		dfu->i_buf = dfu->i_buf_start;
> > >> 
> > >> -		dfu->b_left = 0;
> > >> +		dfu->b_left = min(dfu_buf_size, dfu->r_left);
> > > 
> > > I've testd in on Trats. It causes dfu read to be performed two
> > > times.
> > 
> > Have you apply these two patches together:
> > [RFC PATCH 1/2] usb: dfu: decrease dfu->r_left along with the transfer
> > [RFC PATCH 2/2] usb: dfu: correct dfu buffer inited value
> 
> I did a "little" mistake when applying those patches. When both patches
> are applied dfu works fine.
> 
> I've tested it on Trats (Exynos4210).
> 
> For:
> [RFC PATCH 1/2] usb: dfu: decrease dfu->r_left along with the transfer
> [RFC PATCH 2/2] usb: dfu: correct dfu buffer inited value
> 
> Tested-by: Lukasz Majewski <l.majewski at samsung.com>
> Acked-by: Lukasz Majewski <l.majewski at samsung.com>
> 
> @ Marek,
> 
> Since I'm still struggling with internal firewall - Marek could you
> apply those two patches to u-boot-usb tree?
> 
> Also please apply Heiko's patch:
> 
> [PATCH v3 3/5] usb, g_dnl: make iSerialNumber board configurable
> 
> Thanks in advance.

Roger that, all done, thanks!

Best regards,
Marek Vasut


More information about the U-Boot mailing list