Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4878667pjb; Mon, 27 Jul 2020 07:26:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypXlRa58kfvTCyhZsCPirmyWffw8yG9u8tUpW7YyaAStYgRyO5auyjtdMXqAxFVRS69sBL X-Received: by 2002:a50:fe16:: with SMTP id f22mr21710019edt.315.1595859982653; Mon, 27 Jul 2020 07:26:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595859982; cv=none; d=google.com; s=arc-20160816; b=q3DLa/ykQSjo2Sk4OkE7SN2Vu/7xAhB1d120S0Zj8LYUm9lN11iyryc1aKPkjuCGEW EqjAbPDUjUfbqC51OQBDSLp+dVC/H15tCo9QZmRWbLPyr3P1oaSTxrztPz/u4d9W74FI 3JkVY/BzaFbtf8V6qXybQAWqALoT3v3O9dTFoYUfyQ3Jc9sFPtAdrxxpQ8wmQrh4FipK REq94yx2vi3JOYDOrouBzDUXfc05pWaHjMjeO2AT25kziL+XeKax8nvbzh7yjljO7jhg iLcAe441m1PJqnn15pZREkV87uER0GS4gV6Uk1a3GAM6JXemi3dm73n66LVQtpRefQAg 30OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kEInVUc+kKCnn86RCWjGzc9hVZU2+jmotYXCAVX8DqI=; b=evGLk8q47ZyF5PxY3NkM8YMNcyzZas4ExFRDecrulkz/CQSa9HrmkuMYPFUgvsK4Bn mfvv+PBImqUPsX4m5kwmIOum0Yk9WWmcOayMkWuT9EmPBrvLzIB2ig6GHW2YLPFRC9i5 aqlHVt3LY5vspVJ4nagKd6GwQwkTqy9asWTGPJ8XZ3HfscwuvbxErAFQm3qt2VXXNE0M 8hqQK2hwtCf83hOquCL2km55C6RCKG1ADEVLSufmYe2eyZPwVxHMT7IyA3V8ZGI8QYMr jcjWRQDJ7BUGjnrnAcGLIWFdKWmiae6RF5ckzcaG8gZdCYKmKOtr14PNVtfJMyoeS+iO XuwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EDwVuNgO; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x8si2703856ejs.414.2020.07.27.07.26.00; Mon, 27 Jul 2020 07:26:22 -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=@kernel.org header.s=default header.b=EDwVuNgO; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732304AbgG0OYm (ORCPT + 99 others); Mon, 27 Jul 2020 10:24:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:54336 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730144AbgG0OYj (ORCPT ); Mon, 27 Jul 2020 10:24:39 -0400 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 52A672083E; Mon, 27 Jul 2020 14:24:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859878; bh=WIIPYcX+La5dUgPvwyLCdvuORcDgdMxo2o+Zea3h6QU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EDwVuNgOpfMZj54Zzm4moOueVfpJNq4HIZe9dxUGYmFYDB0WRiL/i0D7vkgjX5Uy0 Jg3Q0B06Fc2XSm/+kl8m2vsm9GGTwDvJeiTn3GgC9ou4QORSjW4ffYyMwn0+5+lkiK urdV4eM0LUWANDoPAMgK6xmAa/aANhJL34ZYpngc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chunfeng Yun Subject: [PATCH 5.7 140/179] usb: xhci-mtk: fix the failure of bandwidth allocation Date: Mon, 27 Jul 2020 16:05:15 +0200 Message-Id: <20200727134939.456486086@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@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 commit 5ce1a24dd98c00a57a8fa13660648abf7e08e3ef upstream. The wMaxPacketSize field of endpoint descriptor may be zero as default value in alternate interface, and they are not actually selected when start stream, so skip them when try to allocate bandwidth. Cc: stable Fixes: 0cbd4b34cda9 ("xhci: mediatek: support MTK xHCI host controller") Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1594360672-2076-1-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci-mtk-sch.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/usb/host/xhci-mtk-sch.c +++ b/drivers/usb/host/xhci-mtk-sch.c @@ -557,6 +557,10 @@ static bool need_bw_sch(struct usb_host_ if (is_fs_or_ls(speed) && !has_tt) return false; + /* skip endpoint with zero maxpkt */ + if (usb_endpoint_maxp(&ep->desc) == 0) + return false; + return true; }