]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ASoC: SOF: ipc3-dtrace: Add helper function to update the sdev->host_offset
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Fri, 10 Jun 2022 08:01:18 +0000 (11:01 +0300)
committerMark Brown <broonie@kernel.org>
Fri, 10 Jun 2022 12:31:46 +0000 (13:31 +0100)
commitb66f9e703f0bee4e1aa7010299914b7b2009b4e0
treea128cd27136d1528dbb42c3783a25ce15cd7959a
parent135786c32ed057068bec56f67a54064cfc845bde
ASoC: SOF: ipc3-dtrace: Add helper function to update the sdev->host_offset

We are using the READ_ONCE() on the debugfs read path for accessing
sdev->host_offset, but the set is not atomic or protected in any way.

Add a small helper to do the host_offset update and be really paranoid
about the a possible race in update

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20220610080119.30880-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/ipc3-dtrace.c