* [PATCH] usb: typec: ucsi: Handle connectors already attached at init
@ 2026-08-13 9:38 William Bright
2026-08-14 10:37 ` Heikki Krogerus
0 siblings, 1 reply; 2+ messages in thread
From: William Bright @ 2026-08-13 9:38 UTC (permalink / raw)
To: Heikki Krogerus, Greg Kroah-Hartman, Christian A. Ehrhardt
Cc: linux-usb, linux-kernel, William Bright
After a cold boot the PPM may already have a partner attached without a
pending connector change to report. On a CYPD6125 the CCI register reads
back 0 in ucsi_init(), so ucsi_connector_change() is never called and the
Type-C mux is left unconfigured for the already-attached port.
Fix this by additionally checking the connector status of every
connector and call ucsi_connector_change() for connectors that are
already attached. Whilst also continuing to call ucsi_connector_change()
for connectors that report a change via the CCI register.
Fixes: ce4c8d21054a ("usb: typec: ucsi: Fix connector check on init")
Signed-off-by: William Bright <william.bright@imd-tec.com>
---
drivers/usb/typec/ucsi/ucsi.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index ecbda2a3783c..740ae4a14f7f 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -2136,8 +2136,11 @@ static int ucsi_init(struct ucsi *ucsi)
mutex_unlock(&ucsi->ppm_lock);
if (ret)
return ret;
- if (UCSI_CCI_CONNECTOR(cci))
- ucsi_connector_change(ucsi, UCSI_CCI_CONNECTOR(cci));
+
+ for (i = 0; i < ucsi->cap.num_connectors; i++)
+ if (UCSI_CONSTAT(&connector[i], CONNECTED) ||
+ UCSI_CCI_CONNECTOR(cci) == i + 1)
+ ucsi_connector_change(ucsi, i + 1);
return 0;
---
base-commit: 55431f6adac42f818a0c76594ce2c6c02fe1034d
change-id: 20260813-ucsi-cold-b35e11991b7c
Best regards,
--
William Bright <william.bright@imd-tec.com>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] usb: typec: ucsi: Handle connectors already attached at init
2026-08-13 9:38 [PATCH] usb: typec: ucsi: Handle connectors already attached at init William Bright
@ 2026-08-14 10:37 ` Heikki Krogerus
0 siblings, 0 replies; 2+ messages in thread
From: Heikki Krogerus @ 2026-08-14 10:37 UTC (permalink / raw)
To: William Bright
Cc: Greg Kroah-Hartman, Christian A. Ehrhardt, linux-usb,
linux-kernel
On Thu, Aug 13, 2026 at 10:38:40AM +0100, William Bright wrote:
> After a cold boot the PPM may already have a partner attached without a
> pending connector change to report. On a CYPD6125 the CCI register reads
> back 0 in ucsi_init(), so ucsi_connector_change() is never called and the
> Type-C mux is left unconfigured for the already-attached port.
>
> Fix this by additionally checking the connector status of every
> connector and call ucsi_connector_change() for connectors that are
> already attached. Whilst also continuing to call ucsi_connector_change()
> for connectors that report a change via the CCI register.
>
> Fixes: ce4c8d21054a ("usb: typec: ucsi: Fix connector check on init")
> Signed-off-by: William Bright <william.bright@imd-tec.com>
You need to CC stable.
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/usb/typec/ucsi/ucsi.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> index ecbda2a3783c..740ae4a14f7f 100644
> --- a/drivers/usb/typec/ucsi/ucsi.c
> +++ b/drivers/usb/typec/ucsi/ucsi.c
> @@ -2136,8 +2136,11 @@ static int ucsi_init(struct ucsi *ucsi)
> mutex_unlock(&ucsi->ppm_lock);
> if (ret)
> return ret;
> - if (UCSI_CCI_CONNECTOR(cci))
> - ucsi_connector_change(ucsi, UCSI_CCI_CONNECTOR(cci));
> +
> + for (i = 0; i < ucsi->cap.num_connectors; i++)
> + if (UCSI_CONSTAT(&connector[i], CONNECTED) ||
> + UCSI_CCI_CONNECTOR(cci) == i + 1)
> + ucsi_connector_change(ucsi, i + 1);
>
> return 0;
>
>
> ---
> base-commit: 55431f6adac42f818a0c76594ce2c6c02fe1034d
> change-id: 20260813-ucsi-cold-b35e11991b7c
>
> Best regards,
> --
> William Bright <william.bright@imd-tec.com>
--
heikki
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-14 10:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-13 9:38 [PATCH] usb: typec: ucsi: Handle connectors already attached at init William Bright
2026-08-14 10:37 ` Heikki Krogerus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox