Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp447686pxb; Thu, 9 Sep 2021 04:49:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzEY55yojxVCoVAFX6SbusW/8jie/lWXMAPFp1MTzkhuhWw2OHnu+CCpkudKN6XGIemFcC X-Received: by 2002:a17:906:3e10:: with SMTP id k16mr2973259eji.116.1631188171502; Thu, 09 Sep 2021 04:49:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631188171; cv=none; d=google.com; s=arc-20160816; b=bm0n56wzd2wUyMArFVFbJJyFWPV5A3iFjSfEPMGQ2Uy7WFx9PEzHWpXFj7OrG2g9Ja HHzSjMR/QJ1xmBOpYGo9VLO7TZBfVdmWoCTkv1QdlKL7teeabJg9JU7+lbHytTuMze6H otxf0YW/xlLU7V7vHkiTU3NJ+MWOSBqfhfTH0H5stX86xvL7OnV8efySFKLbOu06BMDe 4xwqx10FRK09YWZ6PM4Mj0Ltl53KYVxvbCYvCTaK0Ft3z67gD8g4UlfF1T1Snq01ugrf OKtmMP+skSinn8kYzApB+V9V3rKnddXfr4Q2A99QARfoAht8aFL98z9+NCaBLp1quPoj 9e4A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HBeIYOFI75fqftWOm00nSVlHMJTVbxzVUt6wS5F24cY=; b=e9ZtnnZUj9w4J2+tcTCf7rknyvatgrI1lMHZVriXP+JPpHNrd1SQA9fjFFYShOu+Lw JkyQrTrmo5ITmRV78Y40b0DYjrQqRhlCTEu3jJIShjDFFfHFFyd5frY8QRYVMYBryQ2x JhAY8jHqWKPlvqqLVDIjoUAgDOCC3BRG8i9+mPR0eW/uZLVH/yd4pkXHrho1LPn0Gj6u qh3ELfG4eFEcZaDEtm5Y0XLfh+Z5vg/V6ZhHP6SgUSpi8/w8mbwVYusIWNDMTq5ucJ/m qNiJFuRDEyEQvSZRjXoF83bYz6XuIIVK8UitKcJt2FLA/B8gQFdWjcP7kX7CZDGSt5Jo m9Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=po2QXHSB; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h25si1573926edv.624.2021.09.09.04.49.07; Thu, 09 Sep 2021 04:49:31 -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=@kernel.org header.s=k20201202 header.b=po2QXHSB; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240247AbhIILqs (ORCPT + 99 others); Thu, 9 Sep 2021 07:46:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:47118 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237647AbhIILnQ (ORCPT ); Thu, 9 Sep 2021 07:43:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9CBDA611BF; Thu, 9 Sep 2021 11:41:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631187718; bh=30flWQMPRLeBvHOnw3XigfgrDFn5hyfak+hWXBEHc6g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=po2QXHSBrA+S9Mcx+qc5lVzDJITWyO+Y8JL617EC8LKvLNxjKg/4ZQ19m1qCS+O9V rM93bKvgwyvPh2/M2uy5OHkMRKL5tHK3wHGukJMpZf+XmLH8lPxJchJbQAcGRRaUIu +4UfHrqedbFNiKToIczGodqzo3PKLoLG/Rc+7C/x8JzX6QA/JrU8wwRyzw0gvMYvhl iy+2yoZJjstlqugSNd3dksVkN3WtJxB1RAiJh1KJP5wI9qG8dsF9eLBvbhFu5JxOu3 iplJpyVhHgDi6RrXXTWHb9sOOPw0iZFafnu009SVt4axzMYX+Bqk4nn4j1llJ63TWu 6LPq714r946PQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Kelly Devilliv , Greg Kroah-Hartman , Sasha Levin , linux-usb@vger.kernel.org Subject: [PATCH AUTOSEL 5.14 040/252] usb: host: fotg210: fix the actual_length of an iso packet Date: Thu, 9 Sep 2021 07:37:34 -0400 Message-Id: <20210909114106.141462-40-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909114106.141462-1-sashal@kernel.org> References: <20210909114106.141462-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 dd29f7b68d6f..aeb235ce06c1 100644 --- a/drivers/usb/host/fotg210-hcd.c +++ b/drivers/usb/host/fotg210-hcd.c @@ -4460,13 +4460,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 0a91061a0551..0781442b7a24 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