summaryrefslogtreecommitdiff
path: root/drivers/usb/host/imx21-hcd.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-02 18:31:09 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-02 18:31:09 (GMT)
commita84270189e2afc7028b1123415a66d444f460977 (patch)
tree0f239afe73655167c02b411d1cf84bf3211818af /drivers/usb/host/imx21-hcd.c
parentbcd7351e83728859833e3c5b8aae9a2816914e4b (diff)
parent3a0ddc714a1b8fcbff24c135a1332a28b4668d78 (diff)
downloadlinux-a84270189e2afc7028b1123415a66d444f460977.tar.xz
Merge tag 'usb-3.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB updates from Greg KH: "Here's the big USB 3.11-rc1 merge request. Lots of gadget and finally, chipidea driver updates (they were much needed), along with a new host controller driver, lots of little serial driver fixes, the removal of the 255 usb-serial device limitation, and a variety of other minor things. All of these have been in the linux-next releases for a while" * tag 'usb-3.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (254 commits) usb: musb: omap2430: make it compile again usb: chipidea: ci_hdrc_imx: access phy via private data xhci: Add missing unlocks on error paths USB: option,qcserial: move Novatel Gobi1K IDs to qcserial ehci-atmel.c: prepare clk before calling enable USB: ohci-at91: prepare clk before calling enable USB: HWA: fix device probe failure wusbcore: add entries in Documentation/ABI for new wusbhc sysfs attributes wusbcore: add sysfs attribute for retry count wusbcore: add sysfs attribute for DNTS count and interval usb: chipidea: drop "13xxx" infix usb: phy: tegra: remove duplicated include from phy-tegra-usb.c usb: host: xhci-plat: release mem region while removing module usbmisc_imx: allow autoloading on according to dt ids usb: fix build error without CONFIG_USB_PHY usb: check usb_hub_to_struct_hub() return value xhci: check for failed dma pool allocation usb: gadget: f_subset: fix missing unlock on error in geth_alloc() usb: gadget: f_ncm: fix missing unlock on error in ncm_alloc() usb: gadget: f_ecm: fix missing unlock on error in ecm_alloc() ...
Diffstat (limited to 'drivers/usb/host/imx21-hcd.c')
-rw-r--r--drivers/usb/host/imx21-hcd.c43
1 files changed, 26 insertions, 17 deletions
diff --git a/drivers/usb/host/imx21-hcd.c b/drivers/usb/host/imx21-hcd.c
index f0ebe8e..03dc4d9 100644
--- a/drivers/usb/host/imx21-hcd.c
+++ b/drivers/usb/host/imx21-hcd.c
@@ -809,26 +809,36 @@ static int imx21_hc_urb_enqueue_isoc(struct usb_hcd *hcd,
/* calculate frame */
cur_frame = imx21_hc_get_frame(hcd);
- if (urb->transfer_flags & URB_ISO_ASAP) {
- if (list_empty(&ep_priv->td_list))
- urb->start_frame = cur_frame + 5;
- else
- urb->start_frame = list_entry(
- ep_priv->td_list.prev,
- struct td, list)->frame + urb->interval;
- }
- urb->start_frame = wrap_frame(urb->start_frame);
- if (frame_after(cur_frame, urb->start_frame)) {
- dev_dbg(imx21->dev,
- "enqueue: adjusting iso start %d (cur=%d) asap=%d\n",
- urb->start_frame, cur_frame,
- (urb->transfer_flags & URB_ISO_ASAP) != 0);
- urb->start_frame = wrap_frame(cur_frame + 1);
+ i = 0;
+ if (list_empty(&ep_priv->td_list)) {
+ urb->start_frame = wrap_frame(cur_frame + 5);
+ } else {
+ urb->start_frame = wrap_frame(list_entry(ep_priv->td_list.prev,
+ struct td, list)->frame + urb->interval);
+
+ if (frame_after(cur_frame, urb->start_frame)) {
+ dev_dbg(imx21->dev,
+ "enqueue: adjusting iso start %d (cur=%d) asap=%d\n",
+ urb->start_frame, cur_frame,
+ (urb->transfer_flags & URB_ISO_ASAP) != 0);
+ i = DIV_ROUND_UP(wrap_frame(
+ cur_frame - urb->start_frame),
+ urb->interval);
+ if (urb->transfer_flags & URB_ISO_ASAP) {
+ urb->start_frame = wrap_frame(urb->start_frame
+ + i * urb->interval);
+ i = 0;
+ } else if (i >= urb->number_of_packets) {
+ ret = -EXDEV;
+ goto alloc_dmem_failed;
+ }
+ }
}
/* set up transfers */
+ urb_priv->isoc_remaining = urb->number_of_packets - i;
td = urb_priv->isoc_td;
- for (i = 0; i < urb->number_of_packets; i++, td++) {
+ for (; i < urb->number_of_packets; i++, td++) {
unsigned int offset = urb->iso_frame_desc[i].offset;
td->ep = ep;
td->urb = urb;
@@ -840,7 +850,6 @@ static int imx21_hc_urb_enqueue_isoc(struct usb_hcd *hcd,
list_add_tail(&td->list, &ep_priv->td_list);
}
- urb_priv->isoc_remaining = urb->number_of_packets;
dev_vdbg(imx21->dev, "setup %d packets for iso frame %d->%d\n",
urb->number_of_packets, urb->start_frame, td->frame);