Re: [PATCH] usb: typec: ucsi: Leave the mux to the altmode driver for alt mode partners

From: Heikki Krogerus

Date: Fri Nov 06 2026 - 11:46:44 EST


On Tue, Nov 03, 2026 at 10:50:46PM +0900, Joonhoe Kim wrote:
> Commit 25a2bc21c863 ("usb: typec: ucsi: call typec_set_mode on
> non-altmode partner change") set TYPEC_STATE_USB only when the partner
> flags were exactly USB, so that the altmode drivers set up the
> switches, muxes and retimers for alt mode partners. Commit 226ff2e681d0
> ("usb: typec: ucsi: Convert connector specific commands to bitmaps")
> turned that into a test of the USB bit alone, so a partner that
> reports both USB and alt mode now gets TYPEC_STATE_USB as well.
>
> On pmic_glink platforms the altmode driver programs the same mux chain,
> and the two notifications are not ordered. When the UCSI connector
> change comes last, an FSA4480 switches the SBU lines off, the
> DisplayPort AUX channel stops working and the sink is never detected.
> On the Lenovo Y700 Gen 5 (TB323FU, Kaanapali) this happens when a
> DisplayPort sink is plugged in during system suspend.
>
> Set TYPEC_STATE_USB only when the partner does not report alt mode.
> USB4 partners keep TYPEC_STATE_USB, as they do now.
>
> Fixes: 226ff2e681d0 ("usb: typec: ucsi: Convert connector specific commands to bitmaps")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Joonhoe Kim <26rote@xxxxxxxxx>

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

> ---
> drivers/usb/typec/ucsi/ucsi.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> index 2f9adf4f8bde..395554ba0312 100644
> --- a/drivers/usb/typec/ucsi/ucsi.c
> +++ b/drivers/usb/typec/ucsi/ucsi.c
> @@ -1356,7 +1356,8 @@ static void ucsi_partner_change(struct ucsi_connector *con)
> typec_set_mode(con->port, TYPEC_MODE_AUDIO);
> break;
> default:
> - if (UCSI_CONSTAT(con, PARTNER_FLAG_USB))
> + if (UCSI_CONSTAT(con, PARTNER_FLAG_USB) &&
> + !UCSI_CONSTAT(con, PARTNER_FLAG_ALT_MODE))
> typec_set_mode(con->port, TYPEC_STATE_USB);
> }
>
>
> base-commit: 7649ba73f9e7e1e04d0b46213e39c79ae09dd55c
> --
> 2.43.0

--
heikki