qed: Change metadata needed for SPQ entries
[deliverable/linux.git] / drivers / usb / wusbcore / wa-xfer.c
index e279015be466166742367f7bcb958639f856b447..69af4fd9e07220b29edeeec2b46fbde469d7d2ac 100644 (file)
@@ -459,14 +459,25 @@ static void __wa_xfer_abort_cb(struct urb *urb)
                        __func__, urb->status);
                if (xfer) {
                        unsigned long flags;
-                       int done;
+                       int done, seg_index = 0;
                        struct wa_rpipe *rpipe = xfer->ep->hcpriv;
 
                        dev_err(dev, "%s: cleaning up xfer %p ID 0x%08X.\n",
                                __func__, xfer, wa_xfer_id(xfer));
                        spin_lock_irqsave(&xfer->lock, flags);
-                       /* mark all segs as aborted. */
-                       wa_complete_remaining_xfer_segs(xfer, 0,
+                       /* skip done segs. */
+                       while (seg_index < xfer->segs) {
+                               struct wa_seg *seg = xfer->seg[seg_index];
+
+                               if ((seg->status == WA_SEG_DONE) ||
+                                       (seg->status == WA_SEG_ERROR)) {
+                                       ++seg_index;
+                               } else {
+                                       break;
+                               }
+                       }
+                       /* mark remaining segs as aborted. */
+                       wa_complete_remaining_xfer_segs(xfer, seg_index,
                                WA_SEG_ABORTED);
                        done = __wa_xfer_is_done(xfer);
                        spin_unlock_irqrestore(&xfer->lock, flags);
This page took 0.02934 seconds and 5 git commands to generate.