Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp522078pxb; Thu, 9 Sep 2021 06:22:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw46ZDrUG0RqeNTbgJGrD7F9Qxc43tzjTulOV+BYipSps0ShUmk8lCsTuiylTBOEQnQ3Zyy X-Received: by 2002:a17:907:2174:: with SMTP id rl20mr3382151ejb.199.1631193730162; Thu, 09 Sep 2021 06:22:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631193730; cv=none; d=google.com; s=arc-20160816; b=AUS5bLAlY08+Sib4H7Gycs8iY55oxoaXspKa2wussKvR8N6z2ZttAU4Mebi5nIZE7k c29LcaBwINLqokMosn5CR6tZ3NV2XO6QfZ9tI0oXZmswxy00Am1ILXfT1BXiOQy3V9DT zmhnyYsWzAlirnEiPBhxKyL0ppxBOuAeZbGWbqeHblK1LuOVMfK1QMe15TDvgh2LNLb8 afSEJ7q/ZGYo8gA8rUk7YyoosiIfqzJiRSurmuCOnbvRxLzMcQA8kyot4XHt3eB7XtWp 6v64qX0Q5chAa0xZXX2xQMxm2Hc/ZREeggyzqCL3cdTpmKwWKxipGl8/cny3lyWGZfUM aYAA== 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=3Mp8RsFtOsCXq+ngrJVk8DpNK36s9J/+puf6xSpCoHs=; b=IfDdiXRWi9MNGNPEjxaZX29K4qohBbdPFphwHFX6ehVUiswQngI32yYr5Xr2bTl/Rz VYZ0Zu+WoTz27pQEVRkXlpXqT42DA/DpcvAAgbZT3sMw0e2lY/Wjg8lrn1NrbtIKcdqb y4cWqgKrDeMpvJOEXPJci/uwvJ9Oc89I6GlATWhYp6LicR/UhUddlkGlix+mFEacDGIH O1VQcvm/MIOGSjHVxO8Xz5jv1sI292ZAMq8ghs9YK6T47zE8+m1wIU4iZGulYoLqp2j8 nAfkPYvmAkTYLbKgZwh7FG21wOzLKUnkxI+u/jpfewxF/I5fTKuhp/10sAiHv3jYSHb5 xCaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OMRRnJ1F; 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 jz19si1977415ejb.599.2021.09.09.06.21.42; Thu, 09 Sep 2021 06:22:10 -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=OMRRnJ1F; 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 S1354887AbhIINVJ (ORCPT + 99 others); Thu, 9 Sep 2021 09:21:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:42430 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356251AbhIINBD (ORCPT ); Thu, 9 Sep 2021 09:01:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EF96563276; Thu, 9 Sep 2021 11:59:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631188753; bh=5fmRdW1C1OQH/3S8aaj/J58PqkHgwB3nv/Xmeurrkzw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OMRRnJ1F+xgn+xf8HlPHH7h3kr6Y/Uhj3X173x4K5Kx2PNwBx4Bh9DZhGLixpK5Ef PNxULQlw1rDBZtdRD6re3IBhjqE5p3RfAek9hsLuSJeTQr6hBXk27nbOsBIrhr1JKv GFFT6Cdf8h/63iHXjHqEoU3MTAYDVSaMEILNcVWCSpnC4ITSnvNMtZkqjUS2peYavu /AlKRt9Ra2XXNybTTl4+eK53NkoN/ljvhCjEc0AP/W2Wqhm218V1NlmL3vQsgGnMpF 0AXqXyTdchMZm2AwU5tLf+ASTGqHrcygpmfiWcNwvolzv+fgzIN3k5OVyM2GBOcQEJ p0OZZ/rMJRTQQ== 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 4.14 10/59] usb: host: fotg210: fix the actual_length of an iso packet Date: Thu, 9 Sep 2021 07:58:11 -0400 Message-Id: <20210909115900.149795-10-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909115900.149795-1-sashal@kernel.org> References: <20210909115900.149795-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 849816ab5b77..3008d692000a 100644 --- a/drivers/usb/host/fotg210-hcd.c +++ b/drivers/usb/host/fotg210-hcd.c @@ -4487,13 +4487,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