Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp4107717imj; Tue, 12 Feb 2019 09:54:26 -0800 (PST) X-Google-Smtp-Source: AHgI3IbCiwlyD3cFbykfpMixtSOsFpVD61+n1dR3H5zTEKegPFeuQApUVfYnbb4MxS/80Sqi9gN5 X-Received: by 2002:a17:902:d01:: with SMTP id 1mr5230088plu.127.1549994066083; Tue, 12 Feb 2019 09:54:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549994066; cv=none; d=google.com; s=arc-20160816; b=NvC82NS6Z9zKEXM8RSFdcmGXsreaCa2MD11FKmG3mP8AULF68QVcJETBMMsUzNXUoM HXjMMcvn7k1xxZsUa8V156yrijm4xSHZ2Ay3nI92C+hwUl6P8NOc2E+c4fmUKKKAnELG 2CdUd0OkN0+mqHcB+X2ubo2hA5NGDaPasXXjf5LqoHtiF2Dyg8JMhQkatH+jhdBCxtex yTdsBcA04AWQXtciiTTQ68EV46Jgt1CHnXYjDbMaJlIWPTpBq+foCwdOqWrSdlvexOQh smI/C+tFCC+b/Uilz+8g5uLf3Z6x2uv1fjkdkEfb4ZKgrn1eCmolWdcoT0lFwRzMmCmT zSAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=W8CQc4Bk9VZggMxcqtKQUPDKdND8nM9k5Iy/PFot+UE=; b=g142qIQ8l1myuShdqJajp8HPJf9tlkaxfvb/ZtBIMqe2dFsLdLM5cijWBIQrY7oYZr +83AXfyXxsyQYAlE+td23AsNzSi6ZG3WkXSvhIqHh0EibYZ3P6LR5kx4YeKvxGveQPAd G6qXX0t3cH7Lvf3axPE1BvN/gMxeb7gDn6sCRbiPBciurkCHe2QMY2HEJ/ff+HtB9dIf mdallNuWPvczRJSblmpI0EGWXY+bzWkJVcGxUC5ygJrEW38CCX9ZaI4WkVnlZ8K+4dTp +o42RoypGzdkk7I+gf3BVGLRnGBmQM2Xf4uNc9Wrc7ch3Dlub3KHJhxk9YMl3b7KtQuv AwgQ== 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 t11si3445182pgp.209.2019.02.12.09.54.09; Tue, 12 Feb 2019 09:54:26 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728690AbfBLRtp (ORCPT + 99 others); Tue, 12 Feb 2019 12:49:45 -0500 Received: from bmailout2.hostsharing.net ([83.223.90.240]:37209 "EHLO bmailout2.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728027AbfBLRtp (ORCPT ); Tue, 12 Feb 2019 12:49:45 -0500 Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (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 bmailout2.hostsharing.net (Postfix) with ESMTPS id 57F622800B1DF; Tue, 12 Feb 2019 18:49:43 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id EC961160E1D; Tue, 12 Feb 2019 18:49:42 +0100 (CET) Date: Tue, 12 Feb 2019 18:49:42 +0100 From: Lukas Wunner To: Mika Westerberg Cc: linux-kernel@vger.kernel.org, Michael Jamet , Yehezkel Bernat , Andreas Noever , Andy Shevchenko Subject: Re: [PATCH v2 16/28] thunderbolt: Discover preboot PCIe paths the boot firmware established Message-ID: <20190212174942.if2ene44f5m5mern@wunner.de> References: <20190206131738.43696-1-mika.westerberg@linux.intel.com> <20190206131738.43696-17-mika.westerberg@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190206131738.43696-17-mika.westerberg@linux.intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 06, 2019 at 04:17:26PM +0300, Mika Westerberg wrote: > /* dword 0 */ > hop.next_hop = path->hops[i].next_hop_index; > hop.out_port = path->hops[i].out_port->port; > - /* TODO: figure out why these are good values */ > - hop.initial_credits = (i == path->path_length - 1) ? 16 : 7; > + hop.initial_credits = path->hops[i].initial_credits; > hop.unknown1 = 0; > hop.enable = 1; [...] > @@ -78,6 +78,74 @@ static void tb_pci_init_path(struct tb_path *path) > path->weight = 1; > path->drop_packages = 0; > path->nfc_credits = 0; > + path->hops[0].initial_credits = 7; > + path->hops[1].initial_credits = 16; I guess Andreas' algorithm (the last hop in the path is assigned 16 and all the ones before are assigned 7) was reverse-engineered from Apple's driver. The fact that this algorithm works for paths of arbitrary length could indicate that Apple indeed does establish tunnels between non-adjacent switches. Also, why are these good values? (You've deleted the comment.) Thanks, Lukas