aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ohci-hcd.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2013-05-24 19:48:28 -0400
committerDavid S. Miller <davem@davemloft.net>2013-05-24 19:48:28 -0400
commite6ff4c75f9095f61b3a66c2a78e47b62864022dd (patch)
tree425ea9463cbec0b1975b8a33d9a56817143055d0 /drivers/usb/host/ohci-hcd.c
parentee9c799c231324de681eb21e06d8bf4842768b75 (diff)
parent0e255f1c0c9add2f0c920240ac4cadc28ae274c3 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Merge net into net-next because some upcoming net-next changes build on top of bug fixes that went into net. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/usb/host/ohci-hcd.c')
-rw-r--r--drivers/usb/host/ohci-hcd.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 9e6de9586ae4..fc627fd54116 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -233,14 +233,14 @@ static int ohci_urb_enqueue (
233 urb->start_frame = frame; 233 urb->start_frame = frame;
234 } 234 }
235 } else if (ed->type == PIPE_ISOCHRONOUS) { 235 } else if (ed->type == PIPE_ISOCHRONOUS) {
236 u16 next = ohci_frame_no(ohci) + 2; 236 u16 next = ohci_frame_no(ohci) + 1;
237 u16 frame = ed->last_iso + ed->interval; 237 u16 frame = ed->last_iso + ed->interval;
238 238
239 /* Behind the scheduling threshold? */ 239 /* Behind the scheduling threshold? */
240 if (unlikely(tick_before(frame, next))) { 240 if (unlikely(tick_before(frame, next))) {
241 241
242 /* USB_ISO_ASAP: Round up to the first available slot */ 242 /* USB_ISO_ASAP: Round up to the first available slot */
243 if (urb->transfer_flags & URB_ISO_ASAP) 243 if (urb->transfer_flags & URB_ISO_ASAP) {
244 frame += (next - frame + ed->interval - 1) & 244 frame += (next - frame + ed->interval - 1) &
245 -ed->interval; 245 -ed->interval;
246 246
@@ -248,21 +248,25 @@ static int ohci_urb_enqueue (
248 * Not ASAP: Use the next slot in the stream. If 248 * Not ASAP: Use the next slot in the stream. If
249 * the entire URB falls before the threshold, fail. 249 * the entire URB falls before the threshold, fail.
250 */ 250 */
251 else if (tick_before(frame + ed->interval * 251 } else {
252 if (tick_before(frame + ed->interval *
252 (urb->number_of_packets - 1), next)) { 253 (urb->number_of_packets - 1), next)) {
253 retval = -EXDEV; 254 retval = -EXDEV;
254 usb_hcd_unlink_urb_from_ep(hcd, urb); 255 usb_hcd_unlink_urb_from_ep(hcd, urb);
255 goto fail; 256 goto fail;
256 } 257 }
257 258
258 /* 259 /*
259 * Some OHCI hardware doesn't handle late TDs 260 * Some OHCI hardware doesn't handle late TDs
260 * correctly. After retiring them it proceeds to 261 * correctly. After retiring them it proceeds
261 * the next ED instead of the next TD. Therefore 262 * to the next ED instead of the next TD.
262 * we have to omit the late TDs entirely. 263 * Therefore we have to omit the late TDs
263 */ 264 * entirely.
264 urb_priv->td_cnt = DIV_ROUND_UP(next - frame, 265 */
265 ed->interval); 266 urb_priv->td_cnt = DIV_ROUND_UP(
267 (u16) (next - frame),
268 ed->interval);
269 }
266 } 270 }
267 urb->start_frame = frame; 271 urb->start_frame = frame;
268 } 272 }