Message ID | 20190328123633.42882-21-mika.westerberg@linux.intel.com |
---|---|
State | Not Applicable |
Delegated to: | David Miller |
Headers | show
Return-Path: <netdev-owner@vger.kernel.org> X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.intel.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 44VPWt3342z9sP3 for <patchwork-incoming-netdev@ozlabs.org>; Thu, 28 Mar 2019 23:37:14 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727373AbfC1Mgs (ORCPT <rfc822;patchwork-incoming-netdev@ozlabs.org>); Thu, 28 Mar 2019 08:36:48 -0400 Received: from mga09.intel.com ([134.134.136.24]:34153 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727181AbfC1Mgp (ORCPT <rfc822;netdev@vger.kernel.org>); Thu, 28 Mar 2019 08:36:45 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Mar 2019 05:36:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,280,1549958400"; d="scan'208";a="138009665" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 28 Mar 2019 05:36:42 -0700 Received: by black.fi.intel.com (Postfix, from userid 1001) id B7BB0C91; Thu, 28 Mar 2019 14:36:34 +0200 (EET) From: Mika Westerberg <mika.westerberg@linux.intel.com> To: linux-kernel@vger.kernel.org Cc: Michael Jamet <michael.jamet@intel.com>, Yehezkel Bernat <YehezkelShB@gmail.com>, Andreas Noever <andreas.noever@gmail.com>, Lukas Wunner <lukas@wunner.de>, "David S . Miller" <davem@davemloft.net>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Christian Kellner <ckellner@redhat.com>, Mario.Limonciello@dell.com, Mika Westerberg <mika.westerberg@linux.intel.com>, netdev@vger.kernel.org Subject: [PATCH v3 20/36] thunderbolt: Deactivate all paths before restarting them Date: Thu, 28 Mar 2019 15:36:17 +0300 Message-Id: <20190328123633.42882-21-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190328123633.42882-1-mika.westerberg@linux.intel.com> References: <20190328123633.42882-1-mika.westerberg@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: <netdev.vger.kernel.org> X-Mailing-List: netdev@vger.kernel.org |
Series |
thunderbolt: Software connection manager improvements
|
expand
|
diff --git a/drivers/thunderbolt/tunnel.c b/drivers/thunderbolt/tunnel.c index 91d7e00516b4..e109578da175 100644 --- a/drivers/thunderbolt/tunnel.c +++ b/drivers/thunderbolt/tunnel.c @@ -185,8 +185,18 @@ int tb_tunnel_restart(struct tb_tunnel *tunnel) tb_tunnel_info(tunnel, "activating\n"); + /* + * Make sure all paths are properly disabled before enabling + * them again. + */ + for (i = 0; i < tunnel->npaths; i++) { + if (tunnel->paths[i]->activated) { + tb_path_deactivate(tunnel->paths[i]); + tunnel->paths[i]->activated = false; + } + } + for (i = 0; i < tunnel->npaths; i++) { - tunnel->paths[i]->activated = false; res = tb_path_activate(tunnel->paths[i]); if (res) goto err;
State of the connected devices and tunnel configuration is not known during resume. For example some paths may not be complete anymore if the user has unplugged the related devices. So instead of marking all paths as inactive we go ahead and deactivate them explicitly before we restart them. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> --- drivers/thunderbolt/tunnel.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)