public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Francesco Orro <ncesco@interstellar.eu>
Cc: linux-usb@vger.kernel.org, Greg KH <gregkh@linuxfoundation.org>
Subject: Re: [PATCH v7] usb: typec: ucsi: acpi: bootstrap PPM on systems with empty _DSM func 2
Date: Mon, 27 Apr 2026 12:02:37 +0300	[thread overview]
Message-ID: <ae8mLUvhpF4hIrum@kuha> (raw)
In-Reply-To: <20260420172343.84456-1-ncesco@interstellar.eu>

Hi Francesco,

On Mon, Apr 20, 2026 at 07:23:41PM +0200, Francesco Orro wrote:
> On HP ZBook Fury G1i 16 inch (BIOS X96 01.03.04) the SSDT16 "UcsiAcpi"
> exposes a _DSM function 2 (READ) whose body is empty, so UCSI_VERSION
> stays 0x0000 after the read. ucsi_init() treats VERSION=0 as firmware
> absent and bails with -ENODEV, so /sys/class/typec is empty and no
> alt-mode info reaches userspace.
> 
> The PPM is alive: writing UCSI_PPM_RESET through _DSM function 1 (WRITE)
> drives RESET_COMPLETE in CCI. We can therefore bootstrap the PPM
> explicitly on probe when necessary and, once RESET_COMPLETE is observed,
> default VERSION to UCSI 1.2 - which matches the semantics advertised by
> the SSDT tables on this platform.
> 
> The bootstrap checks CCI first and returns early if RESET_COMPLETE is
> already set, to avoid resetting a PPM left in a stable state by
> firmware. Note that this early-return path was not exercised on the
> tested platform: on cold boot CCI did not have RESET_COMPLETE at probe
> time and the PPM_RESET was issued. Consequently, alt-mode state
> negotiated during BIOS POST (in this case a Thunderbolt dock's TBT
> alt-mode) was disrupted at boot. Linux UCSI core later calls
> ucsi_reset_ppm() in ucsi_init() regardless, so the PPM reset on probe
> is arguably not the root cause of the disruption, but the patch leaves
> the door open to avoid the early reset when firmware does leave the
> flag set.
> 
> Bootstrap failure is non-fatal: we log a warning and continue. If the
> PPM later reaches RESET_COMPLETE asynchronously, read_version() still
> recovers via the UCSI_CCI_RESET_COMPLETE check gated by the
> needs_bootstrap flag.
> 
> The behaviour is gated by DMI because unconditionally issuing a
> PPM_RESET on systems whose firmware _does_ populate VERSION correctly
> would be aggressive and unjustified. The DMI match starts with HP ZBook
> Fury G1i 16 inch; other vendors/models can be added as they are
> confirmed.
> 
> Tested on HP ZBook Fury G1i 16 inch Mobile Workstation PC with kernel
> 6.19.13. Before the patch ucsi_acpi probe returns -ENODEV; after the
> patch /sys/class/typec/port{0,1,2} appear with partner altmodes
> exposed when a USB4/TBT device is connected.
> 
> Signed-off-by: Francesco Orro <ncesco@interstellar.eu>
> ---
> Resending: previous send was mangled by quoted-printable encoding.
> No content changes.

Where did you send it? Or do you mean the patch you attached to the
cover-letter? I also can't find v1, v2, v3, v4, v5 or v6 anywhere, so
where did you send them?

In any case, you need to start by reporting these issues to HP.

The version field must return the actual ucsi version, so that really
needs to be fixed this platform. Guessing the version is a really
fragile solution.

In the UCSI specification the behaviour from PPM_RESET is a bit vague
in deed. However, the specification, starting from at least UCSI
1.2, does make a note that the connectors need to be reset separately.
So the connection states of the connectors should not be affected by
PPM_RESET.

thanks,

-- 
heikki

  reply	other threads:[~2026-04-27  9:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-20 16:05 [RFC PATCH] usb: typec: ucsi: acpi: bootstrap PPM on HP systems with empty _DSM func 2 Francesco Orro
2026-04-20 17:23 ` [PATCH v7] usb: typec: ucsi: acpi: bootstrap PPM on " Francesco Orro
2026-04-27  9:02   ` Heikki Krogerus [this message]
2026-04-27  8:39 ` [RFC PATCH] usb: typec: ucsi: acpi: bootstrap PPM on HP " Heikki Krogerus

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=ae8mLUvhpF4hIrum@kuha \
    --to=heikki.krogerus@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=ncesco@interstellar.eu \
    /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