public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
	"Chia-Lin Kao (AceLan)" <acelan.kao@canonical.com>
Cc: "Chen, Antony" <antony.chen@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Fedor Pchelkin <boddah8794@gmail.com>,
	Andrei Kuchynski <akuchynski@chromium.org>,
	Venkat Jayaraman <venkat.jayaraman@intel.com>,
	Myrrh Periwinkle <myrrhperiwinkle@qtmlabs.xyz>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: typec: ucsi: Detect and skip duplicate altmodes from buggy firmware
Date: Fri, 31 Oct 2025 15:31:46 +0200	[thread overview]
Message-ID: <aQS6QhE1L7aLKhJN@kuha.fi.intel.com> (raw)
In-Reply-To: <66gkc32hdbzdxpnx3r56bfzt4znw6xj7m3j6363mus4nf47kf6@3f2hj5qwsb46>

Hi Chia-Lin,

Mon, Oct 20, 2025 at 12:36:51PM +0300, Dmitry Baryshkov kirjoitti:
> On Mon, Oct 20, 2025 at 12:18:31PM +0300, Heikki Krogerus wrote:
> > +Antony
> > 
> > On Thu, Oct 16, 2025 at 01:53:32PM +0800, Chia-Lin Kao (AceLan) wrote:
> > > Some firmware implementations incorrectly return the same altmode
> > > multiple times at different offsets when queried via UCSI_GET_ALTERNATE_MODES.
> > > This causes sysfs duplicate filename errors and kernel call traces when
> > > the driver attempts to register the same altmode twice:
> > > 
> > >   sysfs: cannot create duplicate filename '/devices/.../typec/port0/port0.0/partner'
> > >   typec-thunderbolt port0-partner.1: failed to create symlinks
> > >   typec-thunderbolt port0-partner.1: probe with driver typec-thunderbolt failed with error -17
> > > 
> > > Detect duplicate altmodes by comparing SVID and VDO before registration.
> > > If a duplicate is detected, skip it and print a single clean warning
> > > message instead of generating a kernel call trace:
> > > 
> > >   ucsi_acpi USBC000:00: con0: Firmware bug: duplicate partner altmode SVID 0x8087 at offset 1, ignoring. Please update your system firmware.
> > > 
> > > This makes the error handling more user-friendly while still alerting
> > > users to the firmware bug.
> > > 
> > > The fix applies to all three recipient types: partner (SOP), port (CON),
> > > and plug (SOP_P) altmodes.
> > > 
> > > Fixes: a79f16efcd00 ("usb: typec: ucsi: Add support for the partner USB Modes")
> > > Cc: stable@vger.kernel.org
> > > Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
> > 
> > Thank you for the patch. Before going forward with this, I would like
> > to make sure that Dell is not using the GET_ALTERNATE_MODES command in
> > some customised way deliberately, and that this really is a bug in the
> > EC firmware.
> 
> 
> Just to point out, we have had a similar issue with Lenovo Yoga c630,
> see yoga_c630_ucsi_update_altmodes(), the EC was ignoring offset field.

I think we can reuse that function like Dmitry pointed out. Can you
check that?

thanks,

-- 
heikki

  reply	other threads:[~2025-10-31 13:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-16  5:53 [PATCH] usb: typec: ucsi: Detect and skip duplicate altmodes from buggy firmware Chia-Lin Kao (AceLan)
2025-10-20  9:18 ` Heikki Krogerus
2025-10-20  9:36   ` Dmitry Baryshkov
2025-10-31 13:31     ` Heikki Krogerus [this message]
2025-10-28 14:33 ` Greg Kroah-Hartman

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=aQS6QhE1L7aLKhJN@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=acelan.kao@canonical.com \
    --cc=akuchynski@chromium.org \
    --cc=antony.chen@intel.com \
    --cc=boddah8794@gmail.com \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=myrrhperiwinkle@qtmlabs.xyz \
    --cc=venkat.jayaraman@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