/* request unlinking of an endpoint from an operational HC.
* put the ep on the rm_list
* real work is done at the next start frame (SF) hardware interrupt
- * caller guarantees HCD is running, so hardware access is safe.
+ * caller guarantees HCD is running, so hardware access is safe,
+ * and that ed->state is ED_OPER
*/
static void start_ed_unlink (struct ohci_hcd *ohci, struct ed *ed)
{
{
struct ed *ed, **last;
-ed = ohci->ed_rm_list;
-if (ed && ed == ed->ed_next) {
- printk ("RM_LIST LOOP! head %p, ed %p, ed->next %p\n",
- ohci->ed_rm_list, ed, ed->ed_next);
- ed->ed_next = 0;
-}
-
rescan_all:
for (last = &ohci->ed_rm_list, ed = *last; ed != NULL; ed = *last) {
struct list_head *entry, *tmp;
finish_urb (ohci, urb, regs);
/* clean schedule: unlink EDs that are no longer busy */
- if (list_empty (&ed->td_list))
+ if (list_empty (&ed->td_list) && ed->state == ED_OPER)
start_ed_unlink (ohci, ed);
/* ... reenabling halted EDs only after fault cleanup */
else if ((ed->hwINFO & (ED_SKIP | ED_DEQUEUE)) == ED_SKIP) {