Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp315897pxj; Thu, 20 May 2021 09:58:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmEf+8X78EXKmNwNEIesHoywGBrnGMcOw3x/ZIjCb+r9uRUyHq5iSY0piPFJsGIX1m1KRn X-Received: by 2002:a05:6e02:1649:: with SMTP id v9mr6483950ilu.62.1621529890106; Thu, 20 May 2021 09:58:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621529890; cv=none; d=google.com; s=arc-20160816; b=eZeYSbO1iLIGD7zOVx2koyy1ipXTyEC2lM8cklML9rCuunyv5G5V4tys8QIwu8d355 ULL1cie+J4XfjOweEfjveqW9oDCs/FgSPxx6e0JVM/WPt48W2ORn9qIzNXwQAZhP/rdR 2VcFLNujrQth0bwqVoyhNp/bBsBWSBQU7NkjxQuLwowKZQvc2Ue6lYf4+yVXGMll7ds/ AKPkswyHlPjFJzP6P03wton0IWNZrb8M/lpRra2YIUJwG6VtAGwR6UvVoeExxl9Lr5yl gvzUJ/1X5W0PFw3HqLItZk4Afsrx+XjXS+tqDY0aLFPqauGgv/XlQnardvOx8LRWPKSA JT+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pIUfyMyIOiD8G9N2YGQEM9SsMhzPuQt+zWn7D5Bwdtc=; b=XiXocHUAwaEm/mK54xVQfGP12+icuBQrSyaw7DoL5QRrMg35fOJC6ug+hrjG4gYTJW CBeOFTPeXMkf+T2icu79lO1xUeKuQt1tuSCJCZtcsv+S0LxAFtZfJiwixa15T9PSFXlP lOWeE+Kf7oOQeT0WSKpVdzOO3upoc9aGrU1Hs+WLA2XUbfNIueszOnLWDbhcWnZBlIdJ xpeZulIGbpH03+PIpWJ0FFGSpQFn8OK6ZB3rY38VRkg7RBFNgb7XooXSwBzf2JX9zTdY OKQOLvuX9OCPH8HC/asSl2GiNfIxQDziy3wadj+iAb9dqdSfsLvMsLkCD4P32a+2ZDh6 yofQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pnSdStIY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p18si2739053jam.69.2021.05.20.09.57.57; Thu, 20 May 2021 09:58:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pnSdStIY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234615AbhETJ7E (ORCPT + 99 others); Thu, 20 May 2021 05:59:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:58746 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234926AbhETJzR (ORCPT ); Thu, 20 May 2021 05:55:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0A2A2613ED; Thu, 20 May 2021 09:37:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503429; bh=n6zkbPZJABhztxAMCtEy1hsu7ePbPInaxVnktcuTORE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pnSdStIYy2URObW3iqT9MbINFOaZsJSqBG+a04nud8/njvm21+zWf8mDyDi0UP92x VRHicsOItwuNO9gFcazva0IWA2OoJ0JLgn+wFs8JlYmQCaC4X3tF7fXotEAnacZasP J09alG0dra1JvaixlxmqTpam4BSO7u4TGnUHUWsM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fabian Vogt , Sasha Levin Subject: [PATCH 4.19 184/425] fotg210-udc: Fix EP0 IN requests bigger than two packets Date: Thu, 20 May 2021 11:19:13 +0200 Message-Id: <20210520092137.471543094@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fabian Vogt [ Upstream commit 078ba935651e149c92c41161e0322e3372cc2705 ] For a 134 Byte packet, it sends the first two 64 Byte packets just fine, but then notice that less than a packet is remaining and call fotg210_done without actually sending the rest. Fixes: b84a8dee23fd ("usb: gadget: add Faraday fotg210_udc driver") Signed-off-by: Fabian Vogt Link: https://lore.kernel.org/r/20210324141115.9384-3-fabian@ritter-vogt.de Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/gadget/udc/fotg210-udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/fotg210-udc.c b/drivers/usb/gadget/udc/fotg210-udc.c index d698d4ab121b..a35a55eff429 100644 --- a/drivers/usb/gadget/udc/fotg210-udc.c +++ b/drivers/usb/gadget/udc/fotg210-udc.c @@ -824,7 +824,7 @@ static void fotg210_ep0in(struct fotg210_udc *fotg210) if (req->req.length) fotg210_start_dma(ep, req); - if ((req->req.length - req->req.actual) < ep->ep.maxpacket) + if (req->req.actual == req->req.length) fotg210_done(ep, req, 0); } else { fotg210_set_cxdone(fotg210); -- 2.30.2