Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp73805imj; Wed, 13 Feb 2019 05:00:51 -0800 (PST) X-Google-Smtp-Source: AHgI3IbmccAUbXPAytLy+a/kd7UqNH/yr9TScynLYBN95fWYzlrLH28N+eHBSujiUi0k7dfziTWP X-Received: by 2002:a17:902:7204:: with SMTP id ba4mr437343plb.186.1550062850877; Wed, 13 Feb 2019 05:00:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550062850; cv=none; d=google.com; s=arc-20160816; b=GGGt2Or2BL6JbWUF+zdXUgD5fYsdPcZKZ9hzsu6g9y307CMDIxD/iMloaVWmgV1PBT GdLc9KyE2ykPnuCB1rY902ZUP6zRyrFFDud9I7DbdvB+TkeFZNiXLrh+zaGGJNj1Qno5 0c7IVjubAd4mLkEhgUdVIJ7nAAWkO9UmpheQDRaugAYCQ/WSthv+S1FroSvotNX3pTFo AFRfxTN3JKkqGXzGkjQ2JDF4tWK78tr/2ZyTKFr+FsrEKPbql7JoiqwXc0EwckK87C1s UezTq4dvhKd8Rj7pHGQdNmRPMmGPlBDUzF9hGZWn2U88wInIO4LgD1/Mp/k2TkmduQO0 cUJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Ya+Bv8GVZ/OX3di4Ei6t1FFcnoFN8TE4CR2oW6UqStg=; b=r8T5koeQgIjYErjvX4EHqNpJIts2NweGF9lxqCPFTdkMf5Smidwx4wyWQMn9LncZ+G yta2i+PilSwegXNxACv2YZVw44LgpkVROZZnsKN9qqc8UFJVc+JvthbBsUzgetcx1LRp G0Q9vQ2YAjBP/NLaCoOUfjN6UYlZZzqxCQMm9cVIp/LM72x8gQVK+3sym8H58cCrUwgt yIaVyBo69zqfbofE1Iz3lQhowfwtKWWTh4jbQk6/2pETaWoYfruxACm3lnOBVbW6+xr3 7cgtSncK6IqEcvHKHzoHncZLhGGY0IaQJ55aq6Pcq0vcn8AUnkX1Ll/CLjAMFoScXIs9 E1TA== 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 a1si14690351pgt.332.2019.02.13.05.00.33; Wed, 13 Feb 2019 05:00:50 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390687AbfBMIaW (ORCPT + 99 others); Wed, 13 Feb 2019 03:30:22 -0500 Received: from mga14.intel.com ([192.55.52.115]:34636 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733281AbfBMIaW (ORCPT ); Wed, 13 Feb 2019 03:30:22 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Feb 2019 00:30:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,365,1544515200"; d="scan'208";a="146438540" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.157]) by fmsmga001.fm.intel.com with SMTP; 13 Feb 2019 00:30:18 -0800 Received: by lahna (sSMTP sendmail emulation); Wed, 13 Feb 2019 10:30:18 +0200 Date: Wed, 13 Feb 2019 10:30:18 +0200 From: Mika Westerberg To: Lukas Wunner 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: <20190213083018.GO7875@lahna.fi.intel.com> References: <20190206131738.43696-1-mika.westerberg@linux.intel.com> <20190206131738.43696-17-mika.westerberg@linux.intel.com> <20190212194249.2ftl2ckureow44lo@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190212194249.2ftl2ckureow44lo@wunner.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 12, 2019 at 08:42:49PM +0100, Lukas Wunner wrote: > On Wed, Feb 06, 2019 at 04:17:26PM +0300, Mika Westerberg wrote: > > +static struct tb_port *tb_port_remote(struct tb_port *port) > > +{ > > + struct tb_port *remote = port->remote; > > + > > + /* > > + * If we have a dual link, the remote is available through the > > + * primary link. > > + */ > > + if (!remote && port->dual_link_port && port->dual_link_port->remote) > > + return port->dual_link_port->remote->dual_link_port; > > + return remote; > > +} > > Yet more special-casing for dual-link ports. :-( > > > > + if (tunnel->dst_port->config.type != TB_TYPE_PCIE_UP) { > > + tb_port_warn(tunnel->dst_port, > > + "path does not end to a PCIe adapter\n"); > > Nit: I think the proper proposition is "on" or "at", not "to". > > The tunnel discovery algorithm looks solid to me, so: > Reviewed-by: Lukas Wunner Thanks! > When the module is unloaded, tb_stop() currently deactivates all PCI > tunnels. Is this still a good idea now that tunnels are discovered > on probe? We could just leave the tunnels in place and rediscover > them when the module is reloaded. If something was unplugged in the > meantime, pciehp will have disconnected the devices and we should > notice on reprobe that certain tunnels cannot be rediscovered, so no > harm no foul. Thoughts? I agree it makes sense and that's actually what we already do with the firmware CM.