From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Hans de Goede <johannes.goede@oss.qualcomm.com>
Cc: Andreas Noever <andreas.noever@gmail.com>,
Mika Westerberg <westeri@kernel.org>,
Yehezkel Bernat <YehezkelShB@gmail.com>,
linux-usb <linux-usb@vger.kernel.org>
Subject: Re: "thunderbolt ... (DP): not active, tearing down" error breaking DP over thunderbolt displays
Date: Mon, 26 Oct 2026 16:02:29 +0100 [thread overview]
Message-ID: <20261026150229.GG158991@black.igk.intel.com> (raw)
In-Reply-To: <b0bc482a-f739-4c9b-8eef-9e2634ab2e02@oss.qualcomm.com>
Hi,
On Mon, Oct 26, 2026 at 03:22:06PM +0100, Hans de Goede wrote:
> Hi Mika,
>
> On 26-Oct-26 1:37 PM, Mika Westerberg wrote:
> > Hi,
> >
> > On Mon, Oct 26, 2026 at 11:48:06AM +0100, Hans de Goede wrote:
>
> <snip>
>
> >> p.s.
> >>
> >> We had a similar problem with deferred_probe_timeout handling, see:
> >>
> >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/base/Kconfig?id=56e3ee721b33bdc4ce0765d370983aa4384f8a59
> >>
> >> there this was fixed by making the default timeout value a Kconfig
> >> option and letting distros override it since previous discussions
> >> did not lead to a consensus on how to handle this. But that won't
> >> work here if we want to deal with the "complication with add-in-cards
> >> that don't have all DP INs connected" case.
> >>
> >> I'm mentioning this because it shows there is a generic problem
> >> with this "timeout design pattern" trap us kernel devs seem to
> >> keep falling for, especially in relation to things not happening
> >> in the initramfs while it waits for user input causing all
> >> these timeouts to trigger while they should not trigger yet
> >> because more drivers will load once we switch to the real rootfs.
> >>
> >> This has made me thinking that maybe we need a bootup-done
> >> or at least switched-to-real-rootfs sysfs file userspace can
> >> write and only start timeouts like these once userspace has
> >> written that file?
> >
> > Yes, I think this is the way to go forward. Then something (like
> > notification or callback) that drivers who are interested can opt-in.
>
> I'm glad you like the idea.
>
> There are some details which we need to work out. If we enable this
> unconditionally in the kernel then all timeouts based on this will
> only work if there is a new enough userspace to actually write
>
> "rootfs-mouned" or "bootup-done" to:
>
> /sys/kernel/boot-stage
>
> So my suggestion would be that the initramfs itself will write:
>
> "initramfs" to "/sys/kernel/boot-stage" early on and that activates
> this mechanism pausing any potential timeouts.
I wonder if using SYSTEM_RUNNING and the like here would do the trick? If
not then maybe adding one more state there?
> The problem with this approach though is that this means starting
> the timeouts as before, cancelling them on "initramfs" boot-stage
> and then re-starting them on "rootfs-mouned" or "bootup-done" .
>
> With the cancelling bit feeling a bit icky, although I guess this
> could all be done with the same notifier depending on the notifier
> argument so this might not be too bad...
At least for TB I think we can start with the infinite and then once we get
some "notification" just modify the timeout to now + 12s or so. Not sure
about the other use cases though.
> ###
>
> Once we've an API design we like, the problem becomes who is going
> to write the code for this and lead the attempt to get something
> like this upstream. I'm interested in this, but I also really do not
> have the time to work on this atm.
Yeah, I also don't have time to work on this right now.
prev parent reply other threads:[~2026-10-26 15:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-24 18:17 "thunderbolt ... (DP): not active, tearing down" error breaking DP over thunderbolt displays Hans de Goede
2026-10-26 5:23 ` Mika Westerberg
2026-10-26 10:30 ` Hans de Goede
2026-10-26 10:48 ` Hans de Goede
2026-10-26 12:37 ` Mika Westerberg
2026-10-26 14:22 ` Hans de Goede
2026-10-26 15:02 ` Mika Westerberg [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=20261026150229.GG158991@black.igk.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=YehezkelShB@gmail.com \
--cc=andreas.noever@gmail.com \
--cc=johannes.goede@oss.qualcomm.com \
--cc=linux-usb@vger.kernel.org \
--cc=westeri@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