Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2319411pxb; Mon, 20 Sep 2021 18:42:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWUWhWZCimLC604mj2zqf7SwM2wYpa1ps6Rj0v+erBHtpTnchkAwZmIneytcv6wQzAgKwW X-Received: by 2002:a5e:8d16:: with SMTP id m22mr6802191ioj.62.1632188549846; Mon, 20 Sep 2021 18:42:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188549; cv=none; d=google.com; s=arc-20160816; b=TMqj9PUc6FQwqzVo7yHaOO+lPDFY+uNJrPgYvNLf1DEVlfRiH67IKbDGgYqyM4KQZE lNA4eoVn0VG3uGAwgV49RLcG4/8M6ka1HgtbidXAFHHTm42t4zhr7ty0+v1A89GBoRaj Dp5GmDRfWkt8zdGuATgtpTS1gbm6TCH8/35KJwhQMFdcahNpp+NufKR5n+LEp/DOpeMU SvyxF9RJYcEOPGLW0P9COGidH9YUBqTuSZrtc6jPpAAmCtyj2V4REATqDZ4MluJnILAD 7Qlo+1qWhtL7uy+elT+LY4bpNuxhtVw+6PlePtMMfJJDBEIS73/as7DXJ0CUHBzppnoO ZJfQ== 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=zAIvToMyH+BRF8Uu92tqEFReZUognp4zQSqAkl/gZ0I=; b=lV/9l9hcZDflfqi8UcBSD7xVddaU9pGHW+dFOv3kp+VDa1zTIjxVDV7s8L4/Ydy9x7 U4F5y/93HitbAC7fvKFUTMYhP5ItSgdjMFFpCDRYuZwjJWFFoKctb6IfBAkMcwDS7YTs yobKNHm75aFw9wBnaYaWX96jfZVmsjMnYEt/+vMz9dSIjqfUzzOChDIKhRqK5baYWQrc 1lgDcEWcM0vu4cLQfb40dftfYk7jAuT//9jZpU59dvI0J3zR7z2uCWy2JcUKS8HbyAr8 sSCAcqrYweYXBBwuGzfc6dvcEqtNGt9NqKPj3YtkfsRCB1UiIJuqvPfTRxyITUXaccVC iETA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dtolYjuk; 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 r195si13883644ior.17.2021.09.20.18.42.19; Mon, 20 Sep 2021 18:42:29 -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=dtolYjuk; 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 S243839AbhITQyJ (ORCPT + 99 others); Mon, 20 Sep 2021 12:54:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:36076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237894AbhITQuo (ORCPT ); Mon, 20 Sep 2021 12:50:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 43A896128A; Mon, 20 Sep 2021 16:49:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632156545; bh=OegV4XZiTSm/ViS5j36yq5Ljf73puaGDEcIdEG3Azbs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dtolYjukbuAg6qoOkOA6qJ3vIO9D2kngYDb74duj8zlhMA+fJbB9bve8w0P/+Sjwq ZerFphDvNjMhtHUVQiTO+CX6L3xY8vCoIATeCD8UBR7aXOR2l/yVsJZf/SX+c7M5m+ aiAsP34Nm36d6AtKYMn/MzIAR5xBL51NyaMb98dE= 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.4 091/133] usb: host: fotg210: fix the actual_length of an iso packet Date: Mon, 20 Sep 2021 18:42:49 +0200 Message-Id: <20210920163915.620017418@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163912.603434365@linuxfoundation.org> References: <20210920163912.603434365@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 5dacc3076efd..e081392ec830 100644 --- a/drivers/usb/host/fotg210-hcd.c +++ b/drivers/usb/host/fotg210-hcd.c @@ -4495,13 +4495,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 b5cfa7aeb277..1a3f94123c88 100644 --- a/drivers/usb/host/fotg210.h +++ b/drivers/usb/host/fotg210.h @@ -682,11 +682,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