Repository navigation
usb: typec: tipd: CD321x polish (style, guards, quieter deferrals) - #310
Merged
Merged
Conversation
The CD321x support placed the mux handle and its remove flag ahead of the device pointer in struct tps6598x, and included cd321x-pm.h in the middle of the header between a register define and the bit fields. Keep the includes together at the top, document why TPS_REG_MODE lives in the header, and move the mux handle next to the other port objects. Describe what remove_safe_prepared actually means instead of the previous shorthand. No functional change. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
Fix the issues checkpatch --strict reports in code added for CD321x: misaligned continuation lines, two lines over 100 columns, an else branch after a goto, and a double blank line. Reword the comment on the shared display connector, which used double spaces and repeated itself, and the comment on the SAFE transaction left open by cd321x_remove(). Move the DRM include below the linux/ ones, where the DisplayPort Alt Mode driver has it, instead of ahead of them. No functional change. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
fwnode_find_reference() already fails with -ENOENT when the property is missing and never returns NULL, so the separate presence check and the IS_ERR_OR_NULL() test are redundant. Look the reference up directly and drop the error pointer, as the DisplayPort Alt Mode driver does. No functional change. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
The tipd_data hooks called from tipd_prepare() and tipd_complete() were named suspend_prepare and resume_reverify. The latter also runs after an aborted suspend, so "resume" is misleading, and neither name matches the dev_pm_ops callback it serves. Call them prepare and complete, and rename the CD321x implementations to match. No functional change. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
The ACIO Thunderbolt switch and the ATC PHY return -EAGAIN while the PCIe host behind a USB4 port, or the USB host on the other side of the PHY, is still being set up or torn down. cd321x_update_work() already treats that as a deferral: it retries without forcing a reconnect. Yet cd321x_typec_update_mode() logged every such attempt as a warning, so a dock that comes up a little slowly left "failed to configure Type-C connection: -11" in the log even though it then worked. Log -EAGAIN at debug level and keep the warning for real failures. The revalidation message after a tunnel state change is in the same category: it is a routine, bounded recovery step, so make it debug too. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
core.c takes tps->lock with guard() and scoped_guard(), but the debugfs interface added for CD321x open-codes mutex_lock()/mutex_unlock() and needs a goto label to unlock on the -EBUSY path. Use the same guards there, which removes the label and the extra return-value juggling. The critical sections are unchanged: user copies still happen outside tps->lock except for the read of the saved DATA1 result, as before. No functional change. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
The err_unregister_mux label in cd321x_register_port() drops the references to the mux and the DisplayPort connector; nothing is unregistered there. Call it err_put_mux, like err_put_switch above it. No functional change. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
A polish pass over the CD321x additions to the TI tipd driver (J700 / T8140 Type-C ports), aimed at upstream style. Six of the seven commits change no behaviour:
tps6598x.h.checkpatch --strictissues in the CD321x update path.fwnode_find_reference()never returns NULL.guard()for the debugfs locks, ascore.calready does.err_unregister_muxtoerr_put_mux.One commit (MED, log level only) changes what reaches the log: Don't warn about deferred CD321x mode changes.
-EAGAINfrom the ACIO switch or the ATC PHY is a deferral the update work already retries, so it now logs at debug level, as does the routine tunnel revalidation message. Real failures still warn.Risk
Tests
scripts/checkpatch.pl --strict: clean on every commit. The only warning is theAssisted-bytrailer format, which is accepted.drivers/usb/typec/tipd/gives 0 warnings.cd321x-pm: 22/22.Hardware qualification (MacBook Neo J700, 2026-10-15)
This series was qualified on the Neo inside the 2026-10-15 release stack: aurora-wip ac89582 plus, in merge order, tipd polish, input polish, speaker KUnit, SEP (#303), DCP sleep fixes, platform polish, audio polish, radio polish, power polish and fixes, and storage polish. It used the published 5f config with LLVM=1 and clang 22, and modules installed with INSTALL_MOD_STRIP=1. Each test was a one-shot GRUB boot. The saved default stayed on the public 5f kernel. The DTB came from Stage 2 and was not changed.
Results on the release kernels (7.1.12-aurora-rel-g257ca7bed, then -g3faecd4f7 with audio and radio added), and on the earlier integration kernels that also carried the held USB wake line (-integ-ge78a80fd8, -g07a8a7ff4, -g32b5436bd):
runningwith no failed units.neo-public5f-20261015). No new kernel warning types appeared. These went away as expected: dockchannel "keyboard is not initialized", AOP "Unknown oslog message", and the PMGR "always-on domain ... not on at boot" ×8 (now info).dcp-s2idle-regress.sh 6 30 5, 6/6 cycles per run, 3 runs. The DCP mailbox rate in s2idle was about 3 IRQ/s, down from about 62/s.tools/aurora-wake/s2idle-rtc-regression.sh -c 5 -s 20passed 5/5 per run. W1 ran 10 RTC cycles with the lsusb count steady at 13, and no "HC died", Host System Error or DART fault.Evidence:
/Volumes/AuroraS500/aurora-ctl/artifacts/integ-20261015/(per-boot dmesg, journal and checks; scripts are inscripts/).Held / follow-ups
core.cfrom-EBUSYto-ENOSPC, along with its mux error disambiguation.🤖 Generated with Claude Code