Merge branch 'writeback' of git://git.kernel.dk/linux-2.6-block
[pandora-kernel.git] / drivers / usb / host / whci / pzl.c
index ff4ef9e..a9e05ba 100644 (file)
@@ -255,11 +255,21 @@ void scan_periodic_work(struct work_struct *work)
        /*
         * Now that the PZL is updated, complete the removal of any
         * removed qsets.
+        *
+        * If the qset was to be reset, do so and reinsert it into the
+        * PZL if it has pending transfers.
         */
        spin_lock_irq(&whc->lock);
 
        list_for_each_entry_safe(qset, t, &whc->periodic_removed_list, list_node) {
                qset_remove_complete(whc, qset);
+               if (qset->reset) {
+                       qset_reset(whc, qset);
+                       if (!list_empty(&qset->stds)) {
+                               qset_insert_in_sw_list(whc, qset);
+                               queue_work(whc->workqueue, &whc->periodic_work);
+                       }
+               }
        }
 
        spin_unlock_irq(&whc->lock);
@@ -295,7 +305,7 @@ int pzl_urb_enqueue(struct whc *whc, struct urb *urb, gfp_t mem_flags)
        else
                err = qset_add_urb(whc, qset, urb, GFP_ATOMIC);
        if (!err) {
-               if (!qset->in_sw_list)
+               if (!qset->in_sw_list && !qset->remove)
                        qset_insert_in_sw_list(whc, qset);
        } else
                usb_hcd_unlink_urb_from_ep(&whc->wusbhc.usb_hcd, urb);