• David Brownell's avatar
    [PATCH] USB: usbtest checks for in-order completions · 4f88b00d
    David Brownell authored
    This makes "test 10" verify that completions are returned in-order,
    resolving a FIXME.  OHCI and EHCI do, but UHCI doesn't. (*)  That
    simplified a cleanup of the queue fault tests to make it easier
    to handle optional faults (with one or more failure modes).
    
    It also returns a "lost subcase" that accidentally was not getting
    run.  And in a case of pure paranoia, the unlink tests handle the
    EBUSY return from an async urb unlink ... if that ever shows up I'd
    expect it to be on an SMP box.
    
    
    (*) I'd suspected as much given the first round of tests with UHCI;
         the diagnostics from "usbtest" made no sense otherwise.  This
         is just repeatable confirmation of the earlier bug report.  This
         could cause trouble in the usb_sg_*() I/O calls.
    
         In this case, "testusb -at10 -g4" reported that subcase 1 completed
         out of order (before subcase 0) ... without looking at details, I'd
         guess a list_add() vs list_add_tail() issue.
    
         Then after trying the queue cleanup code, I got diagnostics from
         uhci_destroy_urb_priv; then a kmalloc poisoning oops in uhci_irq,
         or "uhci_remove_pending_qhs+0x7c/0x1b0" in more detail.  Those
         looks to be the same "can't unlink from completions" errors that
         was also reported before in that code.
    
         Note that "testusb -at10" (like "testusb -at9") can be made to
         work with any USB device, using "usbtest" module options.
    4f88b00d
usbtest.c 40.2 KB