diff mbox

[U-Boot,RFC,1/2] usb: dfu: decrease dfu->r_left along with the transfer

Message ID 1381915599-27906-1-git-send-email-voice.shen@atmel.com
State Accepted
Delegated to: Marek Vasut
Headers show

Commit Message

Bo Shen Oct. 16, 2013, 9:26 a.m. UTC
The value of dfu->r_left need decrease along with the transfer

Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
 drivers/dfu/dfu.c |    1 +
 1 file changed, 1 insertion(+)

Comments

Marek Vasut Oct. 19, 2013, 12:44 a.m. UTC | #1
Hi,

> The value of dfu->r_left need decrease along with the transfer
> 
> Signed-off-by: Bo Shen <voice.shen@atmel.com>

Lucasz/Heiko , can you ACK/NAK this and 2/2 ? Thanks!

> ---
>  drivers/dfu/dfu.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
> index 56b21c7..65c6984 100644
> --- a/drivers/dfu/dfu.c
> +++ b/drivers/dfu/dfu.c
> @@ -229,6 +229,7 @@ static int dfu_read_buffer_fill(struct dfu_entity *dfu,
> void *buf, int size) dfu->crc = crc32(dfu->crc, buf, chunk);
>  			dfu->i_buf += chunk;
>  			dfu->b_left -= chunk;
> +			dfu->r_left -= chunk;
>  			size -= chunk;
>  			buf += chunk;
>  			readn += chunk;

Best regards,
Marek Vasut
Lukasz Majewski Oct. 21, 2013, 10:24 p.m. UTC | #2
Hi Marek,

> Hi,
> 
> > The value of dfu->r_left need decrease along with the transfer
> > 
> > Signed-off-by: Bo Shen <voice.shen@atmel.com>
> 
> Lucasz/Heiko , can you ACK/NAK this and 2/2 ? Thanks!

For me it looks like a more difficult problem. 
I've got an impression that patches proposed by Bo would break eMMC.

Unfortunately I'm now a bit short of time to go deeper to it. Before
ELCE I shall have got a bit more time.

> 
> > ---
> >  drivers/dfu/dfu.c |    1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
> > index 56b21c7..65c6984 100644
> > --- a/drivers/dfu/dfu.c
> > +++ b/drivers/dfu/dfu.c
> > @@ -229,6 +229,7 @@ static int dfu_read_buffer_fill(struct
> > dfu_entity *dfu, void *buf, int size) dfu->crc = crc32(dfu->crc,
> > buf, chunk); dfu->i_buf += chunk;
> >  			dfu->b_left -= chunk;
> > +			dfu->r_left -= chunk;
> >  			size -= chunk;
> >  			buf += chunk;
> >  			readn += chunk;
> 
> Best regards,
> Marek Vasut

Regards,
Lukasz
Marek Vasut Oct. 22, 2013, 2:42 a.m. UTC | #3
Hi Lukasz,

> Hi Marek,
> 
> > Hi,
> > 
> > > The value of dfu->r_left need decrease along with the transfer
> > > 
> > > Signed-off-by: Bo Shen <voice.shen@atmel.com>
> > 
> > Lucasz/Heiko , can you ACK/NAK this and 2/2 ? Thanks!
> 
> For me it looks like a more difficult problem.
> I've got an impression that patches proposed by Bo would break eMMC.
> 
> Unfortunately I'm now a bit short of time to go deeper to it. Before
> ELCE I shall have got a bit more time.

OK, thanks!

Best regards,
Marek Vasut
Bo Shen Nov. 1, 2013, 1:18 a.m. UTC | #4
Hi Lukasz,

On 10/22/2013 10:42, Marek Vasut wrote:
> Hi Lukasz,
>
>> Hi Marek,
>>
>>> Hi,
>>>
>>>> The value of dfu->r_left need decrease along with the transfer
>>>>
>>>> Signed-off-by: Bo Shen <voice.shen@atmel.com>
>>>
>>> Lucasz/Heiko , can you ACK/NAK this and 2/2 ? Thanks!
>>
>> For me it looks like a more difficult problem.
>> I've got an impression that patches proposed by Bo would break eMMC.
>>
>> Unfortunately I'm now a bit short of time to go deeper to it. Before
>> ELCE I shall have got a bit more time.

Would it be possible for you to check these two RFC patch?

> OK, thanks!
>
> Best regards,
> Marek Vasut
>

Best Regards,
Bo Shen
diff mbox

Patch

diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
index 56b21c7..65c6984 100644
--- a/drivers/dfu/dfu.c
+++ b/drivers/dfu/dfu.c
@@ -229,6 +229,7 @@  static int dfu_read_buffer_fill(struct dfu_entity *dfu, void *buf, int size)
 			dfu->crc = crc32(dfu->crc, buf, chunk);
 			dfu->i_buf += chunk;
 			dfu->b_left -= chunk;
+			dfu->r_left -= chunk;
 			size -= chunk;
 			buf += chunk;
 			readn += chunk;