summaryrefslogtreecommitdiffstats
path: root/drivers/hwtracing/stm/stm.h
diff options
context:
space:
mode:
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>2015-12-22 17:25:19 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-07 22:43:17 -0800
commitc74f7e8281add80bdfa0ad2998b8df287b13df73 (patch)
treefa35e258056567f402ab9fc457c80ef9a03bbf29 /drivers/hwtracing/stm/stm.h
parent4c127fd16e6b33ecb7badc091480c84ea9aebeb6 (diff)
downloadlinux-stable-c74f7e8281add80bdfa0ad2998b8df287b13df73.tar.gz
linux-stable-c74f7e8281add80bdfa0ad2998b8df287b13df73.tar.bz2
linux-stable-c74f7e8281add80bdfa0ad2998b8df287b13df73.zip
stm class: Fix link list locking
Currently, the list of stm_sources linked to an stm device is protected by a spinlock, which also means that sources' .unlink() method is called under this spinlock. However, this method may (and does) sleep, which means trouble. This patch slightly reworks locking around stm::link_list so that bits that might_sleep() are called with a mutex held instead. Modification of this list requires both mutex and spinlock to be held, while looking at the list can be done under either mutex or spinlock. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hwtracing/stm/stm.h')
-rw-r--r--drivers/hwtracing/stm/stm.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/hwtracing/stm/stm.h b/drivers/hwtracing/stm/stm.h
index 95ece0292c99..97ee02241440 100644
--- a/drivers/hwtracing/stm/stm.h
+++ b/drivers/hwtracing/stm/stm.h
@@ -45,6 +45,7 @@ struct stm_device {
int major;
unsigned int sw_nmasters;
struct stm_data *data;
+ struct mutex link_mutex;
spinlock_t link_lock;
struct list_head link_list;
/* master allocation */