Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp433723pxj; Thu, 20 May 2021 12:47:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrA9f4NM1KdeXZbJ94voynGe8lpWXxkuwIafn7g6TqAocBx/M37Pxb+ep1WtumvePUht3X X-Received: by 2002:a05:6402:2691:: with SMTP id w17mr6838354edd.140.1621540054161; Thu, 20 May 2021 12:47:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621540054; cv=none; d=google.com; s=arc-20160816; b=0nCqfXj2efMYTX8+EA3hEb2NkziLNrURPHFneNd5CUHENcQwXT1ARaDfUE43FyaJsP yXslPxxAYk7LY4YuqETGbOAcAhJtzPn8mgzIhNsJhjkqNeibtrLnrm6UzxWt+EDPnixZ KUXrm8U2fNH8ruy7C9Yog9dRGNbEUy0GNaBMKqYZ7diwtMtl/Z5DMM2eafbrSAcYh8+Y zIQpzQrsttYR8PDdvind/zvqnCqYJOCNeLt3txhDtjbU6xE8PSVbqnTdPNU4+Q0w4cJQ oTE7vKNWNya0ILjgMpB7rsp6hq8DFypSuNYboiZ/EHBCtR6TNsFq3oGDt1sIB/SWPuY4 2NWA== 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=KBmYzK66X64T3LrkhFh28/w+fMDKp30MM0b110hUoIc=; b=zy6w1HZWHjfaIaU5n6qmA8bFqTAuK67GyxlzsuRpQHHa105bRISU/hdz1EaONUGU6o C+7RLjTOnQnyBCFVPPEnQUn4wp5UqPYRWNAHqx94NdlTg9W6HIM+9P1qrcFlDsEwnbNg NfqoIeIi8X2SUh/iQSRGNgsAW84Ljp2vpcPg4NkjTixI04tdR8+D61BekIbmXhC/4XmB c5zKfYQAVj7s/UBlHHD0+pKj2+wALbpZmHRDYPYnE2J1P9TbjuaScJE/wjKlygCba0Mo +ETGMC+SYM9Cv4zbrg+DjaV/UCMFZ0WB6PS/jc/PeLW/walY9p8QaLG9E/h1fjsgvSiz P61g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SKtm0wls; 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 bv8si3350085ejb.377.2021.05.20.12.47.10; Thu, 20 May 2021 12:47:34 -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=SKtm0wls; 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 S237354AbhETKm4 (ORCPT + 99 others); Thu, 20 May 2021 06:42:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:55682 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236725AbhETK1k (ORCPT ); Thu, 20 May 2021 06:27:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D692361C2A; Thu, 20 May 2021 09:50:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504235; bh=hyJgJHYlZPm3nwAfViHxJxSu8VKQuNcrn8dgUdUiNZo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SKtm0wlsuD10ALPcPrkrz47p8qLCtmBPL7q6E055IJ9CDCg+LlpR898E4b9qvxaxb wEAjG9AD/jVzR2yCCw79ACPn2pV7xHgW6yuWTUXym94QK/PyXB6Qf20KMmkuPy/yzb hUHN7+GAKXGY5zFeTMIk6UGrK2lz7Gi3eWo47E5w= 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 153/323] fotg210-udc: Remove a dubious condition leading to fotg210_done Date: Thu, 20 May 2021 11:20:45 +0200 Message-Id: <20210520092125.351130236@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 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 788ba50b223f..dcdf92415064 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