From patchwork Fri Feb 6 11:52:26 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Kumar Gupta X-Patchwork-Id: 5866 X-Patchwork-Delegate: me@felipebalbi.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n16Bqj0p007878 for ; Fri, 6 Feb 2009 11:52:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754722AbZBFLwo (ORCPT ); Fri, 6 Feb 2009 06:52:44 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754784AbZBFLwo (ORCPT ); Fri, 6 Feb 2009 06:52:44 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:35490 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754188AbZBFLwn (ORCPT ); Fri, 6 Feb 2009 06:52:43 -0500 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id n16BqRvU027274; Fri, 6 Feb 2009 05:52:33 -0600 Received: from gitsvr01.india.ti.com (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id n16BqQ5p002780; Fri, 6 Feb 2009 17:22:26 +0530 (IST) Received: from gitsvr01.india.ti.com (localhost [127.0.0.1]) by gitsvr01.india.ti.com (8.13.1/8.13.1) with ESMTP id n16BqQxY004070; Fri, 6 Feb 2009 17:22:26 +0530 Received: (from a0393629@localhost) by gitsvr01.india.ti.com (8.13.1/8.13.1/Submit) id n16BqQ9U004067; Fri, 6 Feb 2009 17:22:26 +0530 From: Ajay Kumar Gupta To: linux-usb@vger.kernel.org Cc: linux-omap@vger.kernel.org, david-b@pacbell.net, felipe.balbi@nokia.com, Ajay Kumar Gupta Subject: [PATCH 2/3] usb: musb: fix bug in musb_start_urb Date: Fri, 6 Feb 2009 17:22:26 +0530 Message-Id: <1233921146-4046-1-git-send-email-ajay.gupta@ti.com> X-Mailer: git-send-email 1.5.6 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org urb->transfer_buffer_length and urb->transfer_buffer should be updated based on urb->actual_length.For a fresh and first time urb, actual_length will be zero but for urbs which has been stopped and restarted (as bulk nak scheme does) actual_length may not be zero. Signed-off-by: Ajay Kumar Gupta --- drivers/usb/musb/musb_host.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index a776951..1a78f00 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -201,8 +201,8 @@ musb_start_urb(struct musb *musb, int is_in, struct musb_qh *qh) len = urb->iso_frame_desc[0].length; break; default: /* bulk, interrupt */ - buf = urb->transfer_buffer; - len = urb->transfer_buffer_length; + buf = urb->transfer_buffer + urb->actual_length; + len = urb->transfer_buffer_length - urb->actual_length; } DBG(4, "qh %p urb %p dev%d ep%d%s%s, hw_ep %d, %p/%d\n",