X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fusb%2Fhost%2Fuhci-q.c;fp=drivers%2Fusb%2Fhost%2Fuhci-q.c;h=5f44354c467e377dfe2982ef143ca0020cc7f275;hb=4e76c8a9fa413ccc09d3f7f664183dcce3555d57;hp=a06d84c19e13c944f99ffa604cb15034c06ffd42;hpb=1db395853d4f30d6120458bd279ede1f882a8525;p=linux-2.6.git diff --git a/drivers/usb/host/uhci-q.c b/drivers/usb/host/uhci-q.c index a06d84c19..5f44354c4 100644 --- a/drivers/usb/host/uhci-q.c +++ b/drivers/usb/host/uhci-q.c @@ -264,7 +264,7 @@ static void uhci_fixup_toggles(struct uhci_qh *qh, int skip_first) * need to change any toggles in this URB */ td = list_entry(urbp->td_list.next, struct uhci_td, list); if (toggle > 1 || uhci_toggle(td_token(td)) == toggle) { - td = list_entry(urbp->td_list.next, struct uhci_td, + td = list_entry(urbp->td_list.prev, struct uhci_td, list); toggle = uhci_toggle(td_token(td)) ^ 1; @@ -896,12 +896,14 @@ static int uhci_result_common(struct uhci_hcd *uhci, struct urb *urb) /* * This URB stopped short of its end. We have to * fix up the toggles of the following URBs on the - * queue and restart the queue. + * queue and restart the queue. But only if this + * TD isn't the last one in the URB. * * Do this only the first time we encounter the * short URB. */ - if (!urbp->short_transfer) { + if (!urbp->short_transfer && + &td->list != urbp->td_list.prev) { urbp->short_transfer = 1; urbp->qh->initial_toggle = uhci_toggle(td_token(td)) ^ 1;