Repository navigation
Domain discovery - #422
Merged
Ekansh Gupta (ekanshibu) merged 8 commits intoNov 29, 2026
Merged
Domain discovery #422Ekansh Gupta (ekanshibu) merged 8 commits into
Ekansh Gupta (ekanshibu) merged 8 commits into
Conversation
Contributor
|
Add Signed-off-by |
Anandu Krishnan E (quic-anane)
force-pushed
the
domain-discovery-for-nord
branch
from
November 20, 2026 10:17
f7c9915 to
27fa880
Compare
Anandu Krishnan E (quic-anane)
force-pushed
the
domain-discovery-for-nord
branch
from
November 20, 2026 10:29
27fa880 to
3ecae51
Compare
Contributor
|
Please also update the PR description. |
Anandu Krishnan E (quic-anane)
force-pushed
the
domain-discovery-for-nord
branch
2 times, most recently
from
November 23, 2026 06:47
367b11a to
e5db38e
Compare
Ekansh Gupta (ekanshibu)
requested changes
Nov 23, 2026
Anandu Krishnan E (quic-anane)
force-pushed
the
domain-discovery-for-nord
branch
from
November 23, 2026 09:43
e5db38e to
c1064db
Compare
Anandu Krishnan E (quic-anane)
force-pushed
the
domain-discovery-for-nord
branch
from
November 23, 2026 09:49
c1064db to
b25d0c2
Compare
…mic domains Found while stress-testing the dynamic domain discovery feature, but present in pre-existing code: - get_domain_from_name() used strlen()/strncmp() on domain_name directly instead of the documented domain_name_len, causing a heap buffer overread for a caller following that contract exactly (a buffer sized to domain_name_len, no trailing NUL). Same issue for GET_URI's module_uri. - The same legacy-name fallback used strncmp() (prefix match) instead of an exact match, letting a garbage-suffixed name resolve as a legacy domain. - fopen_from_dirlist()'s fallback path allocation leaked on every dirList entry except the last. Co-Authored-By: Claude Sonnet 5 <[email protected]> Signed-off-by: Anandu Krishnan E <[email protected]>
Anandu Krishnan E (quic-anane)
force-pushed
the
domain-discovery-for-nord
branch
from
November 23, 2026 10:25
b25d0c2 to
ec2b6ff
Compare
Ekansh Gupta (ekanshibu)
previously approved these changes
Nov 23, 2026
Anandu Krishnan E (quic-anane)
force-pushed
the
domain-discovery-for-nord
branch
from
November 25, 2026 11:41
5679eba to
f0e2563
Compare
Anandu Krishnan E (quic-anane)
force-pushed
the
domain-discovery-for-nord
branch
2 times, most recently
from
November 25, 2026 13:40
2a7303f to
01e7b6e
Compare
Anandu Krishnan E (quic-anane)
force-pushed
the
domain-discovery-for-nord
branch
2 times, most recently
from
November 25, 2026 15:57
ef96d4c to
b6d52f7
Compare
Ekansh Gupta (ekanshibu)
previously approved these changes
Nov 26, 2026
This comment has been minimized.
This comment has been minimized.
Add support for targets with a variable number of DSP instances beyond the fixed legacy set (adsp/cdsp/cdsp1/sdsp/gdsp0/gdsp1), via two new id kinds that coexist with the legacy scheme in one int namespace: - Logical domain id: type*1000+instance (e.g. nsp1000, hpass5001). - Effective domain id: logical_id*100+session. A Level-1 hash table of discovered physical domains is populated by scanning /dev for "fastrpc-*" nodes; each node name is parsed as "<family><digits>" via a small family->type table, so another instance of an existing family needs no code change. Add the public remote_system_request() API with FASTRPC_GET_DOMAINS to query available domains. Every public API that takes a domain id normalizes it (legacy or dynamic) before using it for a session lookup, so existing callers keep working unchanged. Co-Authored-By: Claude Sonnet 5 <[email protected]> Signed-off-by: Anandu Krishnan E <[email protected]>
…ell fallback Add DSP_IMAGE_CONFIG remote DSP attribute and the dsp_image_config enum describing the available DSP image configurations (full compute, compute-lite, audio), cached per physical domain in the Level-1 table. open_shell() resolves a shell for secondary NSP/HPASS instances that the primary shell-path lookup doesn't cover: NSP instances sharing cdsp's compute image retry against the primary cdsp/ directory; HPASS/LPASS instances try their own discovered directory, then a capability-specific directory (adsp_computelite/ or adsp_audio/) based on DSP_IMAGE_CONFIG. fopen_from_dirlist() takes its domain as an explicit parameter instead of reading get_current_domain() internally, and routes dynamic domain names through the Level-1 table since SUBSYSTEM_NAME[] only covers legacy ids. Co-Authored-By: Claude Sonnet 5 <[email protected]> Signed-off-by: Anandu Krishnan E <[email protected]>
Allow clients to register/deregister callbacks that fire when a domain's up/down status changes, via FASTRPC_REGISTER_DOMAIN_STATUS_NOTIFICATIONS and FASTRPC_DEREGISTER_DOMAIN_STATUS_NOTIFICATIONS requests to remote_system_request(). Registration fires a catch-up callback for already-discovered matching domains, and accepts either a real non-negative domain_id or a -1 wildcard-by-type sentinel. Notifier callbacks run without holding internal locks: domain_info and the callback list are snapshotted under their respective locks, then the callbacks fire outside both. Co-Authored-By: Claude Sonnet 5 <[email protected]> Signed-off-by: Anandu Krishnan E <[email protected]>
Anandu Krishnan E (quic-anane)
force-pushed
the
domain-discovery-for-nord
branch
from
November 27, 2026 13:01
b6d52f7 to
a410b49
Compare
Contributor
|
Pre-merge CI results — patch Pre-merge CI ResultsRun: 46106174119
Posted manually — results from run 46106174119 |
Ekansh Gupta (ekanshibu)
previously approved these changes
Nov 28, 2026
Anandu Krishnan E (quic-anane)
force-pushed
the
domain-discovery-for-nord
branch
from
November 28, 2026 09:35
a410b49 to
62c1578
Compare
…tore legacy flat unit names Replace the adsp/cdsp/gdsp per-instance units with one systemd template unit per family ([email protected], [email protected], [email protected]), instantiated at runtime via the systemd "%i" specifier for both ConditionPathExists and the daemon's "rootpd <name>" argument, so adsp1/adsp2/cdsp2/cdsp3/gdsp2+ need no new file or rule. Keep the original, non-templated unit files and exact-match udev rules for the instances that existed before dynamic domain discovery (adsp, cdsp, cdsp1, gdsp0, gdsp1), so anything that enables/starts them by their exact legacy unit name keeps working; only instances with no legacy name use the template. sdsp keeps its original single, non-templated unit since it has only one instance today. Co-Authored-By: Claude Sonnet 5 <[email protected]> Signed-off-by: Anandu Krishnan E <[email protected]>
…hing to dynamic domains build_dsp_search_path_cache_for_domain() validated the raw effective domain id against the bare-id checks (IS_VALID_DOMAIN_ID/ IS_DYNAMIC_DOMAIN_ID) instead of their effective-id counterparts, rejecting every dynamic-domain call outright and risking an out-of-bounds DSP_SEARCH_PATHS_CACHE[] access for legacy domains with session >= 1. Switch both checks to the _EFFECTIVE_/_EFFEC_ variants used elsewhere in this file, and extend the ARCH_VER path cache to dynamic domains via a new dsp_search_path field in the Level-1 domain table, mirroring the existing fastrpc_get_cached_image_config() pattern. The cache is consulted before the ARCH_VER query, so repeat sessions of the same physical domain skip the ioctl entirely. Co-Authored-By: Claude Sonnet 5 <[email protected]> Signed-off-by: Anandu Krishnan E <[email protected]>
Split fastrpc_domains.c into three pieces along the lines that were already implicit in it: the generic Level-1 table/notification registry (fastrpc_domains.c), a generic domain-availability watcher thread (fastrpc_domain_watcher.c), and the /dev-node-probing discovery backend (fastrpc_domain_discovery_devnode.c). The watcher thread's mechanics (inotify setup, polling fallback, exit signaling, the ueventd/SELinux label-race retry) don't depend on how domains are found, so it now takes the watched directory and rescan/event callbacks via a small config struct instead of hardcoding /dev and fastrpc_discover_domains(). This lets a different discovery backend (e.g. one based on a sysfs tree) be plugged in later without touching the registry or the watcher thread. No functional change. Signed-off-by: Anandu Krishnan E <[email protected]>
resolve_domain_cli_alias() and fastrpc_domain_is_audio() generalize from a single hardcoded adsp domain to any adsp-family instance (adsp, adsp1, ...), parsed via fastrpc_parse_dev_family(). An instance connects to audio PD unless its cached image config is full FASTRPC_DSP_COMPUTE. dsprpcd treats AEE_EUNSUPPORTED as a fatal exit (no restart loop) for instances where audiopd has nothing to attach to. Signed-off-by: Anandu Krishnan E <[email protected]>
Anandu Krishnan E (quic-anane)
force-pushed
the
domain-discovery-for-nord
branch
from
November 29, 2026 08:44
62c1578 to
6704cf9
Compare
Chenna Kesava Raju (Chennak-quic)
approved these changes
Nov 29, 2026
Ekansh Gupta (ekanshibu)
approved these changes
Nov 29, 2026
Contributor
🤖 FastRPC AI Code Review —
|
| Severity | Location | Rule | Issue | Suggested Fix |
|---|---|---|---|---|
| 🟡 MEDIUM | src/apps_std_imp.c:1080 |
mm-002 |
malloc(absName) not freed on all paths when out_path is NULL | Add FREEIF(absName); before the return nErr; at line 1080, or ensure absName is freed/transferred on every path |
| 🔴 HIGH | src/apps_std_imp.c:1029 |
var-002 |
Pointer absName not initialized to NULL | Change line 1029 to char *absName = NULL, *dirName = NULL, *pos = NULL; |
| 🔴 HIGH | src/fastrpc_internal.h:134 |
mm-009 |
Array index domain used without bounds check in apps_std_domain_name() | Add VERIFYC(domain >= 0 && domain < NUM_DOMAINS, AEE_EBADPARM); before return SUBSYSTEM_NAME[domain]; at line 147 |
| 🔴 HIGH | inc/fastrpc_domain_watcher.h:44 |
var-002 |
Function pointer handle_event_fn not validated before call | Callers of handle_event_fn must check if (cfg->handle_event_fn) cfg->handle_event_fn(name, appeared); before invoking |
| 🟡 MEDIUM | src/adsp_default_listener.c:63 |
mm-002 |
malloc(uri) without free on all error paths | Ensure free(uri); is called in all error paths after malloc at line 86 |
| 🔴 HIGH | src/adsp_default_listener.c:86 |
mm-003 |
Missing NULL check after malloc | Change line 86-88 to wrap malloc in VERIFYC: VERIFYC(NULL != (uri = (char *)malloc(len)), AEE_ENOMEMORY); |
⚠️ Diff truncated (>60 KB) — review may be partial.
To suppress a false positive: add an entry to
.qvigor/review_feedback.jsonon thedevelopmentbranch with"decision": "denied".
Ekansh Gupta (ekanshibu)
merged commit Nov 29, 2026
0b2374d
into
qualcomm:development
33 of 40 checks passed
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.
This series adds dynamic FastRPC domain discovery: instead of a fixed, compile-time table of DSP domains, the host now discovers live /dev/fastrpc-* nodes at runtime and builds domain info (type, instance, name) from them, so new or variable DSP instance counts work without
hardcoding. The new remote_system_request() API exposes this to clients that need current domain/capability info instead of static config. On top of that, HPASS is classified as a capability of the adsp family (HVX 64B/128B support + ARCH_VER ≥ v81) rather than a separate
device-node family, and audiopd is generalized to connect to any adsp instance whose image config has spare audio capacity.
fastrpc: fix buffer overread and leak/misroute gaps unrelated to dynamic domains
fastrpc: add remote_system_request() and dynamic domain discovery
fastrpc: add DSP_IMAGE_CONFIG attribute and per-instance HPASS/NSP shell fallback
fastrpc: add domain status notification support
fastrpc: add systemd units for the secondary HPASS/NSP instances, restore legacy flat unit names
fastrpc: fix effective-domain validation and extend ARCH_VER path caching to dynamic domains
fastrpc: split domain discovery into generic watcher + devnode backend
fastrpc: start the audiopd daemon on every adsp instance
CRs-Fixed: 4761369