Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2494726lqt; Mon, 22 Apr 2024 12:17:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUfFocKHX2oSWkEmfBFFLbXUMubX9nc2NEeMxObT1v/TYqPUTSygtp4O+uqInPicWAB/LCH4CKV/KnPI+6pzJ+a8DCgWc0KRLHJ5TEjYw== X-Google-Smtp-Source: AGHT+IEZaYrSJVqBQZOuRNpkAJaNlvlDbCofPW8P5WCJon2jEzo0gy2jg1p7a1FbuAlo8kqarD4y X-Received: by 2002:a17:906:318c:b0:a52:362f:be1a with SMTP id 12-20020a170906318c00b00a52362fbe1amr6637158ejy.18.1713813467188; Mon, 22 Apr 2024 12:17:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713813467; cv=pass; d=google.com; s=arc-20160816; b=Rbjjr+zwKpIB/598WJT531WzK0tRio/aoDv+fope/N3XMNmrE+D2E1pB6fD2ysBLOr gFQA2Rdd84qU7UjzZfmM3CVgZMgJBUnUfAxfq0dFKNb/9g8AhgFjBPfIVXj9YXU5wOoL jVq7udNNxYLygOHafVUZPLTwveAsdec/nwVa0YxBHPcGiLRaOhKEdG9tomkhsWZ3SCL0 E4DesuGtk2zeZQHPFknsO7rZEid+JUqFUQRo7XarY8ey4X+873KYnbrrWjrRN5l8lp05 Dzp91ZGzMtSQGf1uIJSCqS+ETpvNWsisRJ7JO8sMmNTvwxHxHLDK0wypq0wj6C7f36bo 4Y7w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=/x1SyMb4ASJVh4p8qtH5Zq8S4yTFQsv6VhQl0Ka60Eg=; fh=u4pUglHcXqSo1yq9isVO+CbKVw8pru8BvPW10jDUezM=; b=OarqFaQ4SRveSWy1fYhJcDwmKNPAQnkLoVqKvytvTAIJ+yaEDds+f3ilkj6NcgRj2L rtAz/TtAy/ut1GiV3bqpg4QC5wSE1xnQv6h2Z/JPBUjRMW9JuPmECmHfyzJUlEvDOYti 2bmm6dZvvX2CfxA4Xf//kf1qG8mDdOyWK5689ols9lX/g0uSX3gkGC8FCJ2lWVh/CMXA GSDKhYUKrxPBzDXih9hbjUAr88b0go0ldJZlb265/6tI2QLk0iKjK3NoG2CcuiU73oVJ dxI1icWPDKhvLDaDmk9VEWyMvbHL+IxQ7ejylehteWD1annIpUczzk8PQv4iSyJhBCvZ 0tOg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=QLOKgyHG; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-153902-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153902-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ji10-20020a170907980a00b00a526fca3ca0si6477033ejc.122.2024.04.22.12.17.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 12:17:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153902-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=QLOKgyHG; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-153902-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153902-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id CB1971F224E7 for ; Mon, 22 Apr 2024 19:17:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC08A15532A; Mon, 22 Apr 2024 19:17:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="QLOKgyHG" Received: from mail-vs1-f43.google.com (mail-vs1-f43.google.com [209.85.217.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BBE6415531E for ; Mon, 22 Apr 2024 19:17:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713813458; cv=none; b=Vmc+xFkgd9JH9mExN2ohO0nv+mXGTGfab2CJA7LqvccDWjylnXXsiPGOMomPyQdXPBFiky/EA6+A3U5UePq4eFQGgMJqNjqAp8xqF9D53awjeziWXhgVRzgOhZNh3veEBnmhXx1XjAvU0G3xEMh1kuYuix0wLM6aT/bV8BMOOLA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713813458; c=relaxed/simple; bh=/x1SyMb4ASJVh4p8qtH5Zq8S4yTFQsv6VhQl0Ka60Eg=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Mpc/jbvCOkE1/T1iuuiG6K6bVoB+y3fwJga7wFG1ejH1Tk1bXzuM8prVGF1WFmXSuSJJ412rEq1GkYSuE1L1PhqjuBuHzXd9Jav2nSvb6kD1cuKkwn4vufPss/y6CQRThADF9BXbZJJX4MaBV8zjTfDME2IkJ8QV+jXzGqd1pko= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=QLOKgyHG; arc=none smtp.client-ip=209.85.217.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-vs1-f43.google.com with SMTP id ada2fe7eead31-479e857876fso1773097137.0 for ; Mon, 22 Apr 2024 12:17:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713813455; x=1714418255; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/x1SyMb4ASJVh4p8qtH5Zq8S4yTFQsv6VhQl0Ka60Eg=; b=QLOKgyHG2qzS57PEqSlBYrgZIZCbBjbe9l2jhcKMbo6vnVFC0O51vGvqnNu4eGErGO ORgkk6PUzxyi8n+exYagdYoO1kv94wEzNZl6MWE1XPL5Xpu803pu0zfeXVv/7S9LRiRx 7OnnOyd2ocl9GvyZy7j4kLeqVxAtbJD3IrC9k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713813455; x=1714418255; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/x1SyMb4ASJVh4p8qtH5Zq8S4yTFQsv6VhQl0Ka60Eg=; b=umr8twX5YlWvFpRaojdgTx8Ap9r1Tp95O8AIGesA7ZEseifloShlhlb1TipkOohNwX wWkBJ7Bb6Zn7my95hmSew53UcesKfoc0ROG8WN/Wzk8Pn+przsu9OI8Wg2OkaJpT5fvY NJqXDW8TfdwjyoXH0yqxMATZy/S3yjqn4kG2+xnJnavuh6FEC/tECqBEInD7scigmCO6 wCbE4Uw+7l5Zi4cK/wA+uSJxuosnOvq/10knawqWvfk7zxZHaqpcjWm2eiVNX7HuG/Zb 6iFiQGUHAgp8E39SZzurTOrqWPCubvnPmgTVHuX1inGt4aZ0v2G56pewxy3Zns+NtDZ9 zLaQ== X-Forwarded-Encrypted: i=1; AJvYcCX0GxSfZo0ukIyAyynyIqcp+u+ebUrsh5cUBowom0o7hVbM7gdjIsTowcfVqnxC163XrHT3BkGJrT4Mp3d9cBWZFfENqA/i7QYbw60H X-Gm-Message-State: AOJu0YzIAXndIVSIQCdawhu0C1AzhMVqBEfg5sIOSx5LwPAjlgzolY1o iITpa6bEEao86MDQW4CjSUMdqeuThtAhFtYhhA5UkosSIUD5teRONpz+qAO+MPy/0Aw9UrAr4IH 6Ph7L3OQyhBYlDwj0DbYeQFFLgqti8uswtc369SazYh7tnExHGA== X-Received: by 2002:a67:ee16:0:b0:47b:f1ae:9c77 with SMTP id f22-20020a67ee16000000b0047bf1ae9c77mr3331254vsp.23.1713813455682; Mon, 22 Apr 2024 12:17:35 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240119053756.GC2543524@black.fi.intel.com> <20240119074829.GD2543524@black.fi.intel.com> <20240119102258.GE2543524@black.fi.intel.com> <03926c6c-43dc-4ec4-b5a0-eae57c17f507@amd.com> <20240123061820.GL2543524@black.fi.intel.com> <20240416050353.GI112498@black.fi.intel.com> <20240419044945.GR112498@black.fi.intel.com> In-Reply-To: <20240419044945.GR112498@black.fi.intel.com> From: Esther Shimanovich Date: Mon, 22 Apr 2024 15:17:24 -0400 Message-ID: Subject: Re: [PATCH v4] PCI: Relabel JHL6540 on Lenovo X1 Carbon 7,8 To: Mika Westerberg Cc: Mario Limonciello , Dmitry Torokhov , Lukas Wunner , Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Rajat Jain Content-Type: text/plain; charset="UTF-8" Thanks for the explanation! I still don't fully understand how that would work for my use case. Perhaps it would be better for me to describe the case I am trying to protect against. To rehash, this quirk was written for devices with discrete Thunderbolt controllers. For example, CometLake_CPU -> AlpineRidge_Chip -> USB-C Port This device has the ExternalFacingPort property in ACPI. My quirk relabels the Alpine Ridge chip as "fixed" and external-facing, so that devices attached to the USB-C port could be labeled as "removable" Let's say we have a TigerLake CPU, which has integrated Thunderbolt/USB4 capabilities: TigerLake_ThunderboltCPU -> USB-C Port This device also has the ExternalFacingPort property in ACPI and lacks the usb4-host-interface property in the ACPI. My worry is that someone could take an Alpine Ridge Chip Thunderbolt Dock and attach it to the TigerLake CPU TigerLake_ThunderboltCPU -> USB-C Port -> AlpineRidge_Dock If that were to happen, this quirk would incorrectly label the Alpine Ridge Dock as "fixed" instead of "removable". My thinking was that we could prevent this scenario from occurring if we filtered this quirk not to apply on CPU's like Tiger Lake, with integrated Thunderbolt/USB4 capabilities. ExternalFacingPort is found both on the Comet Lake ACPI and also on the Tiger Lake ACPI. So I can't use that to distinguish between CPUs which don't have integrated Thunderbolt, like Comet Lake, and CPUs with integrated Thunderbolt, like Tiger Lake. I am looking for something that can tell me if the device's Root Port has the Thunderbolt controller upstream to it or not. Is there anything like that? Or perhaps should I add a check which compares the name of the device's CPU with a list of CPUs that this quirk can be applied to? Or is there some way I can identify the Thunderbolt controller, then determine if it's upstream or downstream from the root port? Or are Alpine Ridge docks not something to worry about at all?