Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2050923imm; Sun, 9 Sep 2018 14:47:14 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZO4yHvo/mFQmEETNkryH0B8qsZ8pbJNleoo/nSeJtbLlmkZ6tIdatnt+bFXs7zJ2ijr8qy X-Received: by 2002:a63:d002:: with SMTP id z2-v6mr19663647pgf.262.1536529634309; Sun, 09 Sep 2018 14:47:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536529634; cv=none; d=google.com; s=arc-20160816; b=Me4yrY+u+m31Z2DMmtvlH0a6zMSlnfAScU/wydL9iQuGqw5GPXT0nCiIYVyAxKQZzi eBZPNMDbOQSUtOGRfRw1POY4O3J4ikPdIT3mXqpfPrWTL6HroInCsl7wKvmHqU5cSNZ2 wfIk5gQ3qXRPkf9QYGKInCA2GSh3GbjyWj8HRxi6+X3WfPiCCSMqtCv8O6AFXBADUcDt 6UTxi5fHQLcnHf7fxxttO7GUC4w6hbSrDoQfZoDt1tfO5KHdt3WCDqRQQ8W1OjELjUhB 6PrCGjBxDOE9Hrx/ayN2BkUZ6//lYkgBvOJzD3CcTK+zJ3mDXZndSEnpCueT12c0XiAr mdNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:date:from:references :in-reply-to:message-id; bh=FSD4rhiizN2NZtZ/4ddS3t1Z6KLOUN1xfVBVVoyEa9A=; b=Wk64FBdlaLEQP5XFnr0JGitemOcnYqNtBsqx1s4NOKYqQIzn3RBTrkT5UJdt3OyjHt 1rZYC11U2ftZbRoheh+jURy8/d6BVHRtFd9D8IXMkWAfQAPeG5GI5irqLzaYeNezEaMe +dNz4gObMupFIaEW/uIIvyeAo4ZVXrlFo2F56k6puvSPumor5S0cH8j9fORPzBPYtwxD vD93VSNUUFW9d7YDprzD0MQkFAX63YxPhGhaKTAByutYxIpbPtFu7n/pcrK/OxGrTF3v Iqy+3V9GocHCBWTlibFJnYAgG3XG/uXV1jqs55r8PEGLrw3YMYITOmcV6uYueZCzdd25 zVag== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cf16-v6si15854028plb.254.2018.09.09.14.46.59; Sun, 09 Sep 2018 14:47:14 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726839AbeIJCew (ORCPT + 99 others); Sun, 9 Sep 2018 22:34:52 -0400 Received: from bmailout1.hostsharing.net ([83.223.95.100]:44717 "EHLO bmailout1.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726767AbeIJCew (ORCPT ); Sun, 9 Sep 2018 22:34:52 -0400 Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id AAE3930000892; Sun, 9 Sep 2018 23:43:46 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 6A4684F36; Sun, 9 Sep 2018 23:43:46 +0200 (CEST) Message-Id: <22a6630e04940f942dbcd739275141d4c6cff17d.1536517047.git.lukas@wunner.de> In-Reply-To: References: From: Lukas Wunner Date: Sun, 9 Sep 2018 23:42:01 +0200 Subject: [PATCH 1/5] thunderbolt: Skip disabled ports on tunnel establishment To: Andreas Noever , Mika Westerberg , Michael Jamet , Yehezkel Bernat Cc: Stephen Hemminger , linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If a PCIe downstream adapter is marked disabled in the DROM, that port is ineligible for tunnel establishment, so skip over it when searching for an unused port. Signed-off-by: Lukas Wunner --- drivers/thunderbolt/tb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c index 1424581fd9af..0da2e7a06ab5 100644 --- a/drivers/thunderbolt/tb.c +++ b/drivers/thunderbolt/tb.c @@ -147,6 +147,8 @@ static struct tb_port *tb_find_unused_down_port(struct tb_switch *sw) int res; int data; for (i = 1; i <= sw->config.max_port_number; i++) { + if (sw->ports[i].disabled) + continue; if (tb_is_upstream_port(&sw->ports[i])) continue; if (sw->ports[i].config.type != TB_TYPE_PCIE_DOWN) -- 2.18.0