public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] Fix stuck UCSI controller on DELL
@ 2024-01-03 10:06 Christian A. Ehrhardt
  2024-01-04 11:59 ` Heikki Krogerus
  0 siblings, 1 reply; 6+ messages in thread
From: Christian A. Ehrhardt @ 2024-01-03 10:06 UTC (permalink / raw)
  To: linux-usb
  Cc: Christian A. Ehrhardt, Heikki Krogerus, Greg Kroah-Hartman,
	Neil Armstrong, Hans de Goede, Mario Limonciello, Saranya Gopal,
	linux-kernel

I have a DELL Latitude 5431 where typec only works somewhat.
After the first plug/unplug event the PPM seems to be stuck and
commands end with a timeout (GET_CONNECTOR_STATUS failed (-110)).

This patch fixes it for me but according to my reading it is in
violation of the UCSI spec. On the other hand searching through
the net it appears that many DELL models seem to have timeout problems
with UCSI.

Do we want some kind of quirk here? There does not seem to be a quirk
framework for this part of the code, yet. Or is it ok to just send the
additional ACK in all cases and hope that the PPM will do the right
thing?

     regards   Christian

diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index 61b64558f96c..65098a454f63 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -53,7 +53,10 @@ static int ucsi_acknowledge_connector_change(struct ucsi *ucsi)
 	ctrl = UCSI_ACK_CC_CI;
 	ctrl |= UCSI_ACK_CONNECTOR_CHANGE;
 
-	return ucsi->ops->sync_write(ucsi, UCSI_CONTROL, &ctrl, sizeof(ctrl));
+	if (ucsi->ops->sync_write(ucsi, UCSI_CONTROL, &ctrl, sizeof(ctrl)))
+		pr_err("ACK FAILED\n");
+
+	return ucsi_acknowledge_command(ucsi);
 }
 
 static int ucsi_exec_command(struct ucsi *ucsi, u64 command);
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-01-17 17:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-03 10:06 [RFC] Fix stuck UCSI controller on DELL Christian A. Ehrhardt
2024-01-04 11:59 ` Heikki Krogerus
2024-01-15 18:55   ` Christian A. Ehrhardt
2024-01-17  3:00     ` Mario Limonciello
2024-01-17  6:35       ` Christian A. Ehrhardt
2024-01-17 17:34         ` Mario Limonciello

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox