lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240325-ucsi-reset-delay-v1-1-d9e183e0f1e6@chromium.org>
Date: Mon, 25 Mar 2024 21:19:43 +0000
From: Pavan Holla <pholla@...omium.org>
To: Heikki Krogerus <heikki.krogerus@...ux.intel.com>, 
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org, 
 Abhishek Pandit-Subedi <abhishekpandit@...omium.org>, 
 Pavan Holla <pholla@...omium.org>
Subject: [PATCH] usb: typec: ucsi: Wait 20ms before retrying reset

The PPM might take time to process reset. Allow 20ms for the reset to
complete before issuing another reset.

Signed-off-by: Pavan Holla <pholla@...omium.org>
---
There is a 20ms delay for a reset retry to complete. However, the first
reset attempt is expected to complete immediately after an async write
of the reset command. This patch adds 20ms between the async write and
the CCI read that expects the reset to be complete. The additional delay
also allows the PPM to settle after the first reset, which seems to be
the intention behind the original 20ms delay ( kernel v4.14 has a comment
regarding the same )
---
 drivers/usb/typec/ucsi/ucsi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index cf52cb34d285..6b642c4c58b7 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -1280,6 +1280,9 @@ static int ucsi_reset_ppm(struct ucsi *ucsi)
 			goto out;
 		}
 
+		/* Give the PPM time to reset and stabilize */
+		msleep(20);
+
 		ret = ucsi->ops->read(ucsi, UCSI_CCI, &cci, sizeof(cci));
 		if (ret)
 			goto out;
@@ -1293,7 +1296,6 @@ static int ucsi_reset_ppm(struct ucsi *ucsi)
 				goto out;
 		}
 
-		msleep(20);
 	} while (!(cci & UCSI_CCI_RESET_COMPLETE));
 
 out:

---
base-commit: 4cece764965020c22cff7665b18a012006359095
change-id: 20240325-ucsi-reset-delay-bdf6712455fd

Best regards,
-- 
Pavan Holla <pholla@...omium.org>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ