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 1EBEAC43331 for ; Sun, 10 Nov 2019 03:00:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DF2922184C for ; Sun, 10 Nov 2019 03:00:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573354827; bh=TPrIXpFHMn6cXPFaNNnmHnpk5EEQhbToYpDBo9dmzzw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=o5bWoAEYSLWle+e4nKXtCriScK2ot+3uxvB3HzVIan2DvaTCfslNrepDJ0tmKxchj 3Bdi4r/J4/kIsB2vvSDePNmSKqgXGn4tIGlRrhFbmq0YEFEBzavamwUWWj60DY87pW wAd0Huj8e/hbP+YGX5oUnrnfsGTIn66+M3SNw2GE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728753AbfKJDAA (ORCPT ); Sat, 9 Nov 2019 22:00:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:47262 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729288AbfKJC4r (ORCPT ); Sat, 9 Nov 2019 21:56:47 -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 630172255F; Sun, 10 Nov 2019 02:48:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573354118; bh=TPrIXpFHMn6cXPFaNNnmHnpk5EEQhbToYpDBo9dmzzw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2q0wbxTdXATB9vCDz585YWfQDRVYeA2An/Gsnf6AQIEYi0aJNOMn0fts315n7dNY/ u83MOlkLcPW+DnZ1mYa1TUi361MaG8qNXVLwd5OQgVSkI9B9OvsMmAtkK+38hK1oRG 9PZyhkwa8Rv175gvcxL+2xRVoYNGJMGJ3nygtt54= 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.14 106/109] usb: xhci-mtk: fix ISOC error when interval is zero Date: Sat, 9 Nov 2019 21:45:38 -0500 Message-Id: <20191110024541.31567-106-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191110024541.31567-1-sashal@kernel.org> References: <20191110024541.31567-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@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 6e7ddf6cafae1..defaf950e6314 100644 --- a/drivers/usb/host/xhci-mtk-sch.c +++ b/drivers/usb/host/xhci-mtk-sch.c @@ -122,7 +122,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