From nobody Tue Dec 16 03:08:26 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4303BC07E9D for ; Mon, 26 Sep 2022 10:52:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236758AbiIZKwR (ORCPT ); Mon, 26 Sep 2022 06:52:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236894AbiIZKtp (ORCPT ); Mon, 26 Sep 2022 06:49:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A973C580B7; Mon, 26 Sep 2022 03:26:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AA6A360B9A; Mon, 26 Sep 2022 10:26:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE84AC433C1; Mon, 26 Sep 2022 10:26:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664188017; bh=uL7SlwwZZ5lf4O8RXBnrMmtiQSNrVMXo+2zGJvQVkFk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dE6DB3OjlJbe25t4PnuvSRiVDekZ3qUIWdl9csqoiZPp0Ksgs/mUQdBfSPo2ki/l/ w3SMVs0P3xuXN4Tf+fIN977gnLQDUII1z4VYoFh+nfCMAN1q93nurNoNP0SCYchGCO EXN7P5EBjCwYnoIoMqqyQ0gTGuqfF3mEI4ww3Ajg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chunfeng Yun , Sasha Levin Subject: [PATCH 5.10 014/141] usb: xhci-mtk: add only one extra CS for FS/LS INTR Date: Mon, 26 Sep 2022 12:10:40 +0200 Message-Id: <20220926100755.099825650@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100754.639112000@linuxfoundation.org> References: <20220926100754.639112000@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Chunfeng Yun [ Upstream commit 1bf661daf6b084bc4d753f55b54f35dc98709685 ] In USB2 Spec: "11.18.5 TT Response Generation In general, there will be two (or more) complete-split transactions scheduled for a periodic endpoint. However, for interrupt endpoints, the maximum size of the full-/low-speed transaction guarantees that it can never require more than two complete-split transactions. Two complete-split transactions are only required when the transaction spans a microframe boundary." Due to the maxp is 64, and less then 188 (at most in one microframe), seems never span boundary, so use only one CS for FS/LS interrupt transfer, this will save some bandwidth. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/5b9ff09f53d23cf9e5c5437db4ffc18b798bf60c.16= 15170625.git.chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman Stable-dep-of: 548011957d1d ("usb: xhci-mtk: relax TT periodic bandwidth al= location") Signed-off-by: Sasha Levin --- drivers/usb/host/xhci-mtk-sch.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/usb/host/xhci-mtk-sch.c b/drivers/usb/host/xhci-mtk-sc= h.c index 450fa22b7dc7..59ba25ca018d 100644 --- a/drivers/usb/host/xhci-mtk-sch.c +++ b/drivers/usb/host/xhci-mtk-sch.c @@ -408,13 +408,11 @@ static int check_sch_tt(struct usb_device *udev, { struct mu3h_sch_tt *tt =3D sch_ep->sch_tt; u32 extra_cs_count; - u32 fs_budget_start; u32 start_ss, last_ss; u32 start_cs, last_cs; int i; =20 start_ss =3D offset % 8; - fs_budget_start =3D (start_ss + 1) % 8; =20 if (sch_ep->ep_type =3D=3D ISOC_OUT_EP) { last_ss =3D start_ss + sch_ep->cs_count - 1; @@ -450,16 +448,14 @@ static int check_sch_tt(struct usb_device *udev, if (sch_ep->ep_type =3D=3D ISOC_IN_EP) extra_cs_count =3D (last_cs =3D=3D 7) ? 1 : 2; else /* ep_type : INTR IN / INTR OUT */ - extra_cs_count =3D (fs_budget_start =3D=3D 6) ? 1 : 2; + extra_cs_count =3D 1; =20 cs_count +=3D extra_cs_count; if (cs_count > 7) cs_count =3D 7; /* HW limit */ =20 - for (i =3D 0; i < cs_count + 2; i++) { - if (test_bit(offset + i, tt->ss_bit_map)) - return -ERANGE; - } + if (test_bit(offset, tt->ss_bit_map)) + return -ERANGE; =20 sch_ep->cs_count =3D cs_count; /* one for ss, the other for idle */ --=20 2.35.1