Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4761410imu; Tue, 29 Jan 2019 07:07:22 -0800 (PST) X-Google-Smtp-Source: ALg8bN5SbHFhBmV3L7fSr7vNgEhqfwhRKS0kWb5iFUJAtoGVXMhjiaN72wIhL2IcfYBPDpgvKBxW X-Received: by 2002:a62:520b:: with SMTP id g11mr26962966pfb.53.1548774442861; Tue, 29 Jan 2019 07:07:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548774442; cv=none; d=google.com; s=arc-20160816; b=PrUNsARyHVGk3Gh8PYfQd4bHGbrUi8xizleLQWO5etklfO5qvne4M3lvbyAFiYIYQM ToVcJok3UyaxcUuwQyn4ILTsKzkQ3drGfnj60zA0oIV/VOEVniZ4tp+TJI/zF2khkHZq k8Y190gD9FKpg70l9ygzoba92aLIBvQYnTRvOw14WeS4S6EBNeGmP9FtAJkLR3/KmYQW gC4vX1dCKjUcj78Y/8HW945tJ/YhBSLCSADLRGD8J+c5aOPp7d0uqQw8pQCiUgqJ+TCq N5OsU0QONA2MIiip2SRcA3FcmfECEaAd12fA1bCcnNnMwHkLl8Ev1kMiaIZeG98TVz9k IbJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=wJdCGcKVZwfPHjbH6yPCRoFGUVMIGMSHeJHQrQRv6GU=; b=rxJBono+YOmD0hJJ6ZFos3KX+MLB2CDihUzuq+LOBEX3g38JrlBExBh7SbiBtAX9T5 7wvIQ/D0CQMSVLWeYfINs4GospwBKZoNQgRs2YgotIpDbpWnOtbMWsHw151ukrjTPLX8 8RfSeAlBuyKrK7wQ2ss/PyDPQNxyXTgMpE0zEQ2DC9fKPNabx2KPoUHb8gGVSPwavsa4 Y1d8jA3jVSum+Ug3Vi7bl2MOJEXhX+hsDbXcGCJVVB6aCd4uMaZh0R42DFJ4WoRiYjlB ZV894zDyK1eWnmivsoBihCCIppIv7+JS1Ke+9334cHdFv43RSUEsBErA8RhOR+tSjy9d WLMw== 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 91si37020520ply.214.2019.01.29.07.07.05; Tue, 29 Jan 2019 07:07:22 -0800 (PST) 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 S1728624AbfA2PEb (ORCPT + 99 others); Tue, 29 Jan 2019 10:04:31 -0500 Received: from mga07.intel.com ([134.134.136.100]:7044 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728340AbfA2PBx (ORCPT ); Tue, 29 Jan 2019 10:01:53 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jan 2019 07:01:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,537,1539673200"; d="scan'208";a="142391818" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 29 Jan 2019 07:01:51 -0800 Received: by black.fi.intel.com (Postfix, from userid 1001) id E1DB5811; Tue, 29 Jan 2019 17:01:44 +0200 (EET) From: Mika Westerberg To: linux-kernel@vger.kernel.org Cc: Michael Jamet , Yehezkel Bernat , Andreas Noever , Lukas Wunner , "David S . Miller" , Mika Westerberg , Andy Shevchenko , netdev@vger.kernel.org Subject: [PATCH 15/28] thunderbolt: Deactivate all paths before restarting them Date: Tue, 29 Jan 2019 18:01:30 +0300 Message-Id: <20190129150143.12681-16-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190129150143.12681-1-mika.westerberg@linux.intel.com> References: <20190129150143.12681-1-mika.westerberg@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We can't be sure the paths are actually properly deactivated when a tunnel is restarted after resume. So instead of marking all paths as inactive we go ahead and deactivate them explicitly. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/tunnel.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/thunderbolt/tunnel.c b/drivers/thunderbolt/tunnel.c index cdf9ca1c043e..b48c66efe87a 100644 --- a/drivers/thunderbolt/tunnel.c +++ b/drivers/thunderbolt/tunnel.c @@ -183,8 +183,15 @@ int tb_tunnel_restart(struct tb_tunnel *tunnel) tb_tunnel_info(tunnel, "activating\n"); + /* Make sure all paths are properly disabled before enable 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; -- 2.20.1