From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9BC6C17444 for ; Sun, 10 Nov 2019 03:07:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 970E2215EA for ; Sun, 10 Nov 2019 03:07:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573355245; bh=O3mFNZoIUng350Ipl4qr82fCz1yUrnK9uVXdJCEkPLw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=OPtWdyegcNYtjncv/3PVrCJLL3QNZlEyOajjU9hNmALNIaIB712q/cp/I+3VbD40E c3IunaZMM28cxVPv70Myumit3qjwSjiGMK45/lUUlQ8QNe4Ov13tIiOA/TTpibhN3y jVJbEUOOrvu/g10t1WKEFDhWiMCmb7rn+ILb5ftk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728806AbfKJCpW (ORCPT ); Sat, 9 Nov 2019 21:45:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:46636 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728803AbfKJCpW (ORCPT ); Sat, 9 Nov 2019 21:45:22 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1B243214E0; Sun, 10 Nov 2019 02:45:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573353921; bh=O3mFNZoIUng350Ipl4qr82fCz1yUrnK9uVXdJCEkPLw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KQpshlpWWEEm34QMbzlQm3PB5R+xaKMgcqngyhQzRdm5Y/06bUBBpcfCQibtCxAr6 +aJlTLosAb7s/K24bRXUvJJS+2D/cHz+1hR7WHv/gKP51KOqs5RW+2zSgaRbF00Coi oHtc1HhEkd5nSVKPH81nlvCyWgPwejPqOAlTuCM4= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Chunfeng Yun , Mathias Nyman , Greg Kroah-Hartman , Sasha Levin , linux-usb@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 184/191] usb: xhci-mtk: fix ISOC error when interval is zero Date: Sat, 9 Nov 2019 21:40:06 -0500 Message-Id: <20191110024013.29782-184-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191110024013.29782-1-sashal@kernel.org> References: <20191110024013.29782-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Chunfeng Yun [ Upstream commit 87173acc0d8f0987bda8827da35fff67f52ad15d ] If the interval equal zero, needn't round up to power of two for the number of packets in each ESIT, so fix it. Signed-off-by: Chunfeng Yun Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/host/xhci-mtk-sch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-mtk-sch.c b/drivers/usb/host/xhci-mtk-sch.c index fa33d6e5b1cbd..d04fdd173ed2e 100644 --- a/drivers/usb/host/xhci-mtk-sch.c +++ b/drivers/usb/host/xhci-mtk-sch.c @@ -113,7 +113,9 @@ static void setup_sch_info(struct usb_device *udev, } if (ep_type == ISOC_IN_EP || ep_type == ISOC_OUT_EP) { - if (esit_pkts <= sch_ep->esit) + if (sch_ep->esit == 1) + sch_ep->pkts = esit_pkts; + else if (esit_pkts <= sch_ep->esit) sch_ep->pkts = 1; else sch_ep->pkts = roundup_pow_of_two(esit_pkts) -- 2.20.1