From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: 李佳怡 <lijiayi@kylinos.cn>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
jiayi_dec@163.com
Subject: Re: [PATCH RFC] thunderbolt: Re-add DP resources on resume
Date: Thu, 18 Sep 2025 18:20:59 +0200 [thread overview]
Message-ID: <20250918162059.GL2912318@black.igk.intel.com> (raw)
In-Reply-To: <f0a04f70-5539-42bd-ac15-07054878acfb@kylinos.cn>
Hi,
On Thu, Sep 18, 2025 at 04:34:31PM +0800, 李佳怡 wrote:
>
>
> 在 2025/9/17 20:50, Mika Westerberg 写道:
> > On Wed, Sep 17, 2025 at 06:12:31PM +0800, 李佳怡 wrote:
> > >
> > > As requested, I've attached the complete dmesg output (from boot to after
> > > resume) reproducing the issue.
> > >
> > > Testing Methodology:
> > > 1. Start with the Targus Thunderbolt dock already connected to the system
> > > 2. Enter S3 suspend (sleep) with no DP monitor connected to the dock
> > > 3. Resume from S3
> > > 4. After the system has fully resumed, connect the DP monitor to the dock
> >
> > Thanks! It is badly line wrapped. I wonder if you can just attach it?
> > Anyways I found some unexpected things there:
> >
> > > [ 8.647850] With USB4 patch v1.0.0
> >
> > What is this? ;-)
>
> Thanks for your help!
>
> This is a self-compiled kernel based on version 5.4 with backported
> Thunderbolt drivers. I will also attach the kernel log from a build using
> the linux-6.6.y branch of the community linux-stable repository.
Okay but I really suggest using more recent kernel. 6.16 is current stable
so that would be good.
> > > [ 8.647860] ACPI: bus type thunderbolt registered
> > > [ 8.664660] [7] nhi_probe:1326: thunderbolt 0000:2c:00.0: total paths: 21
> > > [ 8.665209] [7] tb_ring_alloc:586: thunderbolt 0000:2c:00.0: allocating
> > > TX ring 0 of size 10
> > > [ 8.665243] [7] tb_ring_alloc:586: thunderbolt 0000:2c:00.0: allocating
> > > RX ring 0 of size 10
> > > [ 8.665267] [7] tb_ctl_alloc:665: thunderbolt 0000:2c:00.0: control
> > > channel created
> > > [ 8.665272] [7] icm_probe:2549: thunderbolt 0000:2c:00.0: ICM not
> > > supported on this controller
> > > [ 8.665285] [7] tb_ring_free:840: thunderbolt 0000:2c:00.0: freeing RX
> > > ring 0
> > > [ 8.665294] [7] tb_ring_free:840: thunderbolt 0000:2c:00.0: freeing TX
> > > ring 0
> >
> > What is this?
> >
> > Is this Intel TB/USB4 controller or something else? All USB4 compliant
> > controllers should go directly to tb.c as that's the part dealing with
> > software connection manager. The above looks like it tries first with the
> > firmware connection manager and that should not happen outside of Intel
> > Thunderbolt 3 hosts.
>
> Yes, there is a mistake. I discovered that during the USB4_NATIVE_CONTROL
> negotiation in the firmware, an OSC_CAPABILITIES_MASK_ERROR bit was being
> set incorrectly, which should not have happened.
>
> The log I will attach next has been modified to fix this issue.
[..]
> [ 0.498976] [1] tb_switch_reset:1666: thunderbolt 0000:2c:00.0: 0: resetting
> [ 0.533329] [1] tb_add_dp_resources:217: thunderbolt 0000:2c:00.0: 0:10: DP IN resource available
> [ 0.533959] [1] tb_add_dp_resources:217: thunderbolt 0000:2c:00.0: 0:11: DP IN resource available
The DP IN resources were added here.
[..]
> [ 19.035726] [171] tb_switch_set_wake:3445: thunderbolt 0000:2c:00.0: 0: enabling wakeup: 0x3f
> [ 19.037401] [171] tb_ring_stop:768: thunderbolt 0000:2c:00.0: stopping RX ring 0
> [ 19.037412] [171] ring_interrupt_active:141: thunderbolt 0000:2c:00.0: disabling interrupt at register 0x38200 bit 21 (0x200001 -> 0x1)
> [ 19.037439] [171] tb_ring_stop:768: thunderbolt 0000:2c:00.0: stopping TX ring 0
> [ 19.037449] [171] ring_interrupt_active:141: thunderbolt 0000:2c:00.0: disabling interrupt at register 0x38200 bit 0 (0x1 -> 0x0)
> [ 19.037463] [171] tb_ctl_stop:733: thunderbolt 0000:2c:00.0: control channel stopped
Runtime suspend.
(and a couple more)
> [ 266.399800] [3870] tb_ctl_start:703: thunderbolt 0000:2c:00.0: control channel starting...
> [ 266.399808] [3870] tb_ring_start:693: thunderbolt 0000:2c:00.0: starting TX ring 0
> [ 266.399821] [3870] ring_interrupt_active:141: thunderbolt 0000:2c:00.0: enabling interrupt at register 0x38200 bit 0 (0x0 -> 0x1)
> [ 266.399826] [3870] tb_ring_start:693: thunderbolt 0000:2c:00.0: starting RX ring 0
> [ 266.399837] [3870] ring_interrupt_active:141: thunderbolt 0000:2c:00.0: enabling interrupt at register 0x38200 bit 21 (0x1 -> 0x200001)
> [ 266.399848] [3870] tb_switch_resume:3478: thunderbolt 0000:2c:00.0: 0: resuming switch
> [ 266.399852] [3870] tb_switch_configure:2590: thunderbolt 0000:2c:00.0: restoring Switch at 0x0 (depth: 0, up port: 5)
> [ 266.400032] [3870] tb_switch_set_wake:3447: thunderbolt 0000:2c:00.0: 0: disabling wakeup
Around this time you should see the hotplug events coming to the DP IN
adapters. But there is none.
There is a bit in the DP adapter config space (DHP) that can be used to
disable this but the spec says it defaults to 0. Anyways I suggest to check
that (and also the Plugged bit). You can dump these using tbtools [1]. Let
me know if you want help with that.
BTW, what is the device vendor? This is not Intel TB/USB4 controller so I'm
curious what is it :)
[1] https://github.com/intel/tbtools
next prev parent reply other threads:[~2025-09-18 16:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-17 8:24 [PATCH RFC] thunderbolt: Re-add DP resources on resume Jiayi Li
2025-09-17 8:36 ` Mika Westerberg
2025-09-17 10:12 ` 李佳怡
2025-09-17 12:50 ` Mika Westerberg
2025-09-18 8:34 ` 李佳怡
2025-09-18 16:20 ` Mika Westerberg [this message]
2025-09-18 16:43 ` Mika Westerberg
2025-09-19 7:24 ` 李佳怡
2025-09-19 7:30 ` Mika Westerberg
2025-09-19 8:00 ` 李佳怡
2025-09-19 8:41 ` Mika Westerberg
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=20250918162059.GL2912318@black.igk.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=jiayi_dec@163.com \
--cc=lijiayi@kylinos.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@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