Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp316266pxj; Thu, 20 May 2021 09:58:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHSHGHAwNF6vtjLZ6yvJNW0IOhntSVTSmltZwlC3e68HnCQFkM3qkg/2OX1OJJXzzJ05mR X-Received: by 2002:a02:688:: with SMTP id 130mr7488345jav.48.1621529928152; Thu, 20 May 2021 09:58:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621529928; cv=none; d=google.com; s=arc-20160816; b=puNAUbsLPLT/YM9Ct8rQXcCWdREQTkUY+na35KEnNvjS3QQbQTH+JnJJAjhb9qANoR 4htMfZYq5MIlR24gUl4KrGYm5DKUlcuOGLySS6OqpnEwgr3AlDct3G///BVzcuaU9czh 94Z7Ymmt4IpM8iQpU4vyKNkDih79ah1nGpD1MpFdaduCg44T9DG6D0Nz/17gNvFBr95C n7lvNNQnQLTsFXXUefrsEydZYuJdg0xQURgFTvCMZ8sFYEyZN3KbSgtaaCPETFHQ6d4a fbPC1xRARvoqlPZFBUpqiSCRJQQoscO3mvqsM6s8JgDJSW8hKbbwrEqDKlZCMMfvpcJM Xgfg== 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=2OIjIMslCDMO+Qppmd4ozjbEbCkxU0w9HZPm5vGClXM=; b=FwxzC7o6MYwCxdLmMGTu0JJWo7M8euYI6iR+Ef4a9hYAiUGPly0xn2rvdj8yJdYOc4 vHeGFUzWAe5QowvSXfrvyXeVXllZVRbusAYBoW6cA+OzqhF2bCxJt/Kd8mMFlyHUwcIk w3QlvDvGeoRy6BlgxIpVjqH1jEjVCvsaL36taKSA/G3D7XIPIIGW1KZsPPqlYpP4WMSW hgiPJhovbSYLiWzdIeDXhrdbqfX9ur4TvUEq1w9X9r8/G1as0Kq29+SXDsaKsaKWUQ7t zfU1xQIxwJpZKskBHDlJSZnyuQn6mDXOyhy32W9gy9VuNSi3MwI4jefRKVoAIMwg/LMC RPUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DGn5o4ot; 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 n12si2847196jat.1.2021.05.20.09.58.34; Thu, 20 May 2021 09:58:48 -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=DGn5o4ot; 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 S234865AbhETJ7N (ORCPT + 99 others); Thu, 20 May 2021 05:59:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:54976 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234931AbhETJzS (ORCPT ); Thu, 20 May 2021 05:55:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3D7C461363; Thu, 20 May 2021 09:37:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503431; bh=MxAjhHn0lYS/cYiKFaQjiAmXSLfVbnOK9x3wYXjcAX0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DGn5o4otcRDntWqWsg2owf3tlvakNspvYg7r0PvUfia3+qkRvLQbMABwIdLsgPYf6 AW92NElMnN5vAoYi8GDFbsZT9W9Cpv47yvVjAkCJ+Yte45L1GlmhtQ3cd+7SN8hr0P Be10kCoYVKHZ0tYSrPQViG5skKlVeDvbo5je0CYI= 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 185/425] fotg210-udc: Remove a dubious condition leading to fotg210_done Date: Thu, 20 May 2021 11:19:14 +0200 Message-Id: <20210520092137.502692111@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 c7f755b243494d6043aadcd9a2989cb157958b95 ] When the EP0 IN request was not completed but less than a packet sent, it would complete the request successfully. That doesn't make sense and can't really happen as fotg210_start_dma always sends min(length, maxpkt) bytes. Fixes: b84a8dee23fd ("usb: gadget: add Faraday fotg210_udc driver") Signed-off-by: Fabian Vogt Link: https://lore.kernel.org/r/20210324141115.9384-4-fabian@ritter-vogt.de Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/gadget/udc/fotg210-udc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/gadget/udc/fotg210-udc.c b/drivers/usb/gadget/udc/fotg210-udc.c index a35a55eff429..6e284332b11f 100644 --- a/drivers/usb/gadget/udc/fotg210-udc.c +++ b/drivers/usb/gadget/udc/fotg210-udc.c @@ -382,8 +382,7 @@ static void fotg210_ep0_queue(struct fotg210_ep *ep, } if (ep->dir_in) { /* if IN */ fotg210_start_dma(ep, req); - if ((req->req.length == req->req.actual) || - (req->req.actual < ep->ep.maxpacket)) + if (req->req.length == req->req.actual) fotg210_done(ep, req, 0); } else { /* OUT */ u32 value = ioread32(ep->fotg210->reg + FOTG210_DMISGR0); -- 2.30.2