From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFBCB2590 for ; Sun, 22 Jan 2023 15:19:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43E9BC433EF; Sun, 22 Jan 2023 15:19:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1674400757; bh=FX485JoELyltwI6CBgeMkqmSIouASLh9ZMnJCq/TH1I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ty9Q0zkEvHQD2G0qEWrGuFIHQa7UNofwrBP/PEdYzKdBJOxco0tAZh36ApPEUzB9y x9aMOAjmrkf0Og6kDNwoJEV5u90ZuxTLIXYxr4ArmwCb5V/FOGMbfQqlkq8oAtFUKW RvjX/5kyLm7+tgHSdeic9FU43WBlykAm0TLSLs+k= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yehezkel Bernat , Mika Westerberg Subject: [PATCH 5.15 068/117] thunderbolt: Use correct function to calculate maximum USB3 link rate Date: Sun, 22 Jan 2023 16:04:18 +0100 Message-Id: <20230122150235.617270111@linuxfoundation.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230122150232.736358800@linuxfoundation.org> References: <20230122150232.736358800@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Mika Westerberg commit e8ff07fb33026c5c1bb5b81293496faba5d68059 upstream. We need to take minimum of both sides of the USB3 link into consideration, not just the downstream port. Fix this by calling tb_usb3_max_link_rate() instead. Fixes: 0bd680cd900c ("thunderbolt: Add USB3 bandwidth management") Cc: stable@vger.kernel.org Acked-by: Yehezkel Bernat Signed-off-by: Mika Westerberg Signed-off-by: Greg Kroah-Hartman --- drivers/thunderbolt/tunnel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/thunderbolt/tunnel.c +++ b/drivers/thunderbolt/tunnel.c @@ -1262,7 +1262,7 @@ static void tb_usb3_reclaim_available_ba return; } else if (!ret) { /* Use maximum link rate if the link valid is not set */ - ret = usb4_usb3_port_max_link_rate(tunnel->src_port); + ret = tb_usb3_max_link_rate(tunnel->dst_port, tunnel->src_port); if (ret < 0) { tb_tunnel_warn(tunnel, "failed to read maximum link rate\n"); return;