Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2207706pxb; Wed, 30 Mar 2022 19:20:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOisskB5ZNwULRjHoNOf/nAC5+O/dVTE4zQcBeTP/TIIsyu9TwbTz86giBwLaGJRvsvOAf X-Received: by 2002:a05:6a00:174f:b0:4fd:aed5:b5e4 with SMTP id j15-20020a056a00174f00b004fdaed5b5e4mr1634937pfc.39.1648693241792; Wed, 30 Mar 2022 19:20:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648693241; cv=none; d=google.com; s=arc-20160816; b=rOVw72b4pEZ72qUYfhcaMhjXlnifWGOYvKi4UmR97QawW9OG5/00HDPlRIRn/Lqbze VRMzikRjz9X2wOsTaTNSTV6qCMzKNMvIM1lMwv4uA6afZhp0m8KWiabpfVdWDwO9YYHU a5sm5SHgIaX/HLI1hAjt8HPUF5UGlY+XQLowW2LZbbxt/QH1letqqeU6SlLwCgp90MoG 7poVXY9Kd1BBpZXYhPWSrf1sLAJ2Y+swZEjIvReh7rG9+K1vn7G69V5Ft85Z1+vAW7iO PSkScgyvg3zlzbut+H3xQnU8QScwCgWq2yTv4EgHFgYxWlCu6DE8lr/Z348aTMraRH5l VM6w== 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=Gl132DORdG2TdRyoAAGLNwbiQriFKSjGP/dgBfwwUDU=; b=SPvU70HOhZGagtUB/28CYBio035nnkjg6Uwg+0PhPahrdV8VmSFZuLxdISEdm/hAbk u58zjw3E8M+hlG9ZFPFiUjZI2mv/zU0o0+KpohOfJRn7wzm++te5izP7KqXJD4FXCJlL 5mkclbcg04cbrg0Ru8SS63Jm2DlX4dgnuJFDY5H7aLdMswQeLpUVucqc+5lYHIyhPsFq FYRIlMdzOzY7EaayIE8151I2hrx4eInWEfvR8t8TE0p+4/CcYasa180P2o/Z1BMfsCNW qLcPlOjBSLtC053URnZbqrTF99olXGmzpdykiLkeOnMwrH3qNsRExqa0F/O8L1UbwR3D yKeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Lv7LoKRA; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id n22-20020a056a0007d600b004fa3a8dffb5si21513545pfu.108.2022.03.30.19.20.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 19:20:41 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Lv7LoKRA; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E83D26928C; Wed, 30 Mar 2022 19:20:39 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346259AbiC3NqV (ORCPT + 99 others); Wed, 30 Mar 2022 09:46:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240274AbiC3NqC (ORCPT ); Wed, 30 Mar 2022 09:46:02 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 853536A04F for ; Wed, 30 Mar 2022 06:44:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648647857; x=1680183857; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=QXl8+YAIyOXHsNHqZZUA3VDYNTjmspExAM2i0woDO4M=; b=Lv7LoKRAVnNhelooukUsudrk5Ia8PT0gD3Vfq9F1qdXyw4eE8BsWTQ+s RUzYJZMSeSSDeUDu3066aTn2wCYpN23mqxKTq7pVp6874gqB1zWSUnsbc Hel83aBH7BarAyJGN+jDmkThJ+Ecj9tOBRoSocgzSVVLCfmgfEPaa9coz o/D2OAVgFu5sxWOE7Z1Eaj+332UydhWO15GDhp7IGVjwTtRL2g0BPe22D kcE3GZHRw2cMlMGJDJcnKhE4+FXLh1GXDeiszZZ/iYv+pOIDNI30PRhLE 1WK8or8Ic7P1uhQVL5kj1nYmK8T01MxylO6s42lL1Swvv4uk04C5XYZEE w==; X-IronPort-AV: E=McAfee;i="6200,9189,10301"; a="259518002" X-IronPort-AV: E=Sophos;i="5.90,222,1643702400"; d="scan'208";a="259518002" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2022 06:44:17 -0700 X-IronPort-AV: E=Sophos;i="5.90,222,1643702400"; d="scan'208";a="788011712" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.162]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2022 06:44:15 -0700 Received: by lahna (sSMTP sendmail emulation); Wed, 30 Mar 2022 16:43:08 +0300 Date: Wed, 30 Mar 2022 16:43:08 +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=-1.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 09:19:52PM +0800, Brad Campbell wrote: > Hey Mika, > > On 30/3/22 18:18, Mika Westerberg wrote: > > Hi, > > > > On Tue, Mar 29, 2022 at 10:06:35PM +0800, Brad Campbell wrote: > >>> Indeed, I did not add this to the "discovery" path yet. > >>> > >>> I wonder what happens if you change this: > >>> > >>> + tunnel = tb_tunnel_alloc_dp(tb, in, out, available_up, available_down, > >>> + first ? 0 : 1); > >>> > >>> to this in your tree: > >>> > >>> + tunnel = tb_tunnel_alloc_dp(tb, in, out, available_up, available_down, > >>> + first ? 1 : 0); > >>> > >> > >> Here's where it gets all "Apple..y". On the iMac this does the job no matter which > >> port the chain is plugged into. Boots and displays correctly first time, every time. > >> > >> It turns out on the laptop, one port works and the other doesn't. Changing the order > >> simply changes which port works. So I assume the EFI sets up the first display using > >> the first lane if it's in the first port, and the second if it's in the second. > >> > >> That means had I managed to perform the first test in the "other port" consistently, > >> it would have worked there also. > > > > Can you try the below patch too? I hard-code the lane based on the > > DP adapter number in TBT gen1. > > > > Let's first figure out proper solution to this issue and then look at > > the other one. > > > > diff --git a/drivers/thunderbolt/tunnel.c b/drivers/thunderbolt/tunnel.c > > index a473cc7d9a8d..97d36a7bb527 100644 > > --- a/drivers/thunderbolt/tunnel.c > > +++ b/drivers/thunderbolt/tunnel.c > > @@ -865,6 +865,7 @@ struct tb_tunnel *tb_tunnel_alloc_dp(struct tb *tb, struct tb_port *in, > > This one works from cold boot on both machines regardless of the port the chain is plugged into. > It fails on both machines on any hotplug with the symptoms of allocating them both the same link. > I added an extra debug into tunnel.c and verified that. Hm, okay. What if you change this: link_nr = in->port == 11 ? 1 : 0; to this link_nr = in->port == 11 ? 0 : 1; Please also keep the debugging you added too so we can see if it now uses both lanes.