Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp8256239ybn; Tue, 1 Oct 2019 05:42:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqzIps3cLAWY8nGjyUkfleMNo5nwDx/EqfaergyzN9eJtS/NKZ8p4fAlkA8jTqNyUjJSvaTs X-Received: by 2002:a50:981b:: with SMTP id g27mr25385547edb.105.1569933720621; Tue, 01 Oct 2019 05:42:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569933720; cv=none; d=google.com; s=arc-20160816; b=Tsf+TCc3wPX5wmi6IHC5leHPUhhLAn8jYBZBibByjepU64bnCfc13q7PxPLn6fM3H1 kyECmHHNBQu5YT6ZOKExdZZ25xi3ExB3BRxghUe90DMGhuyEYB4ALb3TTyQiRInO6C2R in1KmNSkrkeRHiqPKO9lXH7usiRJYcu+41BRyQLtADVJAAWA/q7sQs+rvzA+3K75lW6e qHR3ATZsl2uy7Nmr0lsVKBEqb1fSOfzmgZCRDRUOm9CYdIiN4WO99nJLE170qb2YP74o lKcNWd5TDayQZeOWoo5AblGQaSxe6uN+dnpNNf1OUqfSqtO0fMLPyuBSArlU0QoIhaX9 rNKA== 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:dkim-signature; bh=nmUAEM26eXGODt/dcBiBVFfRHeeeGs0FiTcce91Hpy4=; b=mVKfn1CGKDmu09VENkJo82M5icoafrBoHpBB4hZ9oXngaMswhYQt5tZ0WtYcGTRmB3 +mjkE+3SEKpuoHl5iP+8Za3TsGdAmoihQ/1xfuXy4C7OE2pIKljt2ceH9wBV7wLx81DD 65nEo63pxFsUXd9cDAvarxPoyjNZKxN14/E+qoo6htY1F7BHHjTsCVwHvibJ1q0bQL03 eiXbaDdAdJMl0GZRKnNyik+ElncTyna9qDa4QxqLPOQyH0hmxxPneR38YtWtBpr+NUk7 pJmxzJS6B0nP09e/ovjd48VFEfz5+8rLskdd8F3Abm1vv838JDO5Sfws6R7O6iVIqy7A ziBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UgBRko8j; 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 e22si8386884ejr.19.2019.10.01.05.41.36; Tue, 01 Oct 2019 05:42:00 -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; dkim=pass header.i=@kernel.org header.s=default header.b=UgBRko8j; 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 S2387940AbfJAMk6 (ORCPT + 99 others); Tue, 1 Oct 2019 08:40:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:38762 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726185AbfJAMk6 (ORCPT ); Tue, 1 Oct 2019 08:40:58 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5785E20842; Tue, 1 Oct 2019 12:40:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569933656; bh=ILvLxn6jQBpRSKKm7Mvvv9Sle6/zDhJRDSEywI3wlg4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UgBRko8j4MAD/TQhQx078rO+EMRXt2mrXfb7W8fRL+cXKEWHNYrb3UDD3zoP/CYGk yNNDoTjrwG/nU/+8J6IfexmhgRWQCbFvXho2ut+yILFmUkry3v6oSbaAr4dmZVbXgT yhgjBFKRMPfafwFsY6i3DxPjccfSNLv6joNcgxwg= Date: Tue, 1 Oct 2019 14:40:54 +0200 From: Greg Kroah-Hartman To: Mika Westerberg Cc: linux-usb@vger.kernel.org, Andreas Noever , Michael Jamet , Yehezkel Bernat , Rajmohan Mani , Nicholas Johnson , Lukas Wunner , Alan Stern , Mario.Limonciello@dell.com, Anthony Wong , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 08/22] thunderbolt: Add downstream PCIe port mappings for Alpine and Titan Ridge Message-ID: <20191001124054.GC2954373@kroah.com> References: <20191001113830.13028-1-mika.westerberg@linux.intel.com> <20191001113830.13028-9-mika.westerberg@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191001113830.13028-9-mika.westerberg@linux.intel.com> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 01, 2019 at 02:38:16PM +0300, Mika Westerberg wrote: > In order to keep PCIe hierarchies consistent across hotplugs, add > hard-coded PCIe downstream port to Thunderbolt port for Alpine Ridge and > Titan Ridge as well. Oh, that makes me nervous, how could a hard-coded pcie port ever get set up incorrectly :) How do we "know" that this is correct? Is there any ACPI guarantees that this "always will be so"? If not, we all know someone will mess this up... > > Signed-off-by: Mika Westerberg > --- > drivers/thunderbolt/tb.c | 4 +++- > drivers/thunderbolt/tb.h | 25 +++++++++++++++++++++++++ > 2 files changed, 28 insertions(+), 1 deletion(-) > > diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c > index dbbe9afb9fb7..704455a4f763 100644 > --- a/drivers/thunderbolt/tb.c > +++ b/drivers/thunderbolt/tb.c > @@ -344,10 +344,12 @@ static struct tb_port *tb_find_pcie_down(struct tb_switch *sw, > * Hard-coded Thunderbolt port to PCIe down port mapping > * per controller. > */ > - if (tb_switch_is_cr(sw)) > + if (tb_switch_is_cr(sw) || tb_switch_is_ar(sw)) > index = !phy_port ? 6 : 7; > else if (tb_switch_is_fr(sw)) > index = !phy_port ? 6 : 8; > + else if (tb_switch_is_tr(sw)) > + index = !phy_port ? 8 : 9; > else > goto out; > > diff --git a/drivers/thunderbolt/tb.h b/drivers/thunderbolt/tb.h > index e641dcebd50a..dbab06551eaa 100644 > --- a/drivers/thunderbolt/tb.h > +++ b/drivers/thunderbolt/tb.h > @@ -632,6 +632,31 @@ static inline bool tb_switch_is_fr(const struct tb_switch *sw) > } > } > > +static inline bool tb_switch_is_ar(const struct tb_switch *sw) "ar"? Can you spell it out? > +{ > + switch (sw->config.device_id) { > + case PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_2C_BRIDGE: > + case PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_LP_BRIDGE: > + case PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_4C_BRIDGE: > + case PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_2C_BRIDGE: > + return true; > + default: > + return false; > + } > +} > + > +static inline bool tb_switch_is_tr(const struct tb_switch *sw) Same for "tr" please. thanks, greg k-h