[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d2fb89c1-a4cb-4d59-93ef-3c462ae0964f@panix.com>
Date: Tue, 18 Nov 2025 08:54:49 -0800
From: Kenneth Crudup <kenny@...ix.com>
To: Hsin-Te Yuan <yuanhsinte@...omium.org>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
Kenneth C <kenny@...ix.com>, "Mario Limonciello (AMD)" <superm1@...nel.org>
Subject: Re: [PATCH] usb: typec: ucsi: Monitor connector change before getting
connector status
This patch seems to fix an issue I've had for a while now on my Dell
XPS-9320 where if I suspend with one Thunderbolt Dock connected and
resume with another, the machine thinks the previous dock is still
connected (which means mostly that the new monitor configuration isn't set).
I'm still testing it to see if it does indeed fix my issue, but to at
least confirm it does what it says on the tin:
Tested-By: Kenneth R. Crudup <kenny@...ix.com>
On 11/17/25 01:31, Hsin-Te Yuan wrote:
> Originally, the notification for connector change will be enabled after
> the first read of the connector status. Therefore, if the event happens
> during this window, it will be missing and make the status unsynced.
>
> Enable the notification for connector change before getting the
> connector status to ensure the status is synced.
>
> Signed-off-by: Hsin-Te Yuan <yuanhsinte@...omium.org>
> ---
> drivers/usb/typec/ucsi/ucsi.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> index 3f568f790f39b0271667e80816270274b8dd3008..07290cd85b618b22cb989151079707dbe9f578a7 100644
> --- a/drivers/usb/typec/ucsi/ucsi.c
> +++ b/drivers/usb/typec/ucsi/ucsi.c
> @@ -1565,7 +1565,7 @@ static int ucsi_register_port(struct ucsi *ucsi, struct ucsi_connector *con)
> struct typec_capability *cap = &con->typec_cap;
> enum typec_accessory *accessory = cap->accessory;
> enum usb_role u_role = USB_ROLE_NONE;
> - u64 command;
> + u64 command, ntfy;
> char *name;
> int ret;
>
> @@ -1659,6 +1659,15 @@ static int ucsi_register_port(struct ucsi *ucsi, struct ucsi_connector *con)
> goto out;
> }
>
> + /* Enable the notification for connector change before getting the connector status */
> + ntfy = UCSI_ENABLE_NTFY_CMD_COMPLETE | UCSI_ENABLE_NTFY_ERROR | UCSI_ENABLE_NTFY_CONNECTOR_CHANGE;
> + command = UCSI_SET_NOTIFICATION_ENABLE | ntfy;
> + ret = ucsi_send_command(ucsi, command, NULL, 0);
> + if (ret < 0) {
> + dev_warn(ucsi->dev, "con%d: failed to enable the notification for connector change\n",
> + con->num);
> + }
> +
> /* Get the status */
> ret = ucsi_get_connector_status(con, false);
> if (ret) {
>
> ---
> base-commit: 6a23ae0a96a600d1d12557add110e0bb6e32730c
> change-id: 20251117-ucsi-c2dfe8c006d7
>
> Best regards,
--
Kenneth R. Crudup / Sr. SW Engineer, Scott County Consulting, Orange
County CA
Powered by blists - more mailing lists