From: Gil Fine <gil.fine@linux.intel.com>
To: mika.westerberg@linux.intel.com
Cc: gil.fine@intel.com, gil.fine@linux.intel.com, stable@vger.kernel.org
Subject: [PATCH v2 1/3] thunderbolt: Do not set up a DisplayPort tunnel when credits are insufficient
Date: Thu, 17 Sep 2026 01:57:53 +0300 [thread overview]
Message-ID: <20260916225755.45127-1-gil.fine@linux.intel.com> (raw)
Currently, an excessive DisplayPort tunnel may be set up, even if no
sufficient credits available. This could lead to malfunctioning
DisplayPort tunnel.
Fix this and bail out early if this is the case.
Fixes: 6ed541c53edc ("thunderbolt: Allocate credits according to router preferences")
Cc: stable@vger.kernel.org
Signed-off-by: Gil Fine <gil.fine@linux.intel.com>
Assisted-by: LLM
---
drivers/thunderbolt/tunnel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/thunderbolt/tunnel.c b/drivers/thunderbolt/tunnel.c
index c0342b1d6a8a..7a033df7f916 100644
--- a/drivers/thunderbolt/tunnel.c
+++ b/drivers/thunderbolt/tunnel.c
@@ -1582,7 +1582,7 @@ static int tb_dp_init_video_credits(struct tb_path_hop *hop)
*/
nfc_credits = port->config.nfc_credits &
ADP_CS_4_NFC_BUFFERS_MASK;
- if (nfc_credits / sw->min_dp_main_credits > max_dp_streams)
+ if (nfc_credits / sw->min_dp_main_credits >= max_dp_streams)
return -ENOSPC;
hop->nfc_credits = sw->min_dp_main_credits;
--
2.43.0
next reply other threads:[~2026-09-16 22:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 22:57 Gil Fine [this message]
2026-09-16 22:57 ` [PATCH v2 2/3] thunderbolt: Fix DMA credit limit to use host router value Gil Fine
2026-09-17 6:19 ` Mika Westerberg
2026-09-16 22:57 ` [PATCH v2 3/3] thunderbolt: Fix credits reservation logic for DisplayPort tunnels Gil Fine
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260916225755.45127-1-gil.fine@linux.intel.com \
--to=gil.fine@linux.intel.com \
--cc=gil.fine@intel.com \
--cc=mika.westerberg@linux.intel.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox