mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: An Wu <an.wu@canonical.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: andreas.noever@gmail.com, michael.jamet@intel.com,
	YehezkelShB@gmail.com, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Anthony Wong <anthony.wong@canonical.com>
Subject: Re: [PATCH] thunderbolt: Defer DP tunnel teardown until display driver is ready
Date: Thu, 16 Jul 2026 13:31:58 -0500	[thread overview]
Message-ID: <bc7c80ab-4604-45d3-862e-6b7d0a2ea723@amd.com> (raw)
In-Reply-To: <CAO4Mv0YdUm_36fJWrvqtGDp6nsQHJFteh_TKFjM31Exygj2-4w@mail.gmail.com>

Hi,

I had a few thoughts while reading this thread I wanted to share.

1) Ubuntu builds the initramfs locally with dracut.

It should be possible to know at the time of building the initramfs 
which hardware is actually on the system and only include the modules 
you need to avoid this issue.

For example if you're on an I+N system you can avoid amdgpu and if 
you're on a pure I system you could avoid nouveau and amdgpu.  Does that 
help the size concerns for the initramfs?

2) Do you really need thunderbolt.ko in the initramfs for keyboards and 
the like to work?

I don't think so.  I thought x86 UEFI laptops have a pre-OS connection 
manager that will remain resident until the OS connection manager takes 
over.  I know this is the case for AMD, and I think this also applies to 
Intel.

3) Are you including boltd in the initramfs?

If not; you have a secondary problem you might not realize that defeats 
your entire goal of having USB keyboard connected to a dock working 
during LUKS.

If the keyboard is connected to a USB3 controller behind a TBT3 
controller the USB4 router topology gets reset when thunderbolt.ko 
loads.  This is because the firmware often doesn't reserve enough memory 
for hotpluggable PCIe devices.  Linux resets it and assigns enough 
memory for this to work.  This is the same thing that Windows does.

Well after that reset happens the TBT3 device won't be authorized 
meaning any PCIe topology behind it isn't authorized.  At runtime this 
is solved by boltd checking that the IOMMU is enabled (and was enabled 
Pre-BOO) in order to authorize the topology.

I've raised something about this in the past, but AFAICT no one in 
Ubuntu looked at it.

https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/2078573

4) This patch may have been dropped upstream, but I still see it 
included in Ubuntu's kernel.

https://lists.ubuntu.com/archives/kernel-team/2026-June/168287.html

What happens with NPI hardware that doesn't have a display driver ready? 
  It seems like this is going to cause thunderbolt.ko to infinitely 
reschedule work looking for one, wasting CPU cycles and otherwise 
blocking CPU low power states.

Thus I don't think this is very good tech debt to adopt in Ubuntu's 
kernel when there are other technical solutions available to consider.

On 6/5/26 05:16, An Wu wrote:
> Hi Mika
>      After further consideration, we've decided to drop this patch and
> probably to note it as limitation. Really appreciate your patience and
> sorry for the noise.
> 
> BR
>      An
> 
> On Mon, Jun 1, 2026 at 4:18 PM An Wu <an.wu@canonical.com> wrote:
>>
>> Hi Mika
>>      We tried putting graphic modules into initramfs and the size
>> increased from 56 MB to over 200 MB. We will discuss with the team the
>> possibility of fixing this in userspace and follow up once we have a
>> clearer picture.
>> Really appreciate your time and patience.
>>
>> BR
>>      An
>>
>> On Mon, Jun 1, 2026 at 3:04 PM Mika Westerberg
>> <mika.westerberg@linux.intel.com> wrote:
>>>
>>> Hi,
>>>
>>> On Mon, Jun 01, 2026 at 02:50:21PM +0800, An Wu wrote:
>>>> Hi Mika
>>>>
>>>> Another approach I considered is using register_module_notifier() to
>>>> detect when a display driver module is loaded, then retrigger the DP
>>>> tunnel setup. However, since struct module does not carry any device
>>>> class or subsystem metadata, there is no generic way to identify
>>>> whether a loaded module is a display driver. We would need to maintain
>>>> a hardcoded list of known GPU module names (i915, xe, amdgpu, etc.),
>>>> which is fragile and not scalable.
>>>
>>> Indeed. Perhaps not to try to solve this in the kernel and instead do this
>>> in userspace?
>>>
>>> Have you actually measured how much initramfs size "increases" if you do
>>> include the relevant graphics drivers and their dependencies?
> 


      reply	other threads:[~2026-07-16 18:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-27  6:41 [PATCH 0/1] " ChunAn Wu
2026-05-27  6:41 ` [PATCH] " ChunAn Wu
2026-05-27  7:14   ` Mika Westerberg
2026-05-28  1:03     ` An Wu
2026-05-28 10:29       ` Mika Westerberg
2026-06-01  2:45         ` An Wu
2026-06-01  6:50           ` An Wu
2026-06-01  7:04             ` Mika Westerberg
2026-06-01  8:18               ` An Wu
2026-06-05 10:16                 ` An Wu
2026-07-16 18:31                   ` Mario Limonciello [this message]

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=bc7c80ab-4604-45d3-862e-6b7d0a2ea723@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=YehezkelShB@gmail.com \
    --cc=an.wu@canonical.com \
    --cc=andreas.noever@gmail.com \
    --cc=anthony.wong@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=michael.jamet@intel.com \
    --cc=mika.westerberg@linux.intel.com \
    /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

Powered by JetHome