Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3788056imm; Mon, 18 Jun 2018 04:11:25 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKJ/PnySyJvnmleUtIxrK6KT5pnzdyC7l4HQSwmIdU8//A461t6wLPYe46UZD7qpnTbL7q+ X-Received: by 2002:a62:ecdb:: with SMTP id e88-v6mr13218366pfm.16.1529320285694; Mon, 18 Jun 2018 04:11:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529320285; cv=none; d=google.com; s=arc-20160816; b=bfPuUEpXiOqwdfW2WcKV+H8OERqbhWf0URgpeZJDUHBkes2izcLXwBQAsfCwhxVeYX Rh+cv5bDCyaW4bgF97oC+DB6r3sHz6j9VqmELFFVLu48QlowGgOZBtuisDkSVnuXugSu o2OTpNJ1RoSTbqlSuBIRuB0DvkgcPO9l4R+CiGJhXaVYtFuK3j8t2ehw6P2+XZ9BU7WW 1QEH1JekWzp4h+gpjNRcrbTG605lPb6BPpJEeO8wTVe7SXundaPfpF/HL+KW+iOj5zUI ocU8XeREIkC+RDg2+d069icsvveV1HGvsHlV0tIZ/15cVP/BLUYjt+xV/8f+mZFbxmO5 D3kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=XYcdpsU58S9S7PWD9BJlfSHo+w8SlZH5S23MijdCkDQ=; b=y1RRCRrv5Y+H6N3IBcix4/zbyp4vmDEbcGN0fo7zRtyUWpopQWH9BHXTl/HfQF7eE6 hWUG/uqIGOXdhedpgx5v7Q/N9eckg+5alr9pWcIY2fAbwCAQD7e8njZ18BvaayzvcQ+8 MIlH7h7taiF9IDtkpK6o7nWzHoSrYjaQx5MtT5aH5vXxAhj8iHOZOuzRpttKYTy585/G JBdxGyAsNjp6HBQISkIVL1bMgH4Zy9pCXS4C8+RED3piVaoL/a7BEFTMhvuO+zs8pdMB wiAjy70x2PI4feF0ZYX4nMlSItQU+8Fsz2n9DMnTGvlhLqUx2mVJTXm880v1pmJovq7n PrGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z20-v6si14649730pfl.209.2018.06.18.04.11.11; Mon, 18 Jun 2018 04:11:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755287AbeFRLI6 (ORCPT + 99 others); Mon, 18 Jun 2018 07:08:58 -0400 Received: from mga14.intel.com ([192.55.52.115]:37633 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934643AbeFRLHd (ORCPT ); Mon, 18 Jun 2018 07:07:33 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jun 2018 04:07:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,238,1526367600"; d="scan'208";a="233457948" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga005.jf.intel.com with ESMTP; 18 Jun 2018 04:07:30 -0700 Received: by black.fi.intel.com (Postfix, from userid 1001) id 9FABD519; Mon, 18 Jun 2018 14:07:31 +0300 (EEST) From: Mika Westerberg To: linux-kernel@vger.kernel.org Cc: Andreas Noever , Michael Jamet , Yehezkel Bernat , Lukas Wunner , "Rafael J. Wysocki" , Christian Kellner , Mario Limonciello , Mika Westerberg Subject: [PATCH 3/5] thunderbolt: No need to take tb->lock in domain suspend/complete Date: Mon, 18 Jun 2018 14:07:29 +0300 Message-Id: <20180618110731.57427-4-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180618110731.57427-1-mika.westerberg@linux.intel.com> References: <20180618110731.57427-1-mika.westerberg@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/thunderbolt/domain.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/thunderbolt/domain.c b/drivers/thunderbolt/domain.c index 6281266b8ec0..b34e7f118fcf 100644 --- a/drivers/thunderbolt/domain.c +++ b/drivers/thunderbolt/domain.c @@ -505,26 +505,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); } /** -- 2.17.1