Received: by 2002:a05:6520:4211:b029:f4:110d:56bc with SMTP id o17csp2113623lkv; Thu, 20 May 2021 03:43:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMipclpqUP7/2nu72C63+6kiBYKMIEZaecAWcNubhE86g/Z2S5Zt8Wq7dPI2+r9/aWPngg X-Received: by 2002:a5d:9f01:: with SMTP id q1mr4985897iot.7.1621507434585; Thu, 20 May 2021 03:43:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621507434; cv=none; d=google.com; s=arc-20160816; b=TIjHUTUoYFmdFUD4cRJFSiXMpbOabvJ4XF3vOU15uveiMqtzvv5eh9v5Sz76PTn54h BDuigDFyZRusPugqzsGN57GeM7zTvsYND9x/4sdJ762YWAcLwKFyUkyAbW+GwG5LeRft jjVxzaWKZV0u3gMx9U/4f1zoBMTae9xCTS0IJxj7X24TtKtCtEbSCjCIKf+hJvqGZNU3 7Rn1s4q3n/p1THTsjx8n5pgKFhs+r2M9hiImtoYv2Xb9Dnp4+XXr8LE/yDVn7a9RnbfQ 8t1HYyc50HglI8y1eIoqHGFY3J8s3cm8CBWoKTTy58lNeTGP/P954mErSZ5RGXu+FAUZ w48Q== 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=cLp04tLjYulanqNtsUWapSA4xGVhzm1BtunAdhvwiDI=; b=k5xtAjDUXu1fYVAGpKH6OcR537rG26ks5rXAxl/jY0OBAeoiVXpCj8x8IYeib5pdzM yPWBXx9mByYeDQe09JlgDfujgjNQGYyPd31nTIPjK1WfPp6OOgDZ7VtYo8iNGfH9vuMr jvumA1JBDiC/6n7xLfnl6xFAP6/vhv12wZcxBV85vOjQbk17HRNVCjazXl/EZG/zX33d 3mMtFjNshtqNG5Q7eidMLJIYE+8Hz8rAvZhzy6rydzTGDoszjo0pr8JMiS0iPIq0xlXx ibzak0PV5jWGtgNjMBFUjIFBoqc3kMW9PiGZwVJ0c3FJHERp0uYeP8b2J84EGt4r43BF cUDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nXH4qOCB; 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 y10si1893812jan.19.2021.05.20.03.43.37; Thu, 20 May 2021 03:43:54 -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=nXH4qOCB; 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 S237409AbhETKnD (ORCPT + 99 others); Thu, 20 May 2021 06:43:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:55678 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235455AbhETK1k (ORCPT ); Thu, 20 May 2021 06:27:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AC878613AA; Thu, 20 May 2021 09:50:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504233; bh=BS88ijv4RPIZ5pKWvEeFvB/3BmmdfyXYIOaXD4gyL3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nXH4qOCBUGEq4NcgRPZuVuSYIAcbjspFLQdkl9dBqzaVW9kWT52/2OckgMjT5DPA4 jFmx86iBR1eGk8yTACZ4QyUxplKZuKJWNhknLcKXmIlCUenubwa0aWGikX1j4CQdpT wBj1taenR1OIbq6oCDLY2YCT1oqIJ6mv2o+5n8aw= 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.14 152/323] fotg210-udc: Fix EP0 IN requests bigger than two packets Date: Thu, 20 May 2021 11:20:44 +0200 Message-Id: <20210520092125.318190292@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@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 bc79bf46acc4..788ba50b223f 100644 --- a/drivers/usb/gadget/udc/fotg210-udc.c +++ b/drivers/usb/gadget/udc/fotg210-udc.c @@ -827,7 +827,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