lkml.org 
[lkml]   [2009]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[113/136] USB: xhci: Check URB_SHORT_NOT_OK before setting short packet status.
    2.6.31-stable review patch.  If anyone has any objections, please let us know.

    ------------------
    From: Sarah Sharp <sarah.a.sharp@linux.intel.com>

    commit 204970a4bb2f584afc430ae330cd44aee329cea4 upstream.

    Make sure that the driver that submitted the URB considers a short packet
    an error before setting -EREMOTEIO during a short control transfer.

    Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    drivers/usb/host/xhci-ring.c | 10 ++++++++--
    1 file changed, 8 insertions(+), 2 deletions(-)

    --- a/drivers/usb/host/xhci-ring.c
    +++ b/drivers/usb/host/xhci-ring.c
    @@ -991,7 +991,10 @@ static int handle_tx_event(struct xhci_h
    break;
    case COMP_SHORT_TX:
    xhci_warn(xhci, "WARN: short transfer on control ep\n");
    - status = -EREMOTEIO;
    + if (td->urb->transfer_flags & URB_SHORT_NOT_OK)
    + status = -EREMOTEIO;
    + else
    + status = 0;
    break;
    case COMP_BABBLE:
    /* The 0.96 spec says a babbling control endpoint
    @@ -1034,7 +1037,10 @@ static int handle_tx_event(struct xhci_h
    if (event_trb == td->last_trb) {
    if (td->urb->actual_length != 0) {
    /* Don't overwrite a previously set error code */
    - if (status == -EINPROGRESS || status == 0)
    + if ((status == -EINPROGRESS ||
    + status == 0) &&
    + (td->urb->transfer_flags
    + & URB_SHORT_NOT_OK))
    /* Did we already see a short data stage? */
    status = -EREMOTEIO;
    } else {



    \
     
     \ /
      Last update: 2009-10-02 03:45    [W:2.419 / U:0.268 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site