Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4592299pxj; Wed, 12 May 2021 08:51:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwc/3+swo87l7c3+qmzSIN2vcK7aYwp1jXyaFpQL9w5755ubjY2gJf68A3XCFtb4MorHmDm X-Received: by 2002:a17:907:1c15:: with SMTP id nc21mr39202065ejc.49.1620834685953; Wed, 12 May 2021 08:51:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620834685; cv=none; d=google.com; s=arc-20160816; b=N4KG5HwKuNAqqblyBnmBVOkYjX4dRfGFa0ykSRdLjL29Le7YEOzi2cKzOqZB5ziwog CqHOeZTvIJZiLhoiYsjoUGmk/yFTEhAtL7fBvLc0KqJtse5gMGd2wn4Jt8jXJl4utnz0 5YBFb+jhz/+5NZrHJarMARMUoGQY2Bhpl8Wan+8m8uv5bfBwTLhOBai3+cdTyTFPJ5MV tBVcUc3Drh8bqu50MG/XNpYhcFTTFqiD/QSb2+7u0yKW8asmTn/HAJCCvZkab2KGYKFA 1dyJnoHL29vieuWJ8gG3FhUjY43JAJrXvPOK/I1q41KO208LgEhshwhLZnxSbvMtzXhx QLtQ== 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=sKhAB482fDf+FbqMHkp1Crn+OBu9wsx0zGscBAK5HLg=; b=ZSBT7BIzdGVvESB9Z6lLA20dU5xQIPUBA2fCHBIl+zSLT9L2MiEMuxq+iaDKT1hO03 Ph3lCVXRNLiKafAvH2OfoCSgA8U2VZvqBtRZgh1rPHyCXf+QnzZ60hvLVFQTvQAXIGHp yFvKiSdgq+Ab+bQZiOl5OayIGEk8hAOPjLj4STVr+jjFmROKjst8qzREIOC/1ibivoS1 FI91U+0rIrmw3vzodCCplxFDNg1llYj12YwWaSpsdL4jl7MNqj7kmxmGn+QCfzabm5GY NOrtPso7Go2qlosHTz3aFThdzVjSKBTJupFnPaZhVmGb6/nLAoEsqbaWRBUoBaYGKO48 qcuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OUCnA85A; 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 v24si94746edx.476.2021.05.12.08.51.01; Wed, 12 May 2021 08:51:25 -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=OUCnA85A; 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 S237367AbhELPuD (ORCPT + 99 others); Wed, 12 May 2021 11:50:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:60306 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233551AbhELPYP (ORCPT ); Wed, 12 May 2021 11:24:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B3458619B4; Wed, 12 May 2021 15:09:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832190; bh=UzEpmqrKLhRDY5yqTYrJzl2TtaBXi6EbG6hW1Jrm+fA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OUCnA85ANBYMQDIRgIinvpTiqHmbIzWN2dBF79aO/VPD71bAqjzsB4JVVuLdVs9dk cNlGQ2MKHMIaAHxWjhJMZQIPFwCLX8oOO5bJd6S22vDFaqRgev/o4su0Z0aRFFzXfb TsKJw4eWX0GJlxAQQS7KSLMQz6xuG0JJln3bHNnc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fabian Vogt , Sasha Levin Subject: [PATCH 5.10 177/530] fotg210-udc: Fix EP0 IN requests bigger than two packets Date: Wed, 12 May 2021 16:44:47 +0200 Message-Id: <20210512144825.651104263@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@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 39260007ebf8..345827cf1b64 100644 --- a/drivers/usb/gadget/udc/fotg210-udc.c +++ b/drivers/usb/gadget/udc/fotg210-udc.c @@ -820,7 +820,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