Skip to content

Commit f108b2d

Browse files
committed
Revert "usb: gadget: composite: always set ep->mult to a sensible value"
This reverts commit c53af76 which is commit eaa496ffaaf19591fe471a36cef366146eeb9153 upstream as it was incorrect. Reported-by: Bin Liu <b-liu@ti.com> Cc: Felipe Balbi <balbi@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6053479 commit f108b2d

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

drivers/usb/gadget/composite.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,7 @@ int config_ep_by_speed(struct usb_gadget *g,
148148
_ep->desc = chosen_desc;
149149
_ep->comp_desc = NULL;
150150
_ep->maxburst = 0;
151-
_ep->mult = 1;
152-
153-
if (g->speed == USB_SPEED_HIGH && (usb_endpoint_xfer_isoc(_ep->desc) ||
154-
usb_endpoint_xfer_int(_ep->desc)))
155-
_ep->mult = usb_endpoint_maxp(_ep->desc) & 0x7ff;
156-
151+
_ep->mult = 0;
157152
if (!want_comp_desc)
158153
return 0;
159154

@@ -170,7 +165,7 @@ int config_ep_by_speed(struct usb_gadget *g,
170165
switch (usb_endpoint_type(_ep->desc)) {
171166
case USB_ENDPOINT_XFER_ISOC:
172167
/* mult: bits 1:0 of bmAttributes */
173-
_ep->mult = (comp_desc->bmAttributes & 0x3) + 1;
168+
_ep->mult = comp_desc->bmAttributes & 0x3;
174169
case USB_ENDPOINT_XFER_BULK:
175170
case USB_ENDPOINT_XFER_INT:
176171
_ep->maxburst = comp_desc->bMaxBurst + 1;

drivers/usb/gadget/function/uvc_video.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ uvc_video_alloc_requests(struct uvc_video *video)
243243

244244
req_size = video->ep->maxpacket
245245
* max_t(unsigned int, video->ep->maxburst, 1)
246-
* (video->ep->mult);
246+
* (video->ep->mult + 1);
247247

248248
for (i = 0; i < UVC_NUM_REQUESTS; ++i) {
249249
video->req_buffer[i] = kmalloc(req_size, GFP_KERNEL);

0 commit comments

Comments
 (0)