Repository navigation
drm/apple, usb: Type-C route and USB4 link-recovery follow-ups (#3040, #3109 reviews) - #3540
RyanTheTide wants to merge 2 commits into
Conversation
Release the OF changeset bookkeeping after permanent route disables and skip repeated disables before allocation. Cover both node reference balance and repeated refusal in the topology KUnit suite. The installed properties remain owned by OF. Model the active USB4 PIPE backend before host shutdown and exercise mux disconnect on each supported PHY sequence. Correct the Type-C shutdown comment to describe PIPE parking and mux ownership. Keep discovery-based refill of the consecutive link-lost budget, but bound automatic recovery with a separate per-port rate limiter: three cycles per one-minute window. Domain reconstruction and a briefly discovered peer must not refill that limit. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
An idempotent disable can return NULL when another refusal already disabled the route. Keep that distinct from an available supplier: the route must still be skipped. Cover a repeated supplier refusal in KUnit. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
There was a problem hiding this comment.
Verdict: FINISH, then merge at 3130666e
Blockers:
- Hosted CI at
3130666e(21 jobs:kunit,apple-build,host-tests,pr-text,readiness, KUnit suites) is currentlyQUEUED; wait for green CI. - Missing exact-head hardware rows (J616s or J713 USB4 DP-alt plug/unplug + flapping-peer recovery check plus one regression Mac; noted as queued in
Not yet:).
Checked: no Apple material, no AI attribution, human DCO Signed-off-by on both commits, no chip/board/firmware gates, no new parameters, full diff (+104/-15 across dcp-fabric.c, dcp-fabric-topology-test.c, drivers/thunderbolt/apple.c, drivers/usb/typec/tipd/core.c, tools/asahi/atc-usb3-tests.py) verified, dcp_typec_routes_disable_nodes() skips allocation when already disabled and dcp_typec_routes_disable_free() releases changeset bookkeeping without leaking device_node krefs (proved by topology_route_disable_cleanup_test), dcp_typec_route_skip() returns cs ?: ERR_PTR(-ENODEV) so concurrent disables still skip the route, apple_cio.link_lost_limit (3 cycles per 60 * HZ) survives domain rebuilds and brief peer discoveries, atc-usb3-tests.py covers T8103/T8122/T8132 PIPE parking and mux disconnect with 2 new mutations (39 checks + 66/66 mutations killed), 8/8 topology KUnit + arm64 object builds + checkpatch --strict clean, PR body has Tested: and Risk: two-way, branch is MERGEABLE against main.
Evidence
drivers/gpu/drm/apple/dcp-fabric.c&dcp-fabric-topology-test.c(3130666ed1):dcp_typec_routes_disable_nodes()checksroute ? !of_device_is_available(route) : !dcp_typec_routes_available(routes)beforekzalloc_obj(*cs).dcp_typec_routes_disable_free()callsof_changeset_destroy(cs); kfree(cs);on non-ERR/non-NULL changesets;topology_route_disable_cleanup_test()checkskref_read(&route_np->kobj.kref)stays unchanged and repeated disables keep the exactstatusproperty pointer.
drivers/thunderbolt/apple.c(b08e1731ec): initializesacio->link_lost_limitinapple_cio_probe()withAPPLE_CIO_LINK_LOST_INTERVAL (60 * HZ)/APPLE_CIO_LINK_LOST_CYCLES (3)and gates automatic link-lost restarts with__ratelimit(&acio->link_lost_limit)before incrementinglink_lost_cyclesor settinglink_lost_restart.drivers/usb/typec/tipd/core.c&tools/asahi/atc-usb3-tests.py: updates shutdown ordering comment and extends host tests toT8122+usb4-stop-skips-pipe-park/cio-mux-disconnect-keeps-lanesmutations.- Code is clean; ready to approve and merge once CI is green and the queued hardware rows pass at
3130666e.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
There was a problem hiding this comment.
Verdict: MERGE at 3130666ed186
Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.
Checked: no Apple material, no AI attribution, human DCO Signed-off-by on both commits, no chip/board/firmware gates, no new parameters, full diff (+104/-15 across dcp-fabric.c, dcp-fabric-topology-test.c, drivers/thunderbolt/apple.c, drivers/usb/typec/tipd/core.c, tools/asahi/atc-usb3-tests.py) verified, dcp_typec_routes_disable_nodes() skips allocation when already disabled and dcp_typec_routes_disable_free() releases changeset bookkeeping without leaking device_node krefs (proved by topology_route_disable_cleanup_test), dcp_typec_route_skip() returns cs ?: ERR_PTR(-ENODEV) so concurrent disables still skip the route, apple_cio.link_lost_limit (3 cycles per 60 * HZ) survives domain rebuilds and brief peer discoveries, atc-usb3-tests.py covers T8103/T8122/T8132 PIPE parking and mux disconnect with 2 new mutations (39 checks + 66/66 mutations killed), 8/8 topology KUnit + arm64 object builds + checkpatch --strict clean, PR body has Tested: and Risk: two-way, branch is MERGEABLE against main.
Follow-ups (not blocking): queued CI; J616s/J713 USB4 DP-alt + flapping-peer row
DjDeveloperr
left a comment
There was a problem hiding this comment.
Correct. The changeset is now freed in every caller. Destroying an applied changeset leaves its properties in the live tree, and the new KUnit case checks that, with refs unchanged. A repeated refusal returns before allocating. The link-lost rate limit can't be refilled by discovery.
Small optional nit: __ratelimit() prints "callbacks suppressed" when the window ends. ratelimit_set_flags(&acio->link_lost_limit, RATELIMIT_MSG_ON_RELEASE) after init keeps that quiet next to your own warning.
Left before merge: the cancelled KUnit jobs (I re-ran them), and the rows. This touches shared Type-C/USB4 code, so it needs two generations: DP-alt plug/unplug plus a flapping-peer check. I've queued J773g and J714s.
|
J773g (M4 mini, T8132, 27.2) |
What: Follow-ups from the reviews of #3040 and #3109. Routes with disabled suppliers stay refused. The OF changeset bookkeeping is released after permanent route disables, and repeated disables are skipped before allocation. The active USB4 PIPE backend is modelled before host shutdown, and the Type-C shutdown comment is corrected. Automatic USB4 link-lost recovery gets a per-port rate limit of three port cycles per minute, which domain rebuilds and briefly seen peers do not refill. The consecutive budget still refills on discovery.
Tested: Build and host tests only, no Mac row yet. Rebased onto main 8973cea, keeping main's revert-before-destroy ordering in the route-supplier test. The three touched arm64 objects build. Topology KUnit passes 8/8. ATCPHY host checks pass 39 and reject 66/66 mutations, including main's newer control. The link-lost checks pass and both negative controls are rejected. Strict checkpatch is clean on both commits.
Risk: two-way · USB-C/USB4 display routes and link recovery on every Mac with ATC ports.
Not yet: a row at head on one USB4 Mac (J616s or J713): DP-alt plug/unplug plus a flapping-peer recovery check. A regression Mac is also owed. It merges cleanly with #3530, which touches the same test file.
Evidence
Source item: M2MINI-USBC-FULL.md:178 (#3040 review nits of 11-24 17:17, #3109 review nit 2).