On Wed, May 11, 2011 at 05:28:50PM +0800, Alex He wrote: > On Wed, 2011-05-11 at 01:11 +0800, Sarah Sharp wrote: > > On Tue, May 10, 2011 at 11:36:48AM +0800, He, Alex wrote: > One more question. > Will the second TD be added to the cancelled_td_list for the FSE? Yes, the second TD will be added to the cancelled_td_list before the stop endpoint is queued. That's how the cancellation code works: when an URB is canceled, the TD is queued to the cancelled_td_list, a stop endpoint command is queued, and the USB core receives a status that tells it the xHCI driver will call the URB's completion handler when it is done. The TD remains on the td_list, just in case the host controller successfully completes it before the Stop Endpoint command completes. If it does, the xhci_td is removed from the cancelled_td_list. Otherwise, it's still there when the Stop Endpoint command runs. In the cases you described, it will still be on the cancelled_td_list. > If it is not true, when the driver call handle_stopped_endpoint(), the > condition (cur_td == ep->stopped_td) is false. The > xhci_find_new_dequeue_state() won't be called and the > deq_state.new_deq_ptr and deq_state_new_deq_seg are still zero. Then the > ring_doorbell_for_active_rings() be called and the ep_ring run again. In > other words the stop endpoint command can't stop the ep for the FSE > case. When the second TD is on the cancelled_td_list, and (cur_td == ep->stopped_td) is false, the second TD will be turned into no-ops, and the TD will be taken out of the td_list and cancelled_td_list. Sarah Sharp -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html