Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1557169pxb; Thu, 16 Sep 2021 09:51:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykqU2sAB21DG+eI+H/qUg+gG+rUROmGS9boP2ysXUgt8WzQbUDoFpXN15ZmsjP/LcOMvbm X-Received: by 2002:a17:906:b00c:: with SMTP id v12mr7189909ejy.222.1631811108773; Thu, 16 Sep 2021 09:51:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631811108; cv=none; d=google.com; s=arc-20160816; b=cwirAIJr/8w6E5AYU9llEf7V0jdvy3CTG1aq9FNGjtvMOAyzSxbZJwDq2yGxGOQTeQ erZYc6TLoAXDAkM3cJxq3GDqVHUEkA6wOEaJ7wXR5Xe2JWvcGrsRg8gKGDag7H1EpnQQ 59xrpTch4KVKIqRUkXRCniLwcElnsfDpl8I9dKA//TRZr6MeD4DrDW9Czvk8kjHSvsAq UY5GmMb7ydtohXkZj9xbmWlZ9Himjg7U2TKTIVJIItIIfgCVECO6rJgESPTsEEhcWtD/ 1dMQAS88AQGfzswQu9F1R7Bvww7PSOgpVeAz84ZTGJibFmzR28q1vafUp0u0kUpTSvdS +szw== 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=IP8eI4xxuBmmfe+b2PIXP1U6QQXeNJJbDTNU7bHgsC4=; b=pwKSB4/gGYBMVuqovM5Ygmw1gNwhkUE/p2Or5D0KdbF4rmtAhacj3YeQ3yw7YelQmk uDsA/Q0TH61WVndQmHk6g7b/gjJQkukkozE9Zh/bSH4NFSiv9IMktk7G1JJHW/pY4LSs 3Lg7QkkZlvNESpn2MhEFfqGrMfzofGFaesNM4rmMFOl025WC1LZ/IJqTLC9sQOHyw619 8nd69AhRRBBceXFNKcf8C43aeIq9KmWQEGnqn9p+24WNZpq43hBiwPL4oxwl1z+gdhdN Zmg1CaJ0eSNOpHRuwPREdRHRx/F39JAQn4pztdryKjdLxtmS5u14Krs4/sjg1m4k6167 ikDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Uljdpq61; 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 s4si4021634ejj.578.2021.09.16.09.51.21; Thu, 16 Sep 2021 09:51:48 -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=Uljdpq61; 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 S239380AbhIPQs6 (ORCPT + 99 others); Thu, 16 Sep 2021 12:48:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:57410 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343556AbhIPQm3 (ORCPT ); Thu, 16 Sep 2021 12:42:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AA3FF61A2F; Thu, 16 Sep 2021 16:24:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631809488; bh=BTWXSsieuPMWhb2ZtLLTiG5NA3rJD+1qYGypUtcwUOg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Uljdpq61cGdHVicrGN55vJSetNv86DLI8wxK8m60cOWM0f8+UICqzf3uJ/rLaHRTR ASUEPB87f4K+8YOGoFn1Y/uu8vF2NTD9sUBXChUkaNqArzQQYHQDhKtlM2/RCzvGKC Fy7T3EFnw8aX92AP2pOlobe3XKSNz4YeFIiSDgRU= 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.13 171/380] usb: host: fotg210: fix the actual_length of an iso packet Date: Thu, 16 Sep 2021 17:58:48 +0200 Message-Id: <20210916155809.894047336@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155803.966362085@linuxfoundation.org> References: <20210916155803.966362085@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 3b5d185c108a..670a2fecc9c7 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