soc: apple: {sep,aop}: log the endpoints and services the firmware offers - #593
Open
brentkearney wants to merge 1 commit into
Open
soc: apple: {sep,aop}: log the endpoints and services the firmware offers#593brentkearney wants to merge 1 commit into
brentkearney wants to merge 1 commit into
Conversation
…fers
Both drivers discard the coprocessor's own description of what it offers,
which makes the hardware harder to work with than it needs to be.
sep.rs receives an advertisement per SEPOS endpoint on the discovery
endpoint, carrying a four-character name and an endpoint number, and drops
every one of them: the dev_info! in process_discover_msg() is commented
out, along with the two constants it needs. Nothing else in the driver
exposes the list, so the set of endpoints SEPOS actually starts has never
been visible from Linux on any board.
aop.rs matches announced EPIC service names against "aop-audio", "las" and
"als" and returns silently for anything else, so services with no driver
leave no trace either.
Enable the SEP log and add the AOP one. Both fire once per boot during
probe, alongside the RTKit syslog output these coprocessors already emit at
the same level.
dev_dbg! would be the tidier choice but is not usable here: Rust's
dev_dbg! routes to Device::pr_dbg(), which is gated on
cfg!(debug_assertions), so it compiles to nothing unless
CONFIG_RUST_DEBUG_ASSERTIONS is set and it does not participate in dynamic
debug.
On an Apple MacBook Pro (16-inch, 2021), t6000/j316s, the SEP log yields:
Got endpoint Ok("cntl") at 0
Got endpoint Ok("hdcp") at 14
Got endpoint Ok("xars") at 16
Got endpoint Ok("xarm") at 19
Got endpoint Ok("hibe") at 20
Got endpoint Ok("pnon") at 21
Got endpoint Ok("stac") at 24
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.
Both drivers discard the coprocessor's own description of what it offers. This change logs it once per boot during
probe(), at the same level as the RTKit syslog output these coprocessors already emit.Changes
sep.rs: enable thedev_info!inprocess_discover_msg()that prints each advertised SEPOS endpoint (four-character name and endpoint number), and thedev_warn!for unknown discovery message types. Restores the two constants they need,MSG_PARAM_SHIFTandMSG_PARAM_MASK.aop.rs: inregister_service(), log the name and endpoint of any announced EPIC service that is notaop-audio,las, oralsbefore returning.dev_dbg!is not an option here: Rust'sdev_dbg!routes toDevice::pr_dbg(), which is gated oncfg!(debug_assertions)and does not participate in dynamic debug, so it compiles to nothing unlessCONFIG_RUST_DEBUG_ASSERTIONSis set.Why
The set of endpoints SEPOS actually starts has never been visible from Linux on any board, and AOP services with no driver leave no trace. Both lists are the first thing anyone working on these coprocessors needs. On an
apple,t6000/j316sMacBook Pro the SEP log prints:Testing
asahi-7.1.6-1with rustc 1.93.1:drivers/soc/apple/sep.oandaop.obuild before and after.CLIPPY=1introduces no new warnings;rustfmt --checkpasses.Independent of #592; applies to
asahi-wipin either order.