From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F7D1397AEF for ; Tue, 12 May 2026 13:43:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778593401; cv=none; b=DuW0ih7P1s3jW+AYqfoaYN40qZq9Hn8Kp2sdYVCa/UJ0sfXwPrK0zVdgJHk7mscc4wTebTJd54Y6YRStvJz62noRV+YgKkKK7YauYTBmhnPYeLzhx2MkHl8CWSEUtq4PfSjg226gVM6okcZ8cj8sdWVoc3gZNdWSBmGbwF5LnoI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778593401; c=relaxed/simple; bh=OEjrytslbt6HQZoRorWzfmL8gpaLUaLvAaGe4kF4hMQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=YyvGjpMxUu286U6Nzo4sZ2XCGZDGog7YT35YLdbwh9GSHtQIL8QibGkQtvDwroJUZLKHIKNGEgGDfCUUbM8moCSJaAJqdG7BKUWQIiy7pQ/2y0AVqlgalW27tbth6KOtfHPNLXwubW0B39fCEv1D0QJBCwH2iRGMCUM75yME0sQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=dF5TCNLr; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=DIQglgnk; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="dF5TCNLr"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="DIQglgnk" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64CCL9sA545386 for ; Tue, 12 May 2026 13:43:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= rJMQC7vSWS9IasgHmQWVqiRy6k68XFBix4FrWXZnp78=; b=dF5TCNLrrXELB3oK loQRmn4JeXMKC7ZloubX5eGBOfA8HD030BJZCU5nR7qCywyb5wfgzFnpbNJ6wc5O Kb4l5IrUd6PRO7xAVuoYjqoNXT6yVRq0IT79iRMtkA5/QOizhFG/Vlc0lEaiFIQQ /hyRx8EOOkcySGHCr0AO4c94ZiIQZT5FpNsNyVtBywH/MYfOh7iyEq8P7F6QpsuN lAEy+VWK4UD8jCnuq0DpjNRZrlqyqpOALQoEVh3OLq9qXy43OPJ9qDEZfOdQrDG/ B/NMehP3CtY9FuhMZPYU+2F8nIeIjH4+Dht/p8Z6+IDmLa4QL8cc2FQw5JTsnQkw vVgn4w== Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4e444sr97h-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 12 May 2026 13:43:17 +0000 (GMT) Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-50fad7b0ae2so12002891cf.2 for ; Tue, 12 May 2026 06:43:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1778593397; x=1779198197; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=rJMQC7vSWS9IasgHmQWVqiRy6k68XFBix4FrWXZnp78=; b=DIQglgnkUz+U0b6KjR4CuBm9yADxbD5szpCM+0e6dym0yRr+DiuWhPWopx7zLpV6HF aVS3QSqNGzdaubBMfI3slkKKWxsmHiqvLsnOAY6brQCN0mJVd7vR/fEEjAyNr0cB9DnV 1OvNt+jRaYy6eqWdJdEYRkyWtqnBfX17iklgAd29vFbWwgvsOwfxF0wSuVCgkDzf/yyU Kp4ZUaQRtaibr2MEODNNrjNaBiodcE7g035Sa6mx0x4I1nI6EJojdSBENKs1qJd04XNW orQb7wvUmJhszfyWK3EoomfGjSMjulhHOCIWH1fQEdgPBgutFBm7YsO6b2kYyDGYMjSu EFWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778593397; x=1779198197; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rJMQC7vSWS9IasgHmQWVqiRy6k68XFBix4FrWXZnp78=; b=CHpDzivNuhH4G+3LKqUmOS/nswvbhyIIcu+EJR/TNx+szG3IESNoFMvlWOTDhckXB7 Ds36xTsIv8GRxvhsEcg+dJg70R1pma0QDcG3ZZDuD/RPV5ChKOAIcq8crYMCTEJLOfCi elGHScjeMPaYMwxo+1XAG1+psghlfdR82sRD/geXevAXsJ1S50bzHl/7UYghGnctGuYa caEAUtIZyw6Wogr+tUTT7YYTauyOpiAWLz4gxuwyoxvnVMLxsSs+LXXvvlLENad/pA2z Qk3ipfD5Cb/BYt7+qvf1IwFM/iTjqT+c0R4eHTmZdoXpFgv54rkM79Wr2RQSofN4sKeZ rB1Q== X-Forwarded-Encrypted: i=1; AFNElJ/rCBysqc2nox2DPW0K8qalg3uImn/s9GB2W/GdBItFFGQ4AJmj+73cc3BFTN0u3sfl6kKcWjwiXSZWjhg=@vger.kernel.org X-Gm-Message-State: AOJu0Yzmm/8N7vtGjvuRSAuBA/1Ev7YkCbyb7K2DHZCp4HJmtlr1t9Y/ dEQHryLc5zJVACpodB1somNf8MkSGKwJAlYw5HjDTQKpOMELKTaD9/af7l6kM2nD2njHD8ftqU3 Ds8GdldIgACYupdf9H4aPmI7m5OW+nS+4e7zy2qxJ3A5h884ABZN+QgCMKqP4vif2bdo= X-Gm-Gg: Acq92OGQR2fVc1F4cmfr1wpi0QpQc/0OzGNDpFBlTbvo2YzQGSy/WHlPIMRBI4rUGZu Xaf7URVoNoyo8zlh1khTLst+2wTBKqVU9ln706Dy11BgXVYFxe9k10nvCXpmVkADijXMenypQgX Ec65yguVa7RiT7v4xHNgrrXB67iUpW8yIR1Wy/IYah91X8Et20wwlKiGkkpGHZ81kYm5zwPYzMD T8IIuX3iAiNYzWD0B3+oxxP5hSZgIUKyd2pj+veU6NrACYvFcYLM6cuqIHxB5LPMmjmenJwsduS vspdlOtwrtrf5RpNooPe4wv1YF+rgo9V0i37TC9savwXSJoifMX9OHaF2xsKIxFpe7tHPxR7H9g fMZ2M49APTG9ra0lNArH1VDEkifHFDl8oAT3zpaIzzQKWXow08MX5E87Tc7C2g5hh3J+29k+ORO gEQZw= X-Received: by 2002:a05:622a:1108:b0:50e:6311:7380 with SMTP id d75a77b69052e-51464b1b978mr285575701cf.6.1778593396332; Tue, 12 May 2026 06:43:16 -0700 (PDT) X-Received: by 2002:a05:622a:1108:b0:50e:6311:7380 with SMTP id d75a77b69052e-51464b1b978mr285575311cf.6.1778593395612; Tue, 12 May 2026 06:43:15 -0700 (PDT) Received: from [192.168.119.254] (078088045245.garwolin.vectranet.pl. [78.88.45.245]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-393f6268ddesm33432601fa.37.2026.05.12.06.43.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 May 2026 06:43:14 -0700 (PDT) Message-ID: <80e0bd64-c99d-4dee-9417-3036f72658f2@oss.qualcomm.com> Date: Tue, 12 May 2026 15:43:12 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/4] thunderbolt: Separate out common NHI bits To: Mika Westerberg Cc: Konrad Dybcio , Andreas Noever , Mika Westerberg , Yehezkel Bernat , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, usb4-upstream@oss.qualcomm.com, Raghavendra Thoorpu References: <20260428-topic-usb4_nonpcie_prepwork-v2-0-452fb9d63f77@oss.qualcomm.com> <20260428-topic-usb4_nonpcie_prepwork-v2-2-452fb9d63f77@oss.qualcomm.com> <20260504065402.GB6785@black.igk.intel.com> <7aab3f25-7609-499a-b701-8301719b9a82@oss.qualcomm.com> <20260512132008.GC84797@black.igk.intel.com> Content-Language: en-US From: Konrad Dybcio In-Reply-To: <20260512132008.GC84797@black.igk.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: uvqCj64qqRse-uSOKzS4F1pY6bru1EqZ X-Authority-Analysis: v=2.4 cv=OcKoyBTY c=1 sm=1 tr=0 ts=6a032e75 cx=c_pps a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=FpWmc02/iXfjRdCD7H54yg==:17 a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=Dw6u55PnCbx0-5v_w68A:9 a=QEXdDO2ut3YA:10 a=a_PwQJl-kcHnX1M80qC6:22 X-Proofpoint-ORIG-GUID: uvqCj64qqRse-uSOKzS4F1pY6bru1EqZ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTEyMDE0MyBTYWx0ZWRfX+KYPTXMc+Wd7 iMn6qf9/7GAgDjVRxGQHjVzOwXW4Vw0gFZHXMYhGzuCLKPmhuABvWMFL/iEYl2e/KQIXSGuhVaj sIRB0spnMG62sJRXbDGjyRmPtoj/l/rCs1I8M4YJNr0gbvKhYcUp23futTIee8HNEnKopRuhE5h pGAQ6llXocDu4Ws6BIqTqU7bpt3zrfnappfxcIP4qgozvR/3gqmyCYlr+WnJ1dNgk1ld8A7LFh5 KeajKyFzayPLz/Qs3ABReNgLgbCbjvl36fP8m6qZ4d6ag8iF8N2KBDnEvLmtfQT+yLwUOq824VM 0QORDy9UnQMe5WxqGNXVLsGQR/ZDShQXwHnSxte6fq5imZzwMLAFb2tjBQuODkP9h1tPO0eQLeA wtCvgu+jfY/+rftf4wRd+V8NWl1xhuFLYCMikdji2ffbA1ZhP8E/mMR/HZJd4A4pbjIFYez15AG NnPmXJdPNC4lGWWJidg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-11_05,2026-05-08_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 malwarescore=0 clxscore=1015 phishscore=0 spamscore=0 bulkscore=0 adultscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605050000 definitions=main-2605120143 On 5/12/26 3:20 PM, Mika Westerberg wrote: > On Tue, May 12, 2026 at 03:06:58PM +0200, Konrad Dybcio wrote: >> On 5/4/26 8:54 AM, Mika Westerberg wrote: >>> Hi, [...] >>>> +/* >>>> + * During suspend the Thunderbolt controller is reset and all PCIe >>>> + * tunnels are lost. The NHI driver will try to reestablish all tunnels >>>> + * during resume. This adds device links between the tunneled PCIe >>>> + * downstream ports and the NHI so that the device core will make sure >>>> + * NHI is resumed first before the rest. >>>> + */ >>>> +bool tb_apple_add_links(struct tb_nhi *nhi) >>> >>> Okay you moved it here good. I think we can call it in nhi_pci_probe() >>> directly so no need to expose outside. >> >> Yeah that seems like a good idea. It's already there, behind N calls >> in the software CM case. >> >> Do we have to check the CM type though, or do you think it'd be fine >> to just call it unconditionally? (either because there are presumably >> no Apple machines with ICM or because these devlinks would be harmless?) > > I think you can call it unconditionally. It only does something for TB1-2 > Apple systems. > > For Apple TB3 we used to start ICM firmware but this was changed as the > driver learned SW CM. However, we never setup any device links so this > would not change anything. OK. I'm keeping tb_acpi_add_link() as-is, since that's both bus- and arch-independent. However, doing just something like: diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c index cb5d028de3bc..f5ddc8ddb8bb 100644 --- a/drivers/thunderbolt/tb.c +++ b/drivers/thunderbolt/tb.c @@ -3327,7 +3327,7 @@ struct tb *tb_probe(struct tb_nhi *nhi) * before the PCIe/USB stack is resumed so complain here if we * found them missing. */ - if (!tb_apple_add_links(nhi) && !tb_acpi_add_links(nhi)) + if (!tb_acpi_add_links(nhi)) tb_warn(tb, "device links to tunneled native ports are missing!\n"); diff --git a/drivers/thunderbolt/pci.c b/drivers/thunderbolt/pci.c index ca50e3584cac..e0abd1d503c5 100644 --- a/drivers/thunderbolt/pci.c +++ b/drivers/thunderbolt/pci.c @@ -294,6 +294,8 @@ static int nhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) pci_set_master(pdev); + tb_apple_add_links(nhi) + return nhi_probe(&nhi_pci->nhi); } Will cause the warning to show up. And adding something like `nhi->device_links_done` is a little ugly.. Ideas? Konrad