]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
thunderbolt: No need to take tb->lock in domain suspend/complete
authorMika Westerberg <mika.westerberg@linux.intel.com>
Tue, 28 Aug 2018 06:43:00 +0000 (08:43 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 5 Sep 2018 13:15:48 +0000 (15:15 +0200)
BugLink: https://bugs.launchpad.net/bugs/1789358
If the connection manager implementation needs to touch the domain
structures it ought to take the lock itself. Currently only ICM
implements these hooks and it does not need the lock because we there
will be no notifications before driver ready message is sent to it.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 84db68587651d453a9b5e901c787a49866e34b1e)
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Acked-by: Hui Wang <Wang <hui.wang@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/thunderbolt/domain.c

index a923ebdeb73c80bf845af7acc90dcc20a9c2ce1b..e377128663e9b9592896e05cf3d2a23c2a8f2ab7 100644 (file)
@@ -509,26 +509,13 @@ int tb_domain_resume_noirq(struct tb *tb)
 
 int tb_domain_suspend(struct tb *tb)
 {
-       int ret;
-
-       mutex_lock(&tb->lock);
-       if (tb->cm_ops->suspend) {
-               ret = tb->cm_ops->suspend(tb);
-               if (ret) {
-                       mutex_unlock(&tb->lock);
-                       return ret;
-               }
-       }
-       mutex_unlock(&tb->lock);
-       return 0;
+       return tb->cm_ops->suspend ? tb->cm_ops->suspend(tb) : 0;
 }
 
 void tb_domain_complete(struct tb *tb)
 {
-       mutex_lock(&tb->lock);
        if (tb->cm_ops->complete)
                tb->cm_ops->complete(tb);
-       mutex_unlock(&tb->lock);
 }
 
 /**