From: Mike Krinkin <krinkin.m.u@gmail.com>
To: linux-usb@vger.kernel.org
Cc: felipe.balbi@linux.intel.com, gregkh@linuxfoundation.org,
linux-media@vger.kernel.org, mchehab@kernel.org,
laurent.pinchart@ideasonboard.com,
Mike Krinkin <krinkin.m.u@gmail.com>
Subject: [PATCH] usb: core: urb make use of usb_endpoint_maxp_mult
Date: Sun, 13 Nov 2016 13:31:16 +0300 [thread overview]
Message-ID: <1479033076-2995-1-git-send-email-krinkin.m.u@gmail.com> (raw)
Since usb_endpoint_maxp now returns only lower 11 bits mult
calculation here isn't correct anymore and that breaks webcam
for me. Patch make use of usb_endpoint_maxp_mult instead of
direct calculation.
Fixes: abb621844f6a ("usb: ch9: make usb_endpoint_maxp() return
only packet size")
Signed-off-by: Mike Krinkin <krinkin.m.u@gmail.com>
---
drivers/usb/core/urb.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c
index 0be49a1..d75cb8c 100644
--- a/drivers/usb/core/urb.c
+++ b/drivers/usb/core/urb.c
@@ -412,11 +412,8 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
}
/* "high bandwidth" mode, 1-3 packets/uframe? */
- if (dev->speed == USB_SPEED_HIGH) {
- int mult = 1 + ((max >> 11) & 0x03);
- max &= 0x07ff;
- max *= mult;
- }
+ if (dev->speed == USB_SPEED_HIGH)
+ max *= usb_endpoint_maxp_mult(&ep->desc);
if (urb->number_of_packets <= 0)
return -EINVAL;
--
2.7.4
next reply other threads:[~2016-11-13 10:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-13 10:31 Mike Krinkin [this message]
2016-11-14 9:21 ` [PATCH] usb: core: urb make use of usb_endpoint_maxp_mult Greg KH
2016-11-14 9:27 ` Felipe Balbi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1479033076-2995-1-git-send-email-krinkin.m.u@gmail.com \
--to=krinkin.m.u@gmail.com \
--cc=felipe.balbi@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mchehab@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).