[lkml]   [2019]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH v5 10/11] soundwire: intel: add mutex for shared SHIM register access
Some of the Intel SoundWire SHIM registers contain fields for
different links. Without protection, the master drivers for the
different links will access these shared registers, leading to invalid
configurations and timeouts (specifically when changing CPA/SPA
power-related registers and polling for the changes to be applied).

A mutex is added to make sure all rmw access to those registers are

Signed-off-by: Pierre-Louis Bossart <>
include/linux/soundwire/sdw_intel.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/include/linux/soundwire/sdw_intel.h b/include/linux/soundwire/sdw_intel.h
index 073121c49695..45fa6d93197f 100644
--- a/include/linux/soundwire/sdw_intel.h
+++ b/include/linux/soundwire/sdw_intel.h
@@ -71,6 +71,7 @@ struct sdw_intel_link_res;
* @links: information for each link (controller-specific and kept
* opaque here)
* @link_list: list to handle interrupts across all links
+ * @shim_lock: mutex to handle concurrent rmw access to shared SHIM registers.
struct sdw_intel_ctx {
int count;
@@ -79,6 +80,7 @@ struct sdw_intel_ctx {
acpi_handle handle;
struct sdw_intel_link_res *links;
struct list_head link_list;
+ struct mutex shim_lock; /* lock for access to shared SHIM registers */

 \ /
  Last update: 2019-12-12 02:46    [W:0.062 / U:52.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site