Message ID | 20240408123550.4178338-2-mika.westerberg@linux.intel.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 6016137a964b67a6ac8afb9071ef6e83777afca6 |
Headers | show |
Series | [1/2] thunderbolt: Avoid notify PM core about runtime PM resume | expand |
On Mon, Apr 08, 2024 at 03:35:50PM +0300, Mika Westerberg wrote: > From: Gil Fine <gil.fine@linux.intel.com> > > Currently, when setup a new USB3 tunnel that is starting from downstream USB3 > adapter of first depth router (or deeper), to upstream USB3 adapter of a second > depth router (or deeper), we calculate consumed bandwidth. For this calculation > we take into account first USB3 tunnel consumed bandwidth while we shouldn't, > because we just recalculating the first USB3 tunnel allocated bandwidth. > > Fix that, so that more bandwidth is available for the new USB3 tunnel being > setup. > > While there, fix the kernel-doc to decribe more accurately the purpose of the > function. > > Signed-off-by: Gil Fine <gil.fine@linux.intel.com> > Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Please disregard both. I sent a wrong patch with the first one. I'll re-send with correct patches, sorry.
diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c index 3e44c78ac409..10e719dd837c 100644 --- a/drivers/thunderbolt/tb.c +++ b/drivers/thunderbolt/tb.c @@ -498,8 +498,9 @@ static struct tb_tunnel *tb_find_first_usb3_tunnel(struct tb *tb, * @consumed_down: Consumed downstream bandwidth (Mb/s) * * Calculates consumed USB3 and PCIe bandwidth at @port between path - * from @src_port to @dst_port. Does not take tunnel starting from - * @src_port and ending from @src_port into account. + * from @src_port to @dst_port. Does not take USB3 tunnel starting from + * @src_port and ending on @src_port into account because that bandwidth is + * already included in as part of the "first hop" USB3 tunnel. */ static int tb_consumed_usb3_pcie_bandwidth(struct tb *tb, struct tb_port *src_port, @@ -514,8 +515,8 @@ static int tb_consumed_usb3_pcie_bandwidth(struct tb *tb, *consumed_up = *consumed_down = 0; tunnel = tb_find_first_usb3_tunnel(tb, src_port, dst_port); - if (tunnel && tunnel->src_port != src_port && - tunnel->dst_port != dst_port) { + if (tunnel && !tb_port_is_usb3_down(src_port) && + !tb_port_is_usb3_up(dst_port)) { int ret; ret = tb_tunnel_consumed_bandwidth(tunnel, consumed_up,