All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] usb: typec: tcpm: Fixes for talking to the cable plug as a VCONN source
@ 2026-11-18  7:26 Alexey Charkov
  2026-11-18  7:26 ` [PATCH v2 1/4] usb: typec: tcpm: Keep the Soft_Reset target apart from the VDM one Alexey Charkov
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Alexey Charkov @ 2026-11-18  7:26 UTC (permalink / raw)
  To: Badhri Jagan Sridharan, Heikki Krogerus, Greg Kroah-Hartman,
	RD Babiera
  Cc: Sebastian Reichel, linux-usb, Alexey Charkov, stable

When a TCPM port is the VCONN source, its exchanges with the cable plug
on SOP' can leave state behind that later affects the port partner.

Patch 1 fixes a Soft_Reset meant for the port partner being sent to the
cable plug after any SOP' VDM, which left a source without a contract
until unplugged. It needs "usb: typec: tcpm: Stop a source from
repeating a cable Soft_Reset" [1] first: without it, the repeated
Soft_Reset after a VCONN Swap would now go to the port partner.

Patches 2 and 3 fix SRC_VDM_IDENTITY_REQUEST, which replays
Source_Capabilities after the first contract, and stalls until a Hard
Reset if the cable plug NAKs, answers BUSY or never answers.

Patch 4 is hardening rather than a fix for any known device: it keeps
messages from a cable plug that breaks the rules from reaching the port
partner's handlers.

The first three carry Fixes: tags and are meant for stable.

Tested on two FUSB302B ports (RK3576), source to sink through an
e-marked cable, plus injected cable plug answers (ACK, NAK, BUSY,
Not_Supported, none) and stray SOP' messages.

[1] https://lore.kernel.org/r/20261103-husb311-cable-comm-v1-1-6217dabc1a85@flipper.net

Signed-off-by: Alexey Charkov <alchark@flipper.net>
---
Changes in v2:
- Split the SRC_VDM_IDENTITY_REQUEST fix in two: keep upcoming_state for
  a message from the sink and clear it when leaving directly, then move
  on after a NAK, BUSY or no answer as USB PD r3.3 9.2.26.2.5.1 has it,
  keeping the timeout only as a fallback (Sashiko)
- Stop passing Reject from the cable plug, and pass its VDMs only as the
  answer to an outstanding SOP' request (Sashiko)
- Link to v1: https://patch.msgid.link/20261117-tcpm-soft-reset-sop-v1-0-c7e1543828c0@flipper.net

---
Alexey Charkov (4):
      usb: typec: tcpm: Keep the Soft_Reset target apart from the VDM one
      usb: typec: tcpm: Stop replaying Source_Capabilities after cable discovery
      usb: typec: tcpm: Leave SRC_VDM_IDENTITY_REQUEST whatever the cable answers
      usb: typec: tcpm: Keep cable plug messages away from the port partner

 drivers/usb/typec/tcpm/tcpm.c | 131 +++++++++++++++++++++++++++++++++++++-----
 1 file changed, 117 insertions(+), 14 deletions(-)
---
base-commit: 749a4de370409464cf8501ec5b2451df45c84eb4
change-id: 20261104-tcpm-soft-reset-sop-96b4a156f823
prerequisite-patch-id: 2ea442b68dfeee84c38efb27749d2f40487d2fff

Best regards,
--  
Alexey Charkov <alchark@flipper.net>


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

end of thread, other threads:[~2026-11-18  8:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-18  7:26 [PATCH v2 0/4] usb: typec: tcpm: Fixes for talking to the cable plug as a VCONN source Alexey Charkov
2026-11-18  7:26 ` [PATCH v2 1/4] usb: typec: tcpm: Keep the Soft_Reset target apart from the VDM one Alexey Charkov
2026-11-18  7:32   ` sashiko-bot
2026-11-18  7:26 ` [PATCH v2 2/4] usb: typec: tcpm: Stop replaying Source_Capabilities after cable discovery Alexey Charkov
2026-11-18  7:39   ` sashiko-bot
2026-11-18  7:26 ` [PATCH v2 3/4] usb: typec: tcpm: Leave SRC_VDM_IDENTITY_REQUEST whatever the cable answers Alexey Charkov
2026-11-18  8:08   ` sashiko-bot
2026-11-18  7:26 ` [PATCH v2 4/4] usb: typec: tcpm: Keep cable plug messages away from the port partner Alexey Charkov
2026-11-18  7:51   ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.