The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: contact@blakejalexander.com
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: typec: ucsi: log invalid UCSI version of 0
Date: Fri, 20 Nov 2026 15:59:49 +0100	[thread overview]
Message-ID: <awBgZXbIEu-DNHAS@black.igk.intel.com> (raw)
In-Reply-To: <20261119-log-ucsi-firmware-quirk-v1-1-6d42d70a6158@blakejalexander.com>

On Thu, Nov 19, 2026 at 04:56:59AM +0100, Blake Alexander via B4 Relay wrote:
> From: Blake Alexander <contact@blakejalexander.com>
> 
> 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@blakejalexander.com>
> ---
> 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@resetko.pl>
> 
> 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@gmail.com>
> 
> 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@linux.intel.com>

> ---
>  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@blakejalexander.com>
> 

-- 
heikki

      reply	other threads:[~2026-11-20 14:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19  3:56 [PATCH] usb: typec: ucsi: log invalid UCSI version of 0 Blake Alexander via B4 Relay
2026-11-20 14:59 ` Heikki Krogerus [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=awBgZXbIEu-DNHAS@black.igk.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=contact@blakejalexander.com \
    --cc=gregkh@linuxfoundation.org \
    --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