Repository navigation
Conversation
…directories The Snapdragon Sensor Core's registry service does not only read its registry: while it initialises it removes and rewrites entries, writes a temporary file next to the registry directory and renames it into place. Give hexagonfs the write side of its API for physically mapped directories (create/open for writing with O_TRUNC or O_APPEND, write, ftruncate, unlink, rename across mapped directories) and report S_IWUSR in stat so the framework sees writable files. Virtual directories and the read-only backends keep returning ENOSYS, so a tree that maps read-only system files (/usr/share/qcom) stays untouched: the writable directory is whatever the daemon is pointed at with -R. Link: linux-msm#19 Signed-off-by: Fady <me@fadyackad.dev>
Implement the apps_std methods the sensor framework's registry initialisation calls (ids as in quic/fastrpc inc/apps_std.h: fopen 0, fwrite 5, fsync 23, fremove 24, ftrunc 32, frename 33; ids above 30 travel in the first primitive word), open w/a/+ modes read-write, and let fopen_with_env open an absolute name whatever search variable the DSP names. Refusing the first write (fremove, then fopen of the DIR marker for writing) made the X1E80100 firmware assert in sns_registry_sensor.c and take the whole ADSP down. Unlike the stubs proposed in pull request 21, the writes reach the files, so what the framework persists (its parsed registry, calibration) is there at the next start. Link: linux-msm#19 Link: linux-msm#21 Signed-off-by: Fady <me@fadyackad.dev>
…than 256 bytes A request the server cannot serve is answered with AEE_EUNSUPPORTED/AEE_EBADPARM and empty output buffers instead of ending the session, so the DSP sees a failed call rather than a vanished listener. Requests whose input buffers exceed the 256 bytes adsp_listener_next2 inlines (the framework writing its secure database in one call) are completed with adsp_listener_get_in_bufs2 from offset 256, as Qualcomm's listener_android.c does; the method's definition follows quic/fastrpc inc/adsp_listener.h (index 5). Link: linux-msm#19 Signed-off-by: Fady <me@fadyackad.dev>
…rsist exists The framework writes /persist/sensors/registry/fstempfile and renames it into /persist/sensors/registry/registry, and it looks for sns_reg_version and parsed_file_list.csv next to the registry directory (it creates sns_reg_version through that temporary file when the file is missing). With DIR/sensors/persist/ present that directory backs the whole of /persist/sensors/registry, its registry/ subdirectory being the registry; without it the tree is as before. Link: linux-msm#19 Link: linux-msm#21 Signed-off-by: Fady <me@fadyackad.dev>
…he registry
hexagonfs_openat hands out a second file number when a name's directory part resolves to an already-assigned descriptor (".", "..", "/"), so the close in create/unlink/rename freed one still held elsewhere; hexagonfs_close now destroys only on the last reference, and fastrpc_apps_std_deinit closes descendants before the root. mapped_or_empty pointed write and truncate at implementations that dereference a NULL context for an absent directory. outbufs_calculate_size padded zero-length buffers outbufs_encode never writes, and alloc_outbufs4 did not skip the method id extended methods carry in the first primitive word. A '+' mode no longer implies O_CREAT and falls back to a read-only open on an unwritable tree, stat reports the write bit only when the backing file has it, mapped writes loop until done, and the persist layout is probed at DIR/sensors/persist/registry rather than its parent.
Signed-off-by: Fady <me@fadyackad.dev>
FadyAckad
force-pushed
the
sp11-sensors
branch
from
September 21, 2026 09:26
8c5fa10 to
40e5041
Compare
FadyAckad
marked this pull request as ready for review
September 21, 2026 10: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.
Implements the write side of apps_std/hexagonfs so the Snapdragon Sensor Core can
initialise its registry, which is what #19 is blocked on. Unlike the stubs in #21,
the writes actually reach the files, so what the framework persists — its parsed
registry, calibration — survives a restart.
The work is split as:
hexagonfs:create, write, truncate, unlink and rename for mapped directories.Virtual and read-only backends keep returning ENOSYS.
apps_std:serve fopen, fwrite, fsync, fremove, ftrunc and frename (ids perquic/fastrpc
inc/apps_std.h; ids above 30 travel in the first primitive word).listener:answer unsupported requests with an error and empty output buffersinstead of ending the session, and fetch input buffers longer than the 256 bytes
adsp_listener_next2inlines, viaadsp_listener_get_in_bufs2.rpcd_builder:whenDIR/sensors/persist/registryexists, back the whole of/persist/sensors/registrywith it; otherwise the tree is unchanged.this branch and reproduce on main:
fastrpc_apps_std_deinitfreeing the rootdescriptor before its descendants, and
outbufs_calculate_sizepaddingzero-length buffers that
outbufs_encodenever writes.Open question: how much of the tree should be writable
The write ops are on the shared mapped ops tables, so they reach every mapped
directory, not just the registry — including
DIR/dsp/<dsp>andDIR/acdb. Nothingcan be written today because hexagonrpcd runs as
fastrpcagainst a root-owned/usr/share/qcom, but making the registry writable to that user is precisely whatthis feature needs, and that exposes the rest of the tree at the same time.
This is the same concern raised in #21 about a mutable hexagonrpc. Options seem to be
a separate read-write ops table used only by the registry mapping, or the copy-to-
/var/lib/hexagonrpcidea from that thread. I'd rather settle it here than after itships — opinions welcome.
Testing
Developed against X1E80100, where refusing the first write made the firmware assert
in
sns_registry_sensor.cand take the ADSP down. #19 is Milos (SM7635), which Ihaven't tested — confirmation there would be valuable before merging.
Fixes are covered by the existing suite plus targeted checks;
ninja testpasses.