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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 A4E2DC43215 for ; Tue, 19 Nov 2019 05:54:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 700FC2084D for ; Tue, 19 Nov 2019 05:54:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574142895; bh=TPrIXpFHMn6cXPFaNNnmHnpk5EEQhbToYpDBo9dmzzw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=GwsOWupUmUz9IJIIsskxOje1vhk9zcWsEGf4lrhZDpFlEsOELTKNSpYlHrLZm3FAW 4njffbEA5bGu081pPHwhOp2PZFnmqhTGt3jr92NcO92h0WDbMMDBMNC/2bauZHGFgj DTqOUIoYdYS7AQVninZF1r5DwIHBaVIVDWAEbv2U= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728697AbfKSFyx (ORCPT ); Tue, 19 Nov 2019 00:54:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:53008 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732200AbfKSFys (ORCPT ); Tue, 19 Nov 2019 00:54:48 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F0F522084D; Tue, 19 Nov 2019 05:54:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574142888; bh=TPrIXpFHMn6cXPFaNNnmHnpk5EEQhbToYpDBo9dmzzw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HnBjvOkoVrFAoPBfb4qr+cw4z0CaI0vW92KqzJ+t2MS2E69PvixVWap+WVCCmVLk5 flas43WS96qj9KRLAaugxar+9HNfICBLw5cvs6jjpJTsvxgYVKRqr+B5+3Iz4Szfu5 buPimi95ehAbB8moSrm4F1Ih9WT/L5bPGUYFmsH0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chunfeng Yun , Mathias Nyman , Sasha Levin Subject: [PATCH 4.14 235/239] usb: xhci-mtk: fix ISOC error when interval is zero Date: Tue, 19 Nov 2019 06:20:35 +0100 Message-Id: <20191119051342.579810327@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191119051255.850204959@linuxfoundation.org> References: <20191119051255.850204959@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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