summaryrefslogtreecommitdiffstats
path: root/drivers/thunderbolt/tb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thunderbolt/tb.c')
-rw-r--r--drivers/thunderbolt/tb.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c
index 983b58d66096..1b379e9487b9 100644
--- a/drivers/thunderbolt/tb.c
+++ b/drivers/thunderbolt/tb.c
@@ -602,6 +602,7 @@ static int tb_available_bandwidth(struct tb *tb, struct tb_port *src_port,
/* Find the minimum available bandwidth over all links */
tb_for_each_port_on_path(src_port, dst_port, port) {
int link_speed, link_width, up_bw, down_bw;
+ int pci_reserved_up, pci_reserved_down;
if (!tb_port_is_null(port))
continue;
@@ -695,6 +696,16 @@ static int tb_available_bandwidth(struct tb *tb, struct tb_port *src_port,
up_bw -= usb3_consumed_up;
down_bw -= usb3_consumed_down;
+ /*
+ * If there is anything reserved for PCIe bulk traffic
+ * take it into account here too.
+ */
+ if (tb_tunnel_reserved_pci(port, &pci_reserved_up,
+ &pci_reserved_down)) {
+ up_bw -= pci_reserved_up;
+ down_bw -= pci_reserved_down;
+ }
+
if (up_bw < *available_up)
*available_up = up_bw;
if (down_bw < *available_down)