Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1700186pxb; Thu, 16 Sep 2021 13:20:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzmXDEp7xI2thVmCVD9jyuveGBK25AvgSJfonPYKcRTIIS29qXAnAzdab76fKPf0UOLFH2 X-Received: by 2002:aa7:da45:: with SMTP id w5mr8513902eds.266.1631823610313; Thu, 16 Sep 2021 13:20:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631823610; cv=none; d=google.com; s=arc-20160816; b=YX96bJVzIbWPL7I5vKIa+DsAhGsgA2zI1aMBfrIPxBgXSZ4QN5EGCQ7uMvbFKHe6C/ 8OBUS7KgUU9MKYhY7ORP5bB9r2TAUoqX/mAmSJ3OqFE9nr2UatXK1ZwVczs6ZYq3Ycma XOE3qMjlVK4Lp4WmUrx8vWbmAEOfS4324l5dc36lSVrI/JIe14S6widsx/7y+k4sHcAT n7fp7pbYLg6rGovsv0SBngKn/GantR+UWMAHHJAVvxHBuo7UZvY0XsP3Y2Eb1/9bvw+E tXKAdAYPxTFKMfqP3IxE0zLge10E2uUE0rTPPiwe5aPkvgtTCjEqe6HLimUh1NskKWyc VYIg== 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=C2ezPeq6bB9Ll4T8q/W6PIpY34YkRBU4LtcUEN8CsSk=; b=AyMvQz3i2FPr+KEZdeV9xSkWMbj4pkzAV4LOvoFUMGC07Srs5YlPZ2Pog3ac0flS9H P8GrXuaeifWGb5emg2dtpgbq2uq2LgZ1oo0Bfp0FD0PgszR95bcayr/EPl2u39dVE36r RkX0/fnu/46C/EFv8mqp+awFLqXyTKY4f5MpfJNSJYqyShQrScgx801Da4NREj7sJmsj Zw6Vwc8NPT9ykCnQIxrXpeMB1ARuMQOofqS3OwK2mV9TrN8wql0KvsjHB9wFi3v1aUoT xM0fCRbByFVOSmVF/smLTORWLb+S+fjBcbA8yo1nmg1YFqI+ZXZN/HCFSHIwEDj+znrp giLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JHkQX4ux; 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 lz19si5531081ejb.632.2021.09.16.13.19.46; Thu, 16 Sep 2021 13:20: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=@linuxfoundation.org header.s=korg header.b=JHkQX4ux; 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 S239424AbhIPQVI (ORCPT + 99 others); Thu, 16 Sep 2021 12:21:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:49222 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235243AbhIPQMB (ORCPT ); Thu, 16 Sep 2021 12:12:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DE7326135E; Thu, 16 Sep 2021 16:09:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808554; bh=xHS6AlhJcwDQTw0B7RWU++5YEdgq3/cRxwIjtyD45fY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JHkQX4uxfRG+G/ioPzOye7CUSX/awnhK7eN6opQTaHa/upF4jHeJLS/vHp5YeKYRr VaXgMGnTrXiqNel08eqdp3+BP8hdSzzt+0h+YgERni4yeMCOQRC7kpD3RQSPtmPY4p 2BGeAs1uwxBX9cV9CvA0klUdcgbXy0iSbxkep1O8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kelly Devilliv , Sasha Levin Subject: [PATCH 5.10 133/306] usb: host: fotg210: fix the actual_length of an iso packet Date: Thu, 16 Sep 2021 17:57:58 +0200 Message-Id: <20210916155758.585358828@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@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 1eb8bb55c59c..ff0b3457fd34 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 6cee40ec65b4..67f59517ebad 100644 --- a/drivers/usb/host/fotg210.h +++ b/drivers/usb/host/fotg210.h @@ -686,11 +686,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