]> asedeno.scripts.mit.edu Git - linux.git/commit
ASoC: SOF: force end-of-file for debugfs trace at suspend
authorKai Vehmanen <kai.vehmanen@linux.intel.com>
Fri, 24 May 2019 19:23:06 +0000 (14:23 -0500)
committerMark Brown <broonie@kernel.org>
Tue, 28 May 2019 14:52:34 +0000 (15:52 +0100)
commitec9025e5d3c5b5f2027fa74be6afdaad9908b546
treefb6d5d7973c2afdec6ca5d63f95c740c76dd21de
parentf627b0524ccf993b646bd56f9bdacc973c8c39cc
ASoC: SOF: force end-of-file for debugfs trace at suspend

Current trace implementation gets out of sync when sof device
is put to suspend. The debugfs file handle is kept open, but
firmware will reset its state. After resume, debugfs client's
read offset will not be synchronized to firmware and this may
result in traces read in incorrect order and/or stale data being
read after resume.

Add logic to signal end-of-file to read() when firmware tracing
has ended, and all trace data has been read. This allows debugfs
client to capture all trace data, and reopen the trace file to
ensure proper synchronization with firmware after reopening
the node.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/sof-priv.h
sound/soc/sof/trace.c