aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/soundwire
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>2019-12-11 19:45:06 -0600
committerVinod Koul <vkoul@kernel.org>2019-12-12 09:17:07 +0530
commit4da0680f24c9af2de8406ded68c4ef967f448de3 (patch)
tree1e31712c8ad7dbfdf5ac3bf02fd01bf6af8f5854 /include/linux/soundwire
parentsoundwire: intel: add prototype for WAKEEN interrupt processing (diff)
downloadwireguard-linux-4da0680f24c9af2de8406ded68c4ef967f448de3.tar.xz
wireguard-linux-4da0680f24c9af2de8406ded68c4ef967f448de3.zip
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 serialized. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20191212014507.28050-11-pierre-louis.bossart@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'include/linux/soundwire')
-rw-r--r--include/linux/soundwire/sdw_intel.h2
1 files changed, 2 insertions, 0 deletions
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 */
};
/**