Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1595207 > unrolled thread

[PATCH 0/2] usb: gadget: f_uvc: SuperSpeed fixes

Started byRoger Quadros <rogerq@ti.com>
First post2017-03-08 15:10 +0100
Last post2017-03-08 16:50 +0100
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/2] usb: gadget: f_uvc: SuperSpeed fixes Roger Quadros <rogerq@ti.com> - 2017-03-08 15:10 +0100
    [PATCH 1/2] usb: gadget: f_uvc: Fix SuperSpeed companion descriptor's wBytesPerInterval Roger Quadros <rogerq@ti.com> - 2017-03-08 15:30 +0100
      Re: [PATCH 1/2] usb: gadget: f_uvc: Fix SuperSpeed companion  descriptor's wBytesPerInterval Roger Quadros <rogerq@ti.com> - 2017-03-09 10:40 +0100
    Re: [PATCH 0/2] usb: gadget: f_uvc: SuperSpeed fixes Laurent Pinchart <laurent.pinchart@ideasonboard.com> - 2017-03-08 16:50 +0100

#1595207 — [PATCH 0/2] usb: gadget: f_uvc: SuperSpeed fixes

FromRoger Quadros <rogerq@ti.com>
Date2017-03-08 15:10 +0100
Subject[PATCH 0/2] usb: gadget: f_uvc: SuperSpeed fixes
Message-ID<tiKrU-7Ca-25@gated-at.bofh.it>
Hi Laurent & Felipe,

These are some fixes for SuperSpeed case.

--
cheers,
-roger

Roger Quadros (2):
  usb: gadget: f_uvc: Fix SuperSpeed companion descriptor's
    wBytesPerInterval
  usb: gadget: f_uvc: Sanity check wMaxPacketSize for SuperSpeed

 drivers/usb/gadget/function/f_uvc.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

-- 
2.7.4

[toc] | [next] | [standalone]


#1595220 — [PATCH 1/2] usb: gadget: f_uvc: Fix SuperSpeed companion descriptor's wBytesPerInterval

FromRoger Quadros <rogerq@ti.com>
Date2017-03-08 15:30 +0100
Subject[PATCH 1/2] usb: gadget: f_uvc: Fix SuperSpeed companion descriptor's wBytesPerInterval
Message-ID<tiKLg-7L9-19@gated-at.bofh.it>
In reply to#1595207
The streaming_maxburst module parameter is 0 offset (0..15)
so we must add 1 while using it for wBytesPerInterval
calculation for the SuperSpeed companion descriptor.

Without this host uvcvideo driver will always see the wrong
wBytesPerInterval for SuperSpeed uvc gadget and may not find
a suitable video interface endpoint.
e.g. for streaming_maxburst = 0 case it will always
fail as wBytePerInterval was evaluating to 0.

Cc: stable@vger.kernel.org
Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 drivers/usb/gadget/function/f_uvc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c
index 29b41b5..c7689d0 100644
--- a/drivers/usb/gadget/function/f_uvc.c
+++ b/drivers/usb/gadget/function/f_uvc.c
@@ -625,7 +625,7 @@ uvc_function_bind(struct usb_configuration *c, struct usb_function *f)
 	uvc_ss_streaming_comp.bMaxBurst = opts->streaming_maxburst;
 	uvc_ss_streaming_comp.wBytesPerInterval =
 		cpu_to_le16(max_packet_size * max_packet_mult *
-			    opts->streaming_maxburst);
+			    (opts->streaming_maxburst + 1));
 
 	/* Allocate endpoints. */
 	ep = usb_ep_autoconfig(cdev->gadget, &uvc_control_ep);
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1595842 — Re: [PATCH 1/2] usb: gadget: f_uvc: Fix SuperSpeed companion descriptor's wBytesPerInterval

FromRoger Quadros <rogerq@ti.com>
Date2017-03-09 10:40 +0100
SubjectRe: [PATCH 1/2] usb: gadget: f_uvc: Fix SuperSpeed companion descriptor's wBytesPerInterval
Message-ID<tj2I9-3ix-7@gated-at.bofh.it>
In reply to#1595220
Felipe,

On 08/03/17 16:05, Roger Quadros wrote:
> The streaming_maxburst module parameter is 0 offset (0..15)
> so we must add 1 while using it for wBytesPerInterval
> calculation for the SuperSpeed companion descriptor.
> 
> Without this host uvcvideo driver will always see the wrong
> wBytesPerInterval for SuperSpeed uvc gadget and may not find
> a suitable video interface endpoint.
> e.g. for streaming_maxburst = 0 case it will always
> fail as wBytePerInterval was evaluating to 0.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Please pick this one for v4.11-rc with Laurent's Reviewed-by. Thanks.

> ---
>  drivers/usb/gadget/function/f_uvc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c
> index 29b41b5..c7689d0 100644
> --- a/drivers/usb/gadget/function/f_uvc.c
> +++ b/drivers/usb/gadget/function/f_uvc.c
> @@ -625,7 +625,7 @@ uvc_function_bind(struct usb_configuration *c, struct usb_function *f)
>  	uvc_ss_streaming_comp.bMaxBurst = opts->streaming_maxburst;
>  	uvc_ss_streaming_comp.wBytesPerInterval =
>  		cpu_to_le16(max_packet_size * max_packet_mult *
> -			    opts->streaming_maxburst);
> +			    (opts->streaming_maxburst + 1));
>  
>  	/* Allocate endpoints. */
>  	ep = usb_ep_autoconfig(cdev->gadget, &uvc_control_ep);
> 

-- 
cheers,
-roger

[toc] | [prev] | [next] | [standalone]


#1595306

FromLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Date2017-03-08 16:50 +0100
Message-ID<tiM0G-86-23@gated-at.bofh.it>
In reply to#1595207
Hi Roger,

Thank you for the patches.

On Wednesday 08 Mar 2017 16:05:42 Roger Quadros wrote:
> Hi Laurent & Felipe,
> 
> These are some fixes for SuperSpeed case.

For both patches,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> --
> cheers,
> -roger
> 
> Roger Quadros (2):
>   usb: gadget: f_uvc: Fix SuperSpeed companion descriptor's
>     wBytesPerInterval
>   usb: gadget: f_uvc: Sanity check wMaxPacketSize for SuperSpeed
> 
>  drivers/usb/gadget/function/f_uvc.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)

-- 
Regards,

Laurent Pinchart

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web