• Mathias Nyman's avatar
    xhci: always handle "Command Ring Stopped" events · 163fc42f
    Mathias Nyman authored
    commit 33be1265 upstream.
    
    Fix "Command completion event does not match command" errors by always
    handling the command ring stopped events.
    
    The command ring stopped event is generated as a result of aborting
    or stopping the command ring with a register write. It is not caused
    by a command in the command queue, and thus won't have a matching command
    in the comman list.
    
    Solve it by handling the command ring stopped event before checking for a
    matching command.
    
    In most command time out cases we abort the command ring, and get
    a command ring stopped event. The events command pointer will point at
    the current command ring dequeue, which in most cases matches the timed
    out command in the command list, and no error messages are seen.
    
    If we instead get a command aborted event before the command ring stopped
    event, the abort event will increse the command ring dequeue pointer, and
    the following command ring stopped events command pointer will point at the
    next, not yet queued command. This case triggered the error message
    Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    163fc42f
xhci-ring.c 122 KB