Received: by 2002:ac0:8c8e:0:0:0:0:0 with SMTP id r14csp592342ima; Wed, 6 Feb 2019 05:20:54 -0800 (PST) X-Google-Smtp-Source: AHgI3IaouNuiMrCTcfR7MCs/ZVaK/lPqi7xEMM1MrzoZpreiyMq7IM1xVUeupL+hsu1SehzRs8dR X-Received: by 2002:a17:902:8d95:: with SMTP id v21mr10749894plo.162.1549459254392; Wed, 06 Feb 2019 05:20:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549459254; cv=none; d=google.com; s=arc-20160816; b=m0cwVzdX82WBSeeCU3yL85fyYpfhrDmSyb5DVkABE4kMdAvlqR7j3akIsaSZRJUbdW DEqkptIDIaLTCfmh5EkLNyNJr0bccW687/jii2mJtjSbuhRX5IsKI0nHUgGLGIrivPAJ 6OkqBGaBTTyJ7EcuEBqUNnTGo6siqC21hBl7u3bAYKKRkrdpMXz+cCnDydoLMsIrX3dJ 7dRnHKCQZJ0EUd97zDtRIlfAd/vdcIVQvpUOPaaS/M9cAlTldNrYiKPizb0t19EQY3cX iiNEWf800EmXuHDBoqLLwtIGyUlHIytOAPekC1ZaEnUU3l0qRJ10JWw1wgO6Zb7ke87g A2eQ== 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=f6uFI/0q+KarNKJkhQ+DwuvKQXQdmepCbCMY9J6BdDbj9jdeob4Mck2tr4VQvJeKZb 038Hkqm8sK/JQGYHhoHi/pVWw4Z4LCpejWBagKYupCAxFdfPNniseemMk0vLSZdWNMh7 60npo+P9dFOyHTPoLy18vuknWdvDe2PhZbk1kp8lkU4WixJyQOWrUfLqNTNgshHoKjOa JCu5yhkzsLexHHVjt01Vvj6WlJwQJSZYI5bCeV2eYE4WUy2vx4oUJk9CWvvabgjROrif uFHwLRd7pWUdliL0poyPS7n0gPZsVviz5jvtvdSEDOcJUtDrKIb5//Kz2SusrMSOs7U4 ZRcA== 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 z72si5605420pgd.149.2019.02.06.05.20.38; Wed, 06 Feb 2019 05:20:54 -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 S1730996AbfBFNTy (ORCPT + 99 others); Wed, 6 Feb 2019 08:19:54 -0500 Received: from mga03.intel.com ([134.134.136.65]:26754 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730593AbfBFNRs (ORCPT ); Wed, 6 Feb 2019 08:17:48 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Feb 2019 05:17:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,340,1544515200"; d="scan'208";a="136336029" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 06 Feb 2019 05:17:45 -0800 Received: by black.fi.intel.com (Postfix, from userid 1001) id 223FB807; Wed, 6 Feb 2019 15:17:39 +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 v2 15/28] thunderbolt: Deactivate all paths before restarting them Date: Wed, 6 Feb 2019 16:17:25 +0300 Message-Id: <20190206131738.43696-16-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190206131738.43696-1-mika.westerberg@linux.intel.com> References: <20190206131738.43696-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