lkml.org 
[lkml]   [2017]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.13 056/160] usb: gadget: udc: renesas_usb3: Fix return value of usb3_write_pipe()
    Date
    4.13-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

    commit 447b8a01b84f048d93d43bfe1fcaa4fcc56595cc upstream.

    This patch fixes an issue that this driver cannot go status stage
    in control read when the req.zero is set to 1 and the len in
    usb3_write_pipe() is set to 0. Otherwise, if we use g_ncm driver,
    usb enumeration takes long time (5 seconds or more).

    Fixes: 746bfe63bba3 ("usb: gadget: renesas_usb3: add support for Renesas USB3.0 peripheral controller")
    Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
    Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/usb/gadget/udc/renesas_usb3.c | 5 +++--
    1 file changed, 3 insertions(+), 2 deletions(-)

    --- a/drivers/usb/gadget/udc/renesas_usb3.c
    +++ b/drivers/usb/gadget/udc/renesas_usb3.c
    @@ -1032,7 +1032,7 @@ static int usb3_write_pipe(struct renesa
    usb3_ep->ep.maxpacket);
    u8 *buf = usb3_req->req.buf + usb3_req->req.actual;
    u32 tmp = 0;
    - bool is_last;
    + bool is_last = !len ? true : false;

    if (usb3_wait_pipe_status(usb3_ep, PX_STA_BUFSTS) < 0)
    return -EBUSY;
    @@ -1053,7 +1053,8 @@ static int usb3_write_pipe(struct renesa
    usb3_write(usb3, tmp, fifo_reg);
    }

    - is_last = usb3_is_transfer_complete(usb3_ep, usb3_req);
    + if (!is_last)
    + is_last = usb3_is_transfer_complete(usb3_ep, usb3_req);
    /* Send the data */
    usb3_set_px_con_send(usb3_ep, len, is_last);


    \
     
     \ /
      Last update: 2017-10-10 22:34    [W:4.223 / U:0.276 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site