Received: by 2002:a05:6520:4d:b0:139:a872:a4c9 with SMTP id i13csp2563886lkm; Mon, 20 Sep 2021 18:49:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIscpbEksm52KnGayggtY/qPjdmJl6eMDFNSZReAhfoyFhfjx8jcF+1YK9f3e3om8teGtd X-Received: by 2002:a05:6602:2c07:: with SMTP id w7mr20751290iov.122.1632188980095; Mon, 20 Sep 2021 18:49:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188980; cv=none; d=google.com; s=arc-20160816; b=b2khcKupzfxbbQEGqBIulDTmrfZoOjO1RQQ8Z4AZ+4hrz9nvkPCwg13I4lNmewlVJO i7XVG70FONPakj7y6AtZMMY1pezI/u0sx5wbZqdagnrDmqd17FxXbXn5+U1NK1OsqO2w gmODBjsJDbuYAhKPt3fngY2UgBBVSH6dbwZEZ2J3mdy2U+0pUpONmjWYrmy2Z/Iba+JC elR4XEAjlouo/OnFDkKvyzj/oDzY+2FJKf74bc+Ox1DmV3gROXg0b0GzXgiubMWWYJnA BkEJg2PW7NlquDqZ8uaTo0uYyWnhMPwtKQ9WttFCB2Yf9SOFdht5S2Yww2e3P7tkl7GA v9rQ== 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=QZKudPZZ28f0B6jJNHHNtmOK7hDGcs4GpnxFbbtaXb0=; b=OfgefjnhbABXOeieDFU+zm2QVXYVAd3JJ2BYhdYa3pJibFrTkz2arAzo59kuoIk5wq b4tCWGvZcEuQNU8uFfgaL4M8u79LwBJhl9E0aYtyvqcBSQPrsaxG6tSYYUNQjYuNXPaO QsV0xRIj7moOsgaQbCpEvQYogrP1GohIfOaD7rFwStwonUYdfK14cfOfMjDNXGfKFHWb WiSG6fzBx4efX0clPxaI8sKUwv+BsyNHCDyoClxMOLlmjzVsPcP+VFAxElSgpkWNIWOs 65ZeyCRbYPxjMDg+/V3vbue+RzEoSsZjupkSfEXIAGC9Bv8VRbB38cD0Twfh/MblEp91 f3aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YxbcRdal; 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 k126si12276599iof.103.2021.09.20.18.49.29; Mon, 20 Sep 2021 18:49:40 -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=YxbcRdal; 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 S1354253AbhITR4L (ORCPT + 99 others); Mon, 20 Sep 2021 13:56:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:52814 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354596AbhITRuj (ORCPT ); Mon, 20 Sep 2021 13:50:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 58AFD61BE1; Mon, 20 Sep 2021 17:12:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632157922; bh=c/iGqXfGVuVAd/ANNXRoXJi8xWZQTW5TGDgs0H7KCEo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YxbcRdal5f/rQu2MuiANXdAcYjG6IrpEG97T5LpvYbiD1Zhg/34zuNhDgx7hzmBoC AkeXWlqdtTsDch2nLqgAfatpwCoS519Oa2YrKW/Lm4jjiY6has0+u339sUuu+p1rPb 9nV+wKw82ns6shWiKJO0hyvGTXCwBDyJI8ACpSp0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kelly Devilliv , Sasha Levin Subject: [PATCH 4.19 182/293] usb: host: fotg210: fix the actual_length of an iso packet Date: Mon, 20 Sep 2021 18:42:24 +0200 Message-Id: <20210920163939.500438291@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163933.258815435@linuxfoundation.org> References: <20210920163933.258815435@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: Kelly Devilliv [ Upstream commit 091cb2f782f32ab68c6f5f326d7868683d3d4875 ] We should acquire the actual_length of an iso packet from the iTD directly using FOTG210_ITD_LENGTH() macro. Signed-off-by: Kelly Devilliv Link: https://lore.kernel.org/r/20210627125747.127646-4-kelly.devilliv@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/host/fotg210-hcd.c | 5 ++--- drivers/usb/host/fotg210.h | 5 ----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c index 4e98f7b492df..157742431961 100644 --- a/drivers/usb/host/fotg210-hcd.c +++ b/drivers/usb/host/fotg210-hcd.c @@ -4459,13 +4459,12 @@ static bool itd_complete(struct fotg210_hcd *fotg210, struct fotg210_itd *itd) /* HC need not update length with this error */ if (!(t & FOTG210_ISOC_BABBLE)) { - desc->actual_length = - fotg210_itdlen(urb, desc, t); + desc->actual_length = FOTG210_ITD_LENGTH(t); urb->actual_length += desc->actual_length; } } else if (likely((t & FOTG210_ISOC_ACTIVE) == 0)) { desc->status = 0; - desc->actual_length = fotg210_itdlen(urb, desc, t); + desc->actual_length = FOTG210_ITD_LENGTH(t); urb->actual_length += desc->actual_length; } else { /* URB was too late */ diff --git a/drivers/usb/host/fotg210.h b/drivers/usb/host/fotg210.h index 7fcd785c7bc8..0f1da9503bc6 100644 --- a/drivers/usb/host/fotg210.h +++ b/drivers/usb/host/fotg210.h @@ -683,11 +683,6 @@ static inline unsigned fotg210_read_frame_index(struct fotg210_hcd *fotg210) return fotg210_readl(fotg210, &fotg210->regs->frame_index); } -#define fotg210_itdlen(urb, desc, t) ({ \ - usb_pipein((urb)->pipe) ? \ - (desc)->length - FOTG210_ITD_LENGTH(t) : \ - FOTG210_ITD_LENGTH(t); \ -}) /*-------------------------------------------------------------------------*/ #endif /* __LINUX_FOTG210_H */ -- 2.30.2