From patchwork Fri Aug 27 20:27:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 138841 X-Patchwork-Delegate: me@felipebalbi.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o7RKRuDQ013868 for ; Fri, 27 Aug 2010 20:27:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753255Ab0H0U1t (ORCPT ); Fri, 27 Aug 2010 16:27:49 -0400 Received: from smtp.gentoo.org ([140.211.166.183]:35209 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752278Ab0H0U1t (ORCPT ); Fri, 27 Aug 2010 16:27:49 -0400 Received: from vapier.localnet (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 77AAE1B4049; Fri, 27 Aug 2010 20:27:48 +0000 (UTC) From: Mike Frysinger Organization: wh0rd.org To: tom.leiming@gmail.com Subject: Re: [PATCH 1/2] USB: musb-gadget: fix bulk IN infinite hangs in double buffer case Date: Fri, 27 Aug 2010 16:27:05 -0400 User-Agent: KMail/1.13.1 (Linux/2.6.35.2; KDE/4.4.5; x86_64; ; ) Cc: greg@kroah.com, dbrownell@users.sourceforge.net, felipe.balbi@nokia.com, linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, Anand Gadiyar , Sergei Shtylyov References: <1282909040-2936-1-git-send-email-tom.leiming@gmail.com> In-Reply-To: <1282909040-2936-1-git-send-email-tom.leiming@gmail.com> MIME-Version: 1.0 Message-Id: <201008271627.08137.vapier@gentoo.org> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 27 Aug 2010 20:27:58 +0000 (UTC) diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 6fca870..f019843 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -500,6 +500,8 @@ void musb_g_tx(struct musb *musb, u8 epnum) | MUSB_TXCSR_TXPKTRDY); request->zero = 0; } + if (request->actual < request->length) + return; /* ... or if not, then complete it. */ musb_g_giveback(musb_ep, request, 0);