lkml.org 
[lkml]   [2012]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: REGRESSION: usbdevfs: Use-scatter-gather-lists-for-large-bulk-transfers
Hi,


On 10/12/2012 05:08 PM, Henrik Rydberg wrote:
> Hi Alan,
>
>> Instead of introducing a new local variable, why not simply update
>> uurb->buffer? That's what we do elsewhere in the code.
>
> It seemed fragile, due to these scary lines:
>
> if (is_in && uurb->buffer_length > 0)
> as->userbuffer = uurb->buffer;
> else
> as->userbuffer = NULL;
>
> I suppose it works in this particular case. How is the
> USBDEVFS_URB_TYPE_CONTROL case supposed to work here?
>
> I can certainly change the patch if preferred. Tested and attached
> below.
>
> Thanks,
> Henrik
>
> From 40b70394747eea51fdd07cc8213dd6afd24b1b30 Mon Sep 17 00:00:00 2001
> From: Henrik Rydberg <rydberg@euromail.se>
> Date: Thu, 11 Oct 2012 23:27:04 +0200
> Subject: [PATCH v2] usbdevfs: Fix broken scatter-gather transfer
>
> The handling of large output bulk transfers is broken; the same u
> page is read over and over again. Fixed with this patch.
>
> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
> ---
> drivers/usb/core/devio.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
> index ebb8a9d..6e58b59 100644
> --- a/drivers/usb/core/devio.c
> +++ b/drivers/usb/core/devio.c
> @@ -1349,6 +1351,7 @@
> goto error;
> }
> }
> + uurb->buffer += u;

I know you've already fixed this in the next revision, but still:

NAK, this will break large, split input transfers as it well
set as->userbuffer to the end of the buffer instead of the beginning!

Regards,

Hans


\
 
 \ /
  Last update: 2012-10-14 18:21    [W:0.088 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site