Re: [PATCH v2 02/10] usb: tcpm: continue polling after PD negotiation to handle source messages
Sebastian Reichel <[email protected]>
| Newsgroups | gmane.comp.boot-loaders.u-boot.general,gmane.comp.boot-loaders.u-boot |
|---|---|
| Message-ID | <aneg74rzS58HD1D1@venus> |
Hi, On Sun, Jun 21, 2026 at 10:06:38AM +0800, Peng Fan (OSS) wrote: > From: Peng Fan <[email protected]> > > After reaching SNK_READY or SRC_READY, the poll loop exits immediately. > However, some PD sources send follow-up messages (e.g., Get_Sink_Cap, > Get_Status) shortly after the explicit contract is established. Since > the TCPCI hardware auto-sends GoodCRC for received messages, the > source expects a timely response. If no response arrives within > SenderResponseTimer (24-30ms), the source sends a Hard Reset, > causing VBUS to drop and resetting VBUS-powered boards. > > Add a 500ms settling period after reaching Ready state to process > any follow-up messages from the source before entering low power > mode and disabling PD message reception. > > Signed-off-by: Peng Fan <[email protected]> > --- Reviewed-by: Sebastian Reichel <[email protected]> Greetings, -- Sebastian > drivers/usb/tcpm/tcpm.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/usb/tcpm/tcpm.c b/drivers/usb/tcpm/tcpm.c > index 25ff0926cdf..d6af0fae7c1 100644 > --- a/drivers/usb/tcpm/tcpm.c > +++ b/drivers/usb/tcpm/tcpm.c > @@ -2252,6 +2252,16 @@ static void tcpm_poll_event(struct udevice *dev) > tcpm_check_and_run_delayed_work(dev); > } > > + if (port->state == SNK_READY || port->state == SRC_READY) { > + int settle; > + > + for (settle = 0; settle < 1000; settle++) { > + drvops->poll_event(dev); > + udelay(500); > + tcpm_check_and_run_delayed_work(dev); > + } > + } > + > if (port->state != SNK_READY && port->state != SRC_READY) > dev_warn(dev, "TCPM: exit in state %s\n", > tcpm_states[port->state]); > > -- > 2.51.0 >
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmp3oQYACgkQ2O7X88g7 +pqXqA/+PDSp+C/lim6QWlsR98TijbnRDi8dDrFlKvpCXzfvQI50TP8soCvxYtlp pGZA/1oe8zV+A7rT/7j2BZktVu5DUPIrqWnEkOXZiU2yYMN9pLHZhKHvrOM4iuAD nqlBzz2Co4RlTVIQrVyylkysS3PaGNRv50dOVi+UkLmebTJRdPGGn7HQhbhA8n7U mkX8KpNnoXUNizB708U+gT0TZojdgnsMlSX693fr7SYA5KMFnLQTRHAsXExSceyN 7j946I48Y8YUIs1st6klr1ZjxM7IuovJ6FRJlcMgE/QjOAr6Yn07SPxA06R+SKII edJ6udKzlj32eHae7iCKGCtOA6L6MtCSB8bL/wcMNuoiqBa2rgYiUgQl9Kn7bQse QKShNZp5nJ3wIMb/lmnraSMLtN7qdoAXUk5tA3L+fnZqKBNERaTh8SSIwaPiC9BZ S8pFf9pTuCXoRq2pTZuITXEU5iz+bImjejLdYWsAMK3qV8Bm+70aejOJbDQN+a/C Ra69X583Y0zDdFjwnepjof7TPmGHrkGPdAtX0LR/P01ZHzetlX3+V6BLF2LPbxeW zr6Rps4tWi0QrkyC6JqZw5x/7kKb9TSGeWzK9nvRZFDJGpJ+WwvLF+fN7XScK7/w 1Oazn5hoYn3rTRbr0X0Id4SptwTZ1SZlA5DmYClwbUcCWL452CY= =VT6L -----END PGP SIGNATURE-----