Hi, > 2) happens when a packet fails, and the queue should be halted, in > this case
Should we just cancel all queued packets on endpoint halts then? If the guest decides to go on we'll easily re-queue everything (with the existing code). If the guest does something else we don't have to do anything special. Not canceling, then trying to figure what the new state of the already queued packets is could become tricky ... > Another problem with failing packets is that hw/usb/core.c will > happily execute the next packet in the ep queue, even though the spec > says the ep-queue should be halted, giving the guest a chance to > cancel transfers after the failed one without them ever executing. > I've a poc patch fixing this too. Indeed, the core should stop processing them. Question is what to do then. If the host controller cancels all packets anyway we don't have to do much extra work on the core. Just stop processing on error and implicitly un-halt the endpoint when the queue becomes empty. Maybe some extra state tracking and asserts() to catch bugs. cheers, Gerd