Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1796723pxb; Wed, 30 Mar 2022 10:13:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkJN3WpadUhRH/jFLOuHNdSr7fCyCTkfmI62/9r74dGy63TewpukQl69rjhnOTmDmlBprp X-Received: by 2002:a05:6870:6024:b0:da:b3f:2b16 with SMTP id t36-20020a056870602400b000da0b3f2b16mr324003oaa.181.1648660401417; Wed, 30 Mar 2022 10:13:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648660401; cv=none; d=google.com; s=arc-20160816; b=dmJfl70JcyBvMtKmHMtkiuQvC6EJrP07QcnjJRX+cRGpUUSu09d1Akw/0TiWmJwaDD dXnDbTjTC5P6UuEIWTp9e3erjNJiEMKBCq00yxquyboywRGAkzqVQszTwyLsF8bJ0GpE Be7RR51Qff6D5Z347eOgdOa/2uyGwaWgJPl+dAEa8YnPsZM97M8C8nz4aoJO3WxfLOlr eiUCYg9UG0WEB9WnQqwy3w3WRFe+TshjXGJxuPHuio14fmQR5Xk1bxkSF0Ob2WeEC7Sh m67ZuzyudU98ZSDPpLMK8QvDxIMEK7eyYhlu8xisQ5Van2VXJpaRSO6/KCjIgR8vy1/x QZpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=8gGoDCHHxzKo/Nvn3Y8TqyzrRBYvtemJAXEj53Of+EE=; b=X5+zsTIKUEFVKwh8FWasZZ7fPTUVg9SN/kWC4VESsyKAVX/1osnPKG0KrV/p13ffVy hEBNS74B+WCTcI++Fx+2JnBXOuLmRzPXUDRU7scEc0L3JCMRrX9VATK94z0Watj/ogXh kzEQMzLS+uUKuhxd3JHrV029hHeLE8Lj3RLJD9KLXH7innEMabaBZ3qVbhG1a5OaYYJ4 BvPgZUDk/iuRkAKb3ShS6m0pVPAWVkJVZTdgLphLzcmGLgFfJdqWR0Rr7PKpye57snmo 60yDfrOJ/oF3yRfrgdseR5EsIGGQZKr9ONrFCeOj9I3mhm0ma0T5TXk9XDwda72HxTFF ufGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WVT6vy6+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v19-20020acaac13000000b002ef0c3475cfsi14658683oie.79.2022.03.30.10.13.03; Wed, 30 Mar 2022 10:13:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WVT6vy6+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347143AbiC3OtT (ORCPT + 99 others); Wed, 30 Mar 2022 10:49:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243105AbiC3OtS (ORCPT ); Wed, 30 Mar 2022 10:49:18 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82F9E37A25 for ; Wed, 30 Mar 2022 07:47:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648651652; x=1680187652; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=C8bm2gOvcstjeaYZeQG+YiUBR0sB/DxJtgPFvM0gZ0Y=; b=WVT6vy6+2VvqCxswqx6oZHcP0P0uCS8gsI8FHPhXeKTuAuekOrb9YSjT nzF2+TCze3nJ3fMi7vKa8BOJGgUdp1qfcyt2BDWi/uCbs/mWqDBInc4l5 YlA4ecB+AwToAbJ5NPSElQW0rDs2mEUA78KGimkIkxRkRhYo8FSakryTg CLIz4z2Srw1FXEcKKP9zebui6QfSoycGc2jr7ejcb6OlaJ2xeCeOTKmJH XK9HppaSDswRMDDgdwynWiIJt6klRWhd+YX5r+767FMsiYETbpOdz/IyY sisPhLddhiEt4CCoyfyDxgYttht7aDfQ5/lA/R/BhRGuq9QljzOmH7TIt A==; X-IronPort-AV: E=McAfee;i="6200,9189,10301"; a="322739955" X-IronPort-AV: E=Sophos;i="5.90,222,1643702400"; d="scan'208";a="322739955" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2022 07:47:32 -0700 X-IronPort-AV: E=Sophos;i="5.90,222,1643702400"; d="scan'208";a="695122692" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.162]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2022 07:47:30 -0700 Received: by lahna (sSMTP sendmail emulation); Wed, 30 Mar 2022 17:47:27 +0300 Date: Wed, 30 Mar 2022 17:47:27 +0300 From: Mika Westerberg To: Brad Campbell Cc: linux-kernel@vger.kernel.org Subject: Re: Apple Thunderbolt Display chaining Message-ID: References: <0249a7da-9237-806b-b267-7911ad40f4a0@fnarfbargle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Wed, Mar 30, 2022 at 10:24:35PM +0800, Brad Campbell wrote: > Nope, that did the same thing. I wonder though. I'm testing it on the laptop and that reports : > [ 0.442832] thunderbolt 0000:07:00.0: Thunderbolt 2 Switch: 8086:156d (Revision: 0, TB Version: 2) > > Changing "if (in->sw->generation == 1)" to "if (in->sw->generation == 2)" on the laptop solves that. Heh, indeed I forgot that this is Falcon Ridge. > I can't test hotplug properly on the iMac due to the radeon training issue. > > The laptop still has the issue of a cold boot working in one socket > and not the other, but hot plug is working correctly. Let's try this one next: diff --git a/drivers/thunderbolt/tunnel.c b/drivers/thunderbolt/tunnel.c index a473cc7d9a8d..7150b5bc5403 100644 --- a/drivers/thunderbolt/tunnel.c +++ b/drivers/thunderbolt/tunnel.c @@ -865,6 +865,8 @@ struct tb_tunnel *tb_tunnel_alloc_dp(struct tb *tb, struct tb_port *in, struct tb_tunnel *tunnel; struct tb_path **paths; struct tb_path *path; + struct tb_port *port; + int link_nr; if (WARN_ON(!in->cap_adap || !out->cap_adap)) return NULL; @@ -883,22 +885,34 @@ struct tb_tunnel *tb_tunnel_alloc_dp(struct tb *tb, struct tb_port *in, paths = tunnel->paths; + /* + * Hard code the lane for both DP IN adapters when first + * generation hardware is present in the topology. + */ + link_nr = 1; + tb_for_each_port_on_path(in, out, port) { + if (tb_port_is_null(port) && port->sw->generation == 1) { + link_nr = in->port == 11 ? 1 : 0; + break; + } + } + path = tb_path_alloc(tb, in, TB_DP_VIDEO_HOPID, out, TB_DP_VIDEO_HOPID, - 1, "Video"); + link_nr, "Video"); if (!path) goto err_free; tb_dp_init_video_path(path); paths[TB_DP_VIDEO_PATH_OUT] = path; path = tb_path_alloc(tb, in, TB_DP_AUX_TX_HOPID, out, - TB_DP_AUX_TX_HOPID, 1, "AUX TX"); + TB_DP_AUX_TX_HOPID, link_nr, "AUX TX"); if (!path) goto err_free; tb_dp_init_aux_path(path); paths[TB_DP_AUX_PATH_OUT] = path; path = tb_path_alloc(tb, out, TB_DP_AUX_RX_HOPID, in, - TB_DP_AUX_RX_HOPID, 1, "AUX RX"); + TB_DP_AUX_RX_HOPID, link_nr, "AUX RX"); if (!path) goto err_free; tb_dp_init_aux_path(path);