Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp61387pxj; Thu, 20 May 2021 04:36:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSuZf3vR1W+0p47QsnhoiHy9FOv+H/W+DtmYccFunVnkcbwZRBBVyN8774lyJ3sA/1Q34F X-Received: by 2002:a17:906:3a82:: with SMTP id y2mr3248109ejd.145.1621510568237; Thu, 20 May 2021 04:36:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621510568; cv=none; d=google.com; s=arc-20160816; b=B6u7vu4E9RFABnVdeesnkv/69THcMJat7NaqX2zhywK+DLTk9hr56msBuAJltxmWjl AvVx1QSLrSmlFVSVUL/RTfeszTX8LODTVBx+uXffP8YPLnAZepgo7URNHh+ZDVDxvG3I 3GLMkdUlun76098LsK2zsyffYtwaQ08073QDvlAacZpLQcuqNxzu+7LQ0qg30cZAusms qR/5pbF19dLA7zK/XD7ya+BBOURq8rGU4+Y5R0G5+r9eBLFE2kDm8Ey+YmG4+01mv28v 4hSJ96e5VIQKSaPqiPoMjlaYDo7PFdDQ3o1Vq6eRgEKawZKOyS6EGH4FcqU206ZZoAAI qK/w== 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=r9AXnOuA8cmEiD94bF4Tr/j5shNjHlIpglWJz9q/BY8=; b=FERgUYCp3kH5np5Hxh8iHIMUpmZW6UkKrZj1JNTLMEzTVJRdkDTFLUMML1AEb6SYcg EuZIR8JRzq0qxfDXszDfcM5B7tfBS+/hI9yAlP5BKQLcr/dJQVxJUudOXv+sTB63by7o XNbsPFiBFDMVL+akZ+UEb3Dlk0UQcInExJMIWdRi8P7vso7HnyTlzeOGjo60PMnUhuQ/ WXL1UtuOnw+LH0f8O2ObtaLwAOrkBdZcDgf3EEL6BqzX6vjyLNb+Zx1Md5E2YhVqXA4w JqMcKrjif6Zq2JX+yY3LsEzKW8gARhtErTSR5Q8yBHy2IaCoWY0RQ/ZE9JnmAuFrRllH xCgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hcJ3EwlU; 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 t16si2528827edi.299.2021.05.20.04.35.44; Thu, 20 May 2021 04:36:08 -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=hcJ3EwlU; 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 S242331AbhETLfT (ORCPT + 99 others); Thu, 20 May 2021 07:35:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:37196 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240603AbhETLPA (ORCPT ); Thu, 20 May 2021 07:15:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2180C6143A; Thu, 20 May 2021 10:08:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621505324; bh=WJpsw6vekG4EeARk0DUidThXyp16RxGecDQXShEeJpY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hcJ3EwlUsl4sAMSZywkvHbCrxqUQ+0Anm4W8WnKfUlmNl8wnhJhMkzsEQeHG9b8na 9Rv+1ZNd1n77aR89jtfiZBF7ZeXCTEuVQW3v9kv7mHGEkhh0kT6p19Aii02e9kqGtu Ngq5zrogM9BUvWXL+VTO0zibnetwEj4W/nv0NhFo= 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.4 084/190] fotg210-udc: Fix EP0 IN requests bigger than two packets Date: Thu, 20 May 2021 11:22:28 +0200 Message-Id: <20210520092104.976541136@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092102.149300807@linuxfoundation.org> References: <20210520092102.149300807@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 7831c556a40b..1eda6fc750c1 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