Commit Graph

10 Commits

Author SHA1 Message Date
Evan Green
b08ef6f98e Use fdatasync instead of O_SYNC on storage
Opening the backing files with O_SYNC makes things really slow. So slow
in fact that the modem times out after 10 seconds waiting for the last
EFS sync to go through. I think this takes forever because rmtfs is
doing 512-byte reads and writes.

One option would be to make this bigger. But a better option is to not
use O_SYNC, but explicitly do an fdatasync() after the iovec operation
is complete. This is better because 1) it's way faster, we no longer see
10-12 second delays at rebooto time, and 2) partial syncs of the EFS
file aren't useful anyway.

Use fdatasync() as opposed to fsync() since it's not important for the
metadata to be synced, just the file contents.

Signed-off-by: Evan Green <evangreen86@gmail.com>
2021-08-09 14:33:25 -07:00
Sibi Sankar
976aa0ddbe rmtfs: Sync rmtfs server with rproc instance
Add sigterm/sigint handlers to enable graceful rmtfs server
bringdown on first instance of SIGINT/SIGTERM. Start/Stop the
remoteproc instance on RMTFS service up and SIGINT/SIGTERM
respectively. Force quit on second instance of SIGINT/SIGTERM.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
[bjorn: Pipe for event loop signaling, reworked /sys traversal]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-07-19 00:24:35 -07:00
Bjorn Andersson
42edb9c07a storage: Support operating on raw partitions
Most devices has partitions named modemst1, modemst2, fsg and fsc
backing the rmtfs. Add a new argument '-P' to get the storage
implementation to use these partitions directly instead of files.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-07-17 12:23:19 -07:00
Bjorn Andersson
c35633ab23 storage: Allow read only backing storage
Add a new argument '-r' to prevent writes back to the backing storage.
This is useful for experimenting with the remote storage, without having
the files overwritten.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-07-17 12:23:02 -07:00
Bjorn Andersson
e6d703b3c8 storage: Revise API
Pass "struct rmtfd" instead of file descriptors in the interface. This
cleans up the api a little bit, but more importantly allow us to
associate additional things with the remote file descriptors.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-07-17 12:22:26 -07:00
Bjorn Andersson
886608484b rmtfs: Use pread/pwrite for storage
Instead of relying on an initial lseek, use pread/pwrite. This creates a
cleaner interface towards the storage.c implementation, allowing us to
provide a memory-only implementation of the backing storage.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-07-17 12:22:26 -07:00
Evan Green
cfb76ff6ee storage: Allow specifying the storage directory
Enable the specification of storage paths other than /boot, using
a new -o command line argument. Getoptify the command line arguments
for better processing.
2018-12-19 09:21:06 -08:00
Bjorn Andersson
c7822e84b1 rmtfs: Extract rmtfs mem IO operations
Rather than exposing a pointer to the mmapped memory and performing IO
directly on this address pass the data through a local buffer and move
the reading and writing of memory into the sharedmem module.

This allows us to support shared memory that is not memory mapped in the
future.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-07-28 16:26:09 -07:00
Bjorn Andersson
6b7646c45f rmtfs: Move rmtfs_mem data to struct
Introduce a struct to pass around the parameters related to the rmtfs
memory, in preparation for supporting multiple memory regions.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-07-28 16:21:15 -07:00
Bjorn Andersson
1f12cea75b rmtfs: Initial rmtfs implementation
The rmtfs tool pushlishes the two QMI services "rmtfs" and "rfsa", and
implements the necessary requests for rmtfs that's needed to boot the
modem subsystem on a Qualcomm based board.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2016-02-07 09:32:14 -08:00