Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2339749pxb; Mon, 20 Sep 2021 19:22:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyeR7LfGede716hnVCjQwjpygQy7+6l3YVvPp0vxQiPraqM1ZEwDyZnjr9xYxwq3UCVCor X-Received: by 2002:a17:906:12d8:: with SMTP id l24mr31352915ejb.126.1632190958846; Mon, 20 Sep 2021 19:22:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632190958; cv=none; d=google.com; s=arc-20160816; b=SE8IBgptQQgi2MGZJqTKBBbV3YJKEj7bXYHhrtRdH1d64uR9H9y6t3QS4xb0Chf/Po 7lmqjvA+5ZD4m1W59WPPN2agp5DYhpPQej1SH5breWXo3xJ+7WszNGjimoYbqnnwJajz p2PFkZMlI9gzMkUnt6zeDMGEYQ0eB64vbRctf/n1WWShs0uuE2LT2R8y/8Xk+8nSIl/u sg4czdzfRHchgLFiYPU+5kRtTASaxqpOoyTikUop/rGppGKMldINOjoDRYuPsMu+ni+4 OW3gK5/Aj1peO9YHGJQ9/56BCPvVDCX4BLw55wmiizOI2FSQ5uSTrhMD/PsrjTj1pKpe dAGw== 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=pXhAtMV+6OhhmQtySf1hgSSxiopvAtA09idy+cR+VEE=; b=Fy6FyirMufzQ/5SzZmp3a/dLkqqm5+sP31rQkFPsTl30tqvnUR5nuHcRJQV8AGY6+f OHNS1k61zCrNUkQCxZTxZm50/DPejQVfzzWZeLA3OumJZ2uB73JekCzvH83SsIzv81JR 6kTAuvwaq/EDwiPlkXyB5nXPvS05iOfYIY1Cfw9qxG2UCrd+hO6qj/D5qYXsMSur1nmm 0yWMEejtfb2HeiQqeqKywW93q8cdscGOXt2qZUPxgHckYROUnE24a8fQLyfSNVctHEBa KgqNXCg9wOYeSzFlw8JekqR4SxfQJzM9/bwo1GQ8cQpWCiuYruSLttG/6tHvFqutE3er 0llA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=up7RHmJP; 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 h17si16439003ejl.627.2021.09.20.19.22.14; Mon, 20 Sep 2021 19:22:38 -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=up7RHmJP; 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 S1351547AbhITSNf (ORCPT + 99 others); Mon, 20 Sep 2021 14:13:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:35750 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359265AbhITSJ0 (ORCPT ); Mon, 20 Sep 2021 14:09:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DB0C763264; Mon, 20 Sep 2021 17:19:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158358; bh=DdbT0CqVurI8mChm4o/1mn5Oj9+PNdY46IHGPl0eSoM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=up7RHmJPxj3Eyfiha/2d8GLrShZgXzEMta/clnNWI9qXx3ONEMFKuh954jV7oOK7v v3Axa4bNnV0Fy3VFtXcLqvbaczgLk30nOhSiwk6tA+mZyLtSYgwSOPNFSticI92Zif Ako4UA8d+HmQEMQhMds4M6OS/6MC5kndPISNDYl0= 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.4 088/260] usb: host: fotg210: fix the actual_length of an iso packet Date: Mon, 20 Sep 2021 18:41:46 +0200 Message-Id: <20210920163934.133038524@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163931.123590023@linuxfoundation.org> References: <20210920163931.123590023@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 e62c456e78ac..f457e083a6f8 100644 --- a/drivers/usb/host/fotg210-hcd.c +++ b/drivers/usb/host/fotg210-hcd.c @@ -4461,13 +4461,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 1b4db95e5c43..291add93d84e 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