Skip to content

usb: typec: tipd: debugfs: a replug of the port's partner on request - #2600

Merged
DjDeveloperr merged 1 commit into
integration/aurorafrom
djdev/m5-j714s-tipd-debugfs-replug
Nov 20, 2026
Merged

DjDeveloperr merged 1 commit into
integration/aurorafrom
djdev/m5-j714s-tipd-debugfs-replug

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

A test trigger for the J714s Type-C replug, so sleep gates can run on the exact merged tree without a TEST commit.

What changes

  • New /sys/kernel/debug/usb/tipd/<device>/replug, mode 0200, only on ports tipd_replug_supported() covers (the J714s's SN201202x).
  • Writing N (1..10) queues one replug, partner disconnected for N s, exactly as tipd_port_replug() queues it after a sleep; -EBUSY while one is pending.
  • The queueing moves into a shared tipd_replug_queue().
  • A request has to find the port on tipd_ports under tipd_ports_lock. tipd_port_list_del() takes the port off before cancelling the work, so nothing gets queued after the cancel.
  • Not behind CONFIG_TYPEC_TPS6598X_DEBUG_COMMANDS: it only asks for what the driver already does on its own.

Why: the J714s sleep hang and the macOS-entry PRs (#2597 and the rest of the series) concern sleeps entered soon after a Type-C event. Testing them needs that event on demand. Until now that took a TEST-only sysfs attribute.

Review: an independent review found nothing blocking. Fixed from it:

  • The kernel-doc placement.
  • debugfs is now registered after the port joins tipd_ports.
  • The file is created only with a role switch.
  • The docs now say -EBUSY applies only while a replug is queued and not yet running.

🤖 Generated with Claude Code

On the J714s, tipd replugs the Dell monitor hub's port (a "DISC" of the
partner, unlocked with the board's key, then locked again) when
dwc3-apple finds the hub's SuperSpeed side missing after a sleep or at
boot. The J714s sleep hang, and the port controller handling that
copies macOS, come in sleeps entered soon after such a Type-C event, so
testing them needs that event on request, on the kernel under test.

Add /sys/kernel/debug/usb/tipd/<device>/replug, write-only for root, on
the ports tipd can replug (tipd_replug_supported(): the J714s's
SN201202x) that drive a USB role switch, as tipd_port_replug() needs.
Writing N (1..10) queues one replug with the partner disconnected for N
seconds, exactly as tipd_port_replug() queues it; -EBUSY while one is
queued and not yet running (a write while one runs queues another after
it, as tipd_port_replug() does). tipd_port_replug()'s queueing moves
into tipd_replug_queue(), shared by both. A request finds the port on
tipd_ports under tipd_ports_lock, and tipd_port_list_del() takes it off
before cancelling the work, so nothing is queued after the cancel. The
debugfs directory is now created after the port joins tipd_ports, so
the file never exists before the port can take a request.

Unlike the "command" file, this needs no
CONFIG_TYPEC_TPS6598X_DEBUG_COMMANDS: it only asks for what the driver
already does by itself.

Signed-off-by: Diljit Singh <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@DjDeveloperr
DjDeveloperr force-pushed the djdev/m5-j714s-tipd-debugfs-replug branch from 8bc1ab4 to 63bde14 Compare November 20, 2026 20:03
@DjDeveloperr
DjDeveloperr merged commit d1d26ab into integration/aurora Nov 20, 2026
1 check passed
@RyanTheTide
RyanTheTide deleted the djdev/m5-j714s-tipd-debugfs-replug branch November 27, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant