Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp61818pxj; Thu, 20 May 2021 04:36:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvzzMdv3vBlIgXpnN6/I34Y+wbY0yNc4IE8TWVrLUFvtEa/T3oNsDq62ndZbP7F+Gem45M X-Received: by 2002:a17:906:2dca:: with SMTP id h10mr4136418eji.507.1621510606683; Thu, 20 May 2021 04:36:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621510606; cv=none; d=google.com; s=arc-20160816; b=HcVuRt3fJXvGeIzdNOZqVYa5239MjQg6zl0WX4qmd/A1CoXyXBtUrevwKSI1GB8t8q kPWZJvjaLoVdoYmPgY2cIa4DkCtiicb9cfk3aCN+ta/hLLv/6RQsKU+2ozRlgABX3YB6 trBajONpIlie1vYX8suSeoqT8Sz3+BBi5HH3/bH9vUnsto8hbVIF1T+znijmxhmwhHoC jAEk3sXH7KloxoiYpc6mlTpFPXbNVxlgrdA1FVzt8bwawd5pBD7400PpmI1ezc9FL8SL q09xloV7BhXLoIqdwfGY7WtVLzK0/uYNBZGpds0cOrStkLmauNflGRKuaeSgOVidueE+ WaHg== 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=28akzX7r+LzahAkPJX1tOgk5pwuNyJuir0HZTPdkk5c=; b=Jswaa/l2ux4nJ94yhuJz0wEJRwPuvT4VghlZUhnZdqoZcon+l5OzoeNGUr/LMyuB0X GQ81/R/UUQeIiN6SnadbVZnCbB/YBWeF3UHSRJ8zwdZqfXYuzKfWX2z2TiNnX/L1uOSa In4JkYpQtog+QXjL1tLOqEWSohZorV21W7luwdCSHsf7YvScgZyhvll0DbfN5oawZyh1 MyvkabR+fyhIBrIBz3opLXsYuIu/vu+0x8HSm4NaLbF/cROuy5VGQ9cL2xcHZ4lz5+PH HLHio+nOyBpea1Lcr0oUKmB63UCZGAqn9k7A18lVxWIwbKPuRSPKhPyWfSdzUpCNhOJk iRNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GR8pMML7; 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 d21si2445181ejm.343.2021.05.20.04.36.23; Thu, 20 May 2021 04:36:46 -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=GR8pMML7; 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 S242362AbhETLfW (ORCPT + 99 others); Thu, 20 May 2021 07:35:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:37174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240610AbhETLPA (ORCPT ); Thu, 20 May 2021 07:15:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5502861955; Thu, 20 May 2021 10:08:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621505326; bh=uy3xaIeNdD5r8adhSdQ7+dPo37KVWtOH3gwnu1EkGac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GR8pMML7wtsphayabrc/6I0E2dOHvYXJJDZMVgfQ+bZd2I9hKOBVUv2NnlTFXn8lQ gTVIrq7y5AaN/qx5W2g4yMLtlrP5f0lPsVenvNH0DuvPY17Iy2ix1U6j7O1zNw+1Xd /uUxlBlDEuIiiTBiF2Ltci5tEOQCUmlFbeYqA7xs= 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 085/190] fotg210-udc: Remove a dubious condition leading to fotg210_done Date: Thu, 20 May 2021 11:22:29 +0200 Message-Id: <20210520092105.007208378@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 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 1eda6fc750c1..d0a9ce7d0635 100644 --- a/drivers/usb/gadget/udc/fotg210-udc.c +++ b/drivers/usb/gadget/udc/fotg210-udc.c @@ -385,8 +385,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