From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.8 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796039152; b=Tkv/GM8cYRpZXiV0bosgGiVxqfr1uY/40m0OhH1yCka9BpgOdF+df/xGhiB3WorFG/6c Sxn+3J3MjKNGMeagRItisUGjSYqM7VghaHnrgoUzo8yOZqD25irbFY4gJYRjXOUM2jWJ6 cmYOVl0NPxjyUT17NTrd8PsQ2JPJOvQ1Gvp9j4qUxAoSIDNLbwNfRDORTZ3TPMFsoUfdp 1wcXHKDh0mvkky1NysFWKUnoXMdf9+Khnc5nIxutWM4pA6F0FCvT7JdlGqRpqgwWehA61 sSClF9azUTAnGTI9GfTGBOJ/nVudysdFAcE2+w/s6h9HtnVFDUTVPAahWe70ggQlgdw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796039152; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Received:Date:From:To: Cc:Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:Content-Transfer-Encoding:In-Reply-To; bh=bSAY/xZFuYc3nDXR7yKVEm1jycwEfQoY9CMIhBap42c=; b=1iUQ1DzCkLs4CXlNovMBX+EKd9qkkp6EpYptQGRirrKd/kptcsmUw7pjqOffw1HtLRu7 RJofVtrL36RdpBClOqa5dSzU//U2fPmXbbFzBAKhTjKqXIE4XSsVdq8V5KfTy7W9/B9Kp d5v9H7XjSTWFmNtS5SDgkKqEnUpF1tW1X3mRp7yeA/8fmlB5BOMR0saVsjoki/wecRhjn wChBxEgghq3pEGDRul1mFHqHKAQZHnW5SV9ApfZFUfeCW56nCFVvBKlcKt/ZG5eyjE0fh tE+Rig+npfQUoPatCRmTPXl5uA4Ol0Ox0GzhEndtYAiSc7+cJJtwyQL7j5y9mejUT5g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b="XX2sbg/X"; arc=none smtp.remote-ip=192.198.163.8 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 33178606A31C for ; Mon, 30 Nov 2026 11:45:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 33178606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=XX2sbg/X DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796039152; x=1827575152; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=bSAY/xZFuYc3nDXR7yKVEm1jycwEfQoY9CMIhBap42c=; b=XX2sbg/XSOYY/usREw4Je7Pyijn4AeJofWTvxtaryZn8m427gN5floOD Ay2j2Y8dHkqgTAbdFvvy9HXbcONVDdy6J8txW9t2gl2a5w42iAXRfxeUk PfquYJTAbDqvYhE91ke1BG8B9wl1sqlZUGEYdVp8XoNi3GUfHyDXj7SFE A3CbMJBF8Z1WvVO/lrHfFx38DYq/CbFc7ltB/BTuJiPHGilDjxPuDuCLs GiSUkX1fCaSEnbk1mUmt50jphkPMtuJf1RM5S76EYI00Z12EmAR20/zj4 P/ZzZ2/AF3/Tj6714xp3Iz4Hgl8AsRfxLRPWrHZSnYRnD8qOqHFu5L9Fj A==; X-CSE-ConnectionGUID: JgkAm2yfTWGnJmECq4qa7A== X-CSE-MsgGUID: DH/rHVhpTo+GCn1BDcnQHw== X-IronPort-AV: E=McAfee;i="6800,10657,11981"; a="4746124" X-IronPort-AV: E=Sophos;i="6.27,242,1787036400"; d="scan'208";a="4746124" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2026 03:45:47 -0800 X-CSE-ConnectionGUID: 3uUtVlbTT6eX1coIG3yQsQ== X-CSE-MsgGUID: zfJrXz7cSvaspu2Tb42tcg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,242,1787036400"; d="scan'208";a="12699161" Received: from black.igk.intel.com ([10.91.253.5]) by orviesa008.jf.intel.com with ESMTP; 30 Nov 2026 03:45:46 -0800 Received: by black.igk.intel.com (Postfix, from userid 1001) id BDADB98; Mon, 30 Nov 2026 12:45:44 +0100 (CET) Date: Mon, 30 Nov 2026 12:45:44 +0100 From: Mika Westerberg To: mrmrossi@proton.me Cc: Mika Westerberg , Andreas Noever , Yehezkel Bernat , "linux-usb@vger.kernel.org" Subject: Re: thunderbolt: second DP tunnel permanently reduced while first tunnel's DPRX read is pending (tiled 5K display comes up split) Message-ID: <20261130114544.GI953667@black.igk.intel.com> References: <_0_W0GHFt6viW8yCcgiCp8r9tge7rTvTPnOWoLaqMZfWLzjJVv2XlmzCibmFiJEkEzi67jJFy7RlLlnExGlpmXny7E_BKiCrDZfg3Fm53y4=@proton.me> X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <_0_W0GHFt6viW8yCcgiCp8r9tge7rTvTPnOWoLaqMZfWLzjJVv2XlmzCibmFiJEkEzi67jJFy7RlLlnExGlpmXny7E_BKiCrDZfg3Fm53y4=@proton.me> Hi, On Sat, Nov 28, 2026 at 05:01:59PM +0000, mrmrossi@proton.me wrote: > Hi, > first of all, this is a report Claude created, had a quick review and it looks legit so I decided to report as the workaround actually fixed the issue. Thanks for reporting! > Here you have it: > > On an Alder Lake laptop with an LG UltraWide 5K (Thunderbolt 3, tiled > 2x1, two SST DP streams), the second DP tunnel is often reduced to HBR x4 > when the monitor connects. The right tile then comes up with a different > link rate and bpp than the left one, i915 does not enable transcoder port > sync for the tile group, and the picture is split and flickering until > the next replug. Roughly 3 out of 5 replugs fail. > > Hardware / software > ------------------- > - Lenovo ThinkPad X1 Carbon Gen 10, Alder Lake-P Iris Xe [8086:46a6], i915 > - LG UltraWide 5K, TB3 device vendor=0x1e device=0x1112, connected directly > - Thunderbolt link 20 Gb/s x2, software connection manager > - Kernel 7.3.4 and 7.3.6 (Fedora 45, no Fedora patches to >   drivers/thunderbolt); also seen on 7.3.4 Fedora 44 > - Happens with both bw_alloc_mode=1 (default) and bw_alloc_mode=0 Yes BW alloc mode is only supported starting from Meteor Lake so your system does not have it. It was specifically added to fix issues like this. > Root cause > ---------- > When tunnel 2 is set up before tunnel 1's DPRX capability read has > completed, tunnel 1 is accounted at the full DP IN/OUT capability (HBR3 x4 > = 25920 Mb/s), although the sink only does HBR2 x4. Tunnel 2 gets the > remaining 10080 Mb/s and is reduced to HBR x4. Once the DPRX read > completes, tunnel 1 drops to 17280 Mb/s and ~18.7 Gb/s is free again, but > tunnel 2 is never re-expanded. Yes this is by design by the "legacy" CM. If you have 2 cables connected to the monitor, one workaround is to plug them in one at the time. The CM cannot know beforehand what are the actual DPRX capabilities until the graphics driver has done the caps exchange. > Failing sequence (thunderbolt.dyndbg=+p, bw_alloc_mode=0): > >   0:5 <-> 1:10 (DP): activating >   0:5 <-> 1:10 (DP): DPRX read timeout >   0:5 <-> 1:10 (DP): consumed bandwidth 0/25920 Mb/s >   available bandwidth for new DP tunnel 36000/10080 Mb/s >   0:6 <-> 1:11 (DP): activating >   0:6 <-> 1:11 (DP): bandwidth reduced to 2700 Mb/s x4 = 8640 Mb/s >   0:5 <-> 1:10 (DP): DPRX capabilities read completed >   0:5 <-> 1:10 (DP): consumed bandwidth 0/17280 Mb/s >   0:6 <-> 1:11 (DP): DPRX read timeout >   0:6 <-> 1:11 (DP): consumed bandwidth 0/8640 Mb/s > > Good sequence (DPRX of tunnel 1 completed first): > >   0:5 <-> 1:10 (DP): consumed bandwidth 0/17280 Mb/s >   available bandwidth for new DP tunnel 36000/18720 Mb/s >   0:6 <-> 1:11 (DP): activating >   0:6 <-> 1:11 (DP): bandwidth reduced to 5400 Mb/s x4 = 17280 Mb/s > > Five consecutive replugs: > >   time      tunnel 1 at tunnel 2 setup   avail. for t2   t2 reduced to   result >   19:29:34  DPRX done (17280)            18720           5400 x4         OK >   19:30:25  DPRX timeout (25920)         10080           2700 x4         split >   19:31:03  DPRX timeout (25920)         10080           2700 x4         split >   19:31:26  DPRX done (17280)            18720           5400 x4         OK >   19:32:00  DPRX timeout (25920)         10080           2700 x4         split > > Effect on i915 (drm.debug=0x116) > -------------------------------- > Split case: the DP-4 sink reports MAX_LINK_RATE 0x0a instead of 0x14. > >   DPCD DP-3 (TC3): 12 14 c4 01 01 00 01 00 02 02 06 00 00 00 04 >   DPCD DP-4 (TC4): 12 0a c4 01 01 00 01 00 02 02 06 00 00 00 04 > >   pipe B (DP-3): link 4x540000, pipe bpp 30, >                  port sync: master transcoder: , slave transcoder bitmask = 0x0 >   pipe C (DP-4): DP link limits ... max link 4x270000, pipe bpp 24, >                  port sync: master transcoder: , slave transcoder bitmask = 0x0 > > Good case: both tiles at 4x540000 and pipe bpp 30, and port sync is > enabled (pipe B slave bitmask 0x4, pipe C master transcoder B). > > Workaround tested > ----------------- > Capping the bandwidth a new DP tunnel may reserve, in tb_tunnel_one_dp() > right after tb_available_bandwidth(), to 17280 Mb/s (HBR2 x4) fixes it. > Tunnel 1 is then reduced to HBR2 x4 straight away, so it is accounted at > 17280 Mb/s even while its DPRX read is pending, and tunnel 2 always gets > HBR2 x4: > >   available bandwidth for new DP tunnel 17280/17280 Mb/s >   0:5 <-> 1:11 (DP): bandwidth reduced to 5400 Mb/s x4 = 17280 Mb/s >   available bandwidth for new DP tunnel 17280/17280 Mb/s >   0:6 <-> 1:10 (DP): bandwidth reduced to 5400 Mb/s x4 = 17280 Mb/s > > This was correct on 5 out of 5 replugs. The cap is from the out-of-tree > patch at https://github.com/mdimura/thunderbolt-dpcap-dkms, which > describes the same race with two 4K monitors on a TB4 dock. It is only a > workaround, though. A real fix would be to wait for the pending DPRX read > before sizing the next tunnel, or to re-expand a reduced tunnel once the > real consumption of the others is known. This adds a new command line option which for starters is no-go unfortunately. I do have internal series that adds BPF support to the driver so userspace can cap the available bandwidth dynamically through a BFP hook but it's still work-in-progress. I think that would help in your case. But I'm quite busy atm so that is kind of low priority.