Re: [PATCH] usb: typec: ucsi: log invalid UCSI version of 0

From: Heikki Krogerus

Date: Fri Nov 20 2026 - 10:02:03 EST


On Thu, Nov 19, 2026 at 04:56:59AM +0100, Blake Alexander via B4 Relay wrote:
> From: Blake Alexander <contact@xxxxxxxxxxxxxxxxxxx>
>
> Some devices ship bugged firmware which sets the version of the UCSI
> mailbox to zero. In such cases the ucsi_register() will return -ENODEV
> and the driver will silently fail to bind. There is otherwise no
> indication as to the cause of the probe failure.
>
> While existing (and future) machine-specific workarounds may resolve
> this issue by assuming a known-good UCSI version, future devices or
> older firmware revisions with this issue will still silently fail.
> Both users and developers will benefit from a clear diagnostic message
> when troubleshooting this particular bug.
>
> Add a dev_err() log message when a UCSI version of 0 is reported during
> ucsi_register() hinting towards a potential firmware bug.
>
> Signed-off-by: Blake Alexander <contact@xxxxxxxxxxxxxxxxxxx>
> ---
> Hi,
>
> I have a ThinkPad T14 Gen 2a which is failing to negotiate a DisplayPort
> Alt-Mode connection to a monitor-hub with a USB-C cable.
>
> I spent quite some time troubleshooting the issue and identified the
> root-cause only to find that a patch which fixes this issue was already
> submitted:
> - "[PATCH v2 0/2] usb: typec: acpi: Zero version quirk for Lenovo ThinkPad T14 Gen 2a" <20261103-ucsi-lenovo-t14g2a-v2-0-e85c659b56a2@xxxxxxxxxx>
>
> Similar issues with other laptops have also been recently submitted:
> - "[PATCH] usb: typec: ucsi: acpi: Add quirk for ASUS ROG Zephyrus Duo 16 GX650PI" <20261009-usb-next-v1-1-95a2288ad9b2@xxxxxxxxx>
>
> And existing quirks are also already handled in mainline:
> - Acer Nitro ANV15-41: commit 8c51ea651d04 ("usb: typec: ucsi: acpi:
> Assume UCSI 1.2 on Acer Nitro ANV15-41")
>
> In the hope of saving future developer's time, this patch adds a
> dev_err() log message when the UCSI version register reads zero. The
> log message hints towards a potential firmware bug and gives an
> explicit cause of the driver's probe failure.
>
> Tested on ThinkPad BIOS R1MET65W (1.35), EC R1MHT65W without the
> relevant quirk patches.

Reviewed-by: Heikki Krogerus <heikki.krogerus@xxxxxxxxxxxxxxx>

> ---
> drivers/usb/typec/ucsi/ucsi.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> index 9e453d216c16..fa79ba6dec02 100644
> --- a/drivers/usb/typec/ucsi/ucsi.c
> +++ b/drivers/usb/typec/ucsi/ucsi.c
> @@ -2396,8 +2396,13 @@ int ucsi_register(struct ucsi *ucsi)
> if (ret)
> return ret;
>
> - if (!ucsi->version)
> + /* Version of 0 is not valid but some vendors may report it due to bugged
> + * FW and there may not already be a workaround quirk to correct it.
> + */
> + if (!ucsi->version) {
> + dev_err(ucsi->dev, "UCSI interface reported version 0.0.0: possible firmware bug.");
> return -ENODEV;
> + }
>
> /*
> * Version format is JJ.M.N (JJ = Major version, M = Minor version,
>
> ---
> base-commit: f11fe7603df07fbb9fa02b0d385c1696c87a6dab
> change-id: 20261119-log-ucsi-firmware-quirk-8ffc87c7d42f
>
> Best regards,
> --
> Blake Alexander <contact@xxxxxxxxxxxxxxxxxxx>
>

--
heikki