Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: typec: ucsi: Wait 20ms before reading CCI after a reset

The PPM might take time to process a reset. Allow 20ms for the reset to
be processed before reading the CCI.

This should not slow down existing implementations because they would
not set any bits in the CCI after a reset, and would take a 20ms delay
to read the CCI anyway. This change makes the delay explicit, and
reduces a CCI read. Based on the spec, the PPM has 10ms to set busy, so,
20ms seems like a reasonable delay before we read the CCI.

Signed-off-by: Pavan Holla <pholla@chromium.org>
Reviewed-by: Prashant Malani <pmalani@chromium.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20240409-ucsi-reset-delay-v3-1-8440710b012b@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Pavan Holla and committed by
Greg Kroah-Hartman
c4ede561 0fb782b5

+3 -1
+3 -1
drivers/usb/typec/ucsi/ucsi.c
··· 1337 1337 goto out; 1338 1338 } 1339 1339 1340 + /* Give the PPM time to process a reset before reading CCI */ 1341 + msleep(20); 1342 + 1340 1343 ret = ucsi->ops->read(ucsi, UCSI_CCI, &cci, sizeof(cci)); 1341 1344 if (ret) 1342 1345 goto out; ··· 1353 1350 goto out; 1354 1351 } 1355 1352 1356 - msleep(20); 1357 1353 } while (!(cci & UCSI_CCI_RESET_COMPLETE)); 1358 1354 1359 1355 out: