]> git.baikalelectronics.ru Git - kernel.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)
commit43963f947b865362f53c8ae979ef30a9b68a3f8e
treefb6d5d7973c2afdec6ca5d63f95c740c76dd21de
parent73fff9c76bb1e0cd22ad725205112f6ac92061e2
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