Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4517135rwb; Tue, 6 Sep 2022 08:34:33 -0700 (PDT) X-Google-Smtp-Source: AA6agR4np0j1XVWxS6j4321cRD/k1xO+77ok3Y9VwHjN/DMvIlP7i6wkiLQ5DMlpOQj417hyqcf0 X-Received: by 2002:a17:902:eb8e:b0:176:66bf:f350 with SMTP id q14-20020a170902eb8e00b0017666bff350mr21805199plg.111.1662478473571; Tue, 06 Sep 2022 08:34:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662478473; cv=none; d=google.com; s=arc-20160816; b=qMMdHKHr4SHmM4zUbshJ9L8eak7tbIbUZHxRStGn/D0EbWVeOSoLhXXhKF5EDgVNX3 A7VKOeUSPaEQJvfny7nPxxRzih1bu0Xsuw0xzMO/uWUsXMZZlL4u/sbP6CEXzEfLXp64 JSgXXhZ29bVy0nAPblMOcJhnhas+tybZjFxwskTHse63MW4nYRHmUyVrtEukEr4Juze6 Oj78Yk9F3qaaAGHf/45z8v/BBAPdNYpWAYd2xhOYXlELuxDtR9rbq7+wWBT/ZWV5zqLR S3RHHhD0bJCqoWWaA1UzWe2707t2yqTijVF3DTTE0UhCsbzLlepkczovbwof7YNpiUDX t+gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BwXnHhjkMoEXYo2sJ6PAh+IjCIgzVgi4dBoPTKmivv0=; b=vKWu/JPc3QiWD5G2k4oC5v+L9UUYk+XYJrn3alQYn0lhCBLyIu8Yagf6e8T+ni+Och UtRMkRbX/UqXhUGx5QpoXphQDquRW99lzSGOt747fCiZz/1jmvVeURoevXNuaLfgZG63 E2yVFAbOYVNJMQ0a3Hq6yvCR6ur5TRIsByOISS5HXK4u+LImn/bX4yk32yNULWDFpWx8 ZMXmExSRQU7++/aW0z1XkWCa5AT6ubfHM4rncXpcNOjC9qCsJDrFHwy4Kg9sUlGp7vn8 CDLklrCTTQ4MbVi91tRxTK3TfzHCN/wsjOvR2GCYN7qsW4SHby777mcFLHAExs2ek/KZ QXqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PMifvAYk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l15-20020a170902f68f00b0017492fb90b0si3140793plg.182.2022.09.06.08.34.21; Tue, 06 Sep 2022 08:34:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PMifvAYk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241447AbiIFORj (ORCPT + 99 others); Tue, 6 Sep 2022 10:17:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241345AbiIFOOd (ORCPT ); Tue, 6 Sep 2022 10:14:33 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5942589CC5; Tue, 6 Sep 2022 06:49:06 -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 ams.source.kernel.org (Postfix) with ESMTPS id B53CEB81633; Tue, 6 Sep 2022 13:49:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 235D0C433C1; Tue, 6 Sep 2022 13:49:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662472144; bh=zqlNWF+2JGJyrjopq1lcXdx0AGbXWOqhLsdebqeXw0s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PMifvAYk2BQjkvY3A7TjY2ycX0auG7bkeIfbcYpKncxauMbPuhsNZngJiQJ/8qeS8 fI/utplG2bVIFYCPvDXWlql4BJ2ADzC4y0gLV6i5YniRDoDkfeIRvU/1IE3RBwcN2C Z3OX/+C/Jbea0m8nVe+A/kkpiluejKjnlxAcuKq0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable , Chunfeng Yun Subject: [PATCH 5.19 132/155] usb: xhci-mtk: fix bandwidth release issue Date: Tue, 6 Sep 2022 15:31:20 +0200 Message-Id: <20220906132835.045596787@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220906132829.417117002@linuxfoundation.org> References: <20220906132829.417117002@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chunfeng Yun commit 6020f480004a80cdad4ae5ee180a231c4f65595b upstream. This happens when @udev->reset_resume is set to true, when usb resume, the flow as below: - hub_resume - usb_disable_interface - usb_disable_endpoint - usb_hcd_disable_endpoint - xhci_endpoint_disable // it set @ep->hcpriv to NULL Then when reset usb device, it will drop allocated endpoints, the flow as below: - usb_reset_and_verify_device - usb_hcd_alloc_bandwidth - xhci_mtk_drop_ep but @ep->hcpriv is already set to NULL, the bandwidth will be not released anymore. Due to the added endponts are stored in hash table, we can drop the check of @ep->hcpriv. Fixes: 4ce186665e7c ("usb: xhci-mtk: Do not use xhci's virt_dev in drop_endpoint") Cc: stable Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20220819080556.32215-2-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci-mtk-sch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/usb/host/xhci-mtk-sch.c +++ b/drivers/usb/host/xhci-mtk-sch.c @@ -764,8 +764,8 @@ int xhci_mtk_drop_ep(struct usb_hcd *hcd if (ret) return ret; - if (ep->hcpriv) - drop_ep_quirk(hcd, udev, ep); + /* needn't check @ep->hcpriv, xhci_endpoint_disable set it NULL */ + drop_ep_quirk(hcd, udev, ep); return 0; }