Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp434395ybb; Thu, 28 Mar 2019 05:37:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9wd/BgoxCCg2YVZrTuohrSPQBStmaXMx/Ik9h7LTVcmVDuavaebX2g0Wo1jHpWhlsqhxh X-Received: by 2002:a63:c242:: with SMTP id l2mr39867596pgg.138.1553776667791; Thu, 28 Mar 2019 05:37:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553776667; cv=none; d=google.com; s=arc-20160816; b=oNfKap2CzqxfCIXug7L8L3fStk/QVPGeonw8FYzpG99wxDFYrWdKoladx8NerizR2d dhBbyuO0+lhvlultrXNAhtL9qG8IooGqH1lMqnjUDbMB/NY5fXGa4JNSOi/VVopHu2C1 KzRMaJssRjoe9VsSBZ5oRcwgkbIX9DS8BKt0XHNuOAItnbRN/ChP2z+6zxt1lyBJlzWp BgaqyQ8FSqsUsed4XB/rGN/qZpQZy51QEIdWwuPAtzAPKxJ22+rrZ7bHJnv1EtyZpqjp UhrayuUbwwRr3KZEblFd5YP8D187sO5tPLNzG/KzraD1abfngVedyG2wxRI9dpBIjSWW TR+g== 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=2wut6aHdzxJBhFCxFeO999myfF3CAV5vvo/pA0schzo=; b=HK+vLydV1Humagv646Rp1QRvhRjgLg/dZTsMRXb8uFOovJAVcrlTRmyCAyoYSzuKvn qxD6jpH5Wv4givZBq3awuSeUJ7Oj7haS+ejExu1XBCqkENyYLGvK4+gqFN47AaAC4VZb S0BTUtpg0UetAZHBB+Yp8aZ5FcaqCGbeb96whcjeTp33recUNa6LS6NJt/dkTJHgNS9G Mc8sM1yxZKR6Jmtg190GMnp0mQEmx93hn58m0Gjv3mBSAupBxQEv1YQMyblSI0n5xTlV 2IAtr1v+zXTyvJpzjZmaUsJ07ym/ZpBoSEkIIiZ9C21mr1gsdFZVRfzRcOzzepX/1Ymm rdRg== 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 cf17si23405485plb.101.2019.03.28.05.37.32; Thu, 28 Mar 2019 05:37:47 -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 S1727439AbfC1Mgt (ORCPT + 99 others); Thu, 28 Mar 2019 08:36:49 -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 ); 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 To: linux-kernel@vger.kernel.org Cc: Michael Jamet , Yehezkel Bernat , Andreas Noever , Lukas Wunner , "David S . Miller" , Andy Shevchenko , Christian Kellner , Mario.Limonciello@dell.com, Mika Westerberg , 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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/thunderbolt/tunnel.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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; -- 2.20.1