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 B60D6411F82 for ; Tue, 28 Jul 2026 08:48:57 +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=1785228538; cv=none; b=P2KvBRi6VayoHgxZnln18oCb3Il5knoqzU1l73LS3MXERyF4lrm3sXYBZ7j71tNvrmLkgoAuVMnxBL/AUXBHPWEnWTfoCdmEsxohYA6XfjKkfkS9rIIcD29yxyTaauFXpDz/CcRdFTglCJaQxiKrf8jIBRrWxJ+lsSco+K0WFVU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785228538; c=relaxed/simple; bh=tV8x4l7DRSbztf6LM/Lar0hUeYJIxLzO1L6pdskq9NU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=DlLeUH5ss32zSERZlk6xNEAXrYU8ikJz3FZoeBeYSyTbfvn1LkK8ZnQUFFO0/fQDybgEI0IzOjPICsDBw/TUM5ephf3tXxXCyVRggtC7XkZ0UFw6IsojK8UkWQOG8H84mFRax2bT17vbz7+sbSNIezBMzX8mFRJjY1aNpQH/oJI= 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=fuWDHyMO; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=grBdMxBj; 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="fuWDHyMO"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="grBdMxBj" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66S82DFl2480130 for ; Tue, 28 Jul 2026 08:48:57 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= 4nJc486kpottCDKvr3SM9hJzfeiWW2rAuYb30hCrxAo=; b=fuWDHyMOS3CEfoJ7 qtQzmWQIHLsyqNCetXvDCtl2QQFn5nZofaOkX9ZDgnFwGGePLtmGOQumYCg/+KkV 0ZLlUv8k58th+EdtoZ6CYDlwg+AAaGKp7N8aZUmHUztCI4nQhH0AwSd46e/ihoGU EDB2JTVVSjMe4ZLHTzfhn8PsjnrpGGDbBRdZQRTiKIhAdcKdXqafmjQoOxC/QmWp buxCLpk4YOO1lzIL7INg3irtTNIJVcfGogcqCT9gszAuh5nqGnCPYr+0qHrpuZ1X PyETsT8FX3Vyrw/RngWSZK5I4ceWOcaLglKBBoBOZCSQJ7TAKncZIOLvD2z+uvSp V419+g== Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fpmy112a8-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 28 Jul 2026 08:48:56 +0000 (GMT) Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-9006b9c3fb6so9363426d6.2 for ; Tue, 28 Jul 2026 01:48:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785228536; x=1785833336; darn=vger.kernel.org; h=content-transfer-encoding:content-type: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 :content-type; bh=4nJc486kpottCDKvr3SM9hJzfeiWW2rAuYb30hCrxAo=; b=grBdMxBjtaWt58hqdjJ4km8tAYx4ua7ZkQ/CsAzeScwH0mmTlxdshPJzjWMPMmO9eQ aPKBTKDCEq9Icz+yViPG4wUvyZpbHyikz2k/4B8ZMMnQUu8OjNfUY4EGczCrhikv2Pv3 b79IKd2f1zT4WWa9+2YlwJuWeanAm3qfA4UDRQI1eNPxN0SATbFIl8PI8My/F0MrrDU2 UA8MCqTZ+4Zekso4f0/KzOoAraNOyIIx8ldgHycuN8TuqHTmZF3G8nqVy26QGc+y3DEV N0hrpDbYwmSASHBB/22qXgPEkFB8GcdkfnZu2n4kWsG9rf0kEvoY9OTEE4f0eiojb7XV YaPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785228536; x=1785833336; h=content-transfer-encoding:content-type: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:content-type; bh=4nJc486kpottCDKvr3SM9hJzfeiWW2rAuYb30hCrxAo=; b=pVpxOMNx62o1HIIMcvOluaJBBEAS/fmKR7MRqztlZFIJvZMPJmSkyOBbOTfnboCo90 AOFqbKP68NBpgTfQA3reVMdS5h2jlbBfZCSHYlc7URzHYxYQYJ6DFBFH68Z04Pu8IuNU uUBtfyyaSeCU6VGfkduuNQ2ZpkAgrcAAGSQ3jQQQmCirmhKW3e9zsQEUQfWSYvwbj9v5 19zvwGSLcfJ9lIoBSEuBXPz9TCVWycdVjPc6Axwg0S0Xbua+Vc81vApfcYKKbVIYoSyY oiTEVcv8y22jBEOtKeNGcRDv513QDyDa7aUG2LpxbH/LuIC41lLpLnthfFMTSUBsZpZx QZow== X-Forwarded-Encrypted: i=1; AHgh+RrSxYppfUNY+DY/QvKIiOiN05TUjCHUj2Y9XcCTLKsyuJEbIshzAo02WniIGBqcuFwYfUMVnaAPDHwVJLE=@vger.kernel.org X-Gm-Message-State: AOJu0Yyxas8yAeV4gOAsWEr2NTIXJR8uJtfF2axwR4Haq/1slEvr+VI3 +5SmVzKgz72+soZRujso/G4ruegCBa8OOTwmP+p0mBzdpzfbMltYFqoMcMyhuSEhStxjD9imYaP Uk7Zhs3ohX3eLyf8CHH87+e0Pila2aQ54+O9xxPF2Wg4rdRCWtsjvE2ghCUILqtIYqh4= X-Gm-Gg: AR+sD10o47jKSeuosKWTlKYKObkcGKhhuLxvpni4VhLYTgbFcs9wHiyeanAGEyfduSb 4vdBwC0a69ksO6Nmz2K/xOH8ep6bslOispdIRpZxbuR3w264LMwBGojfCpSfdBr4zJi4Oa1UncB WctNVwxf7XmTuKsr7xpPMKuNNEaP2ZTjyRcg0GDCJnaO9B4Ve1H2XgbYh+zYuGXHyJxkCtChWsp Yxd9/FuW6oS1ISY0YbHWfhB5D5ddd4q7it8EPf5Mved/ze1vbgOB9Oht8RM4gfh0ht6LvVjbg9I 2E0pfK7QvsI1wHgL+S0BGmWhHe3K4i0BXaw1Ufwp1GJ6nL1jb+YNbh95hzs7NuYTil4RWtv0fsx duAMq1y7rcT8L/fQptwG4wQ1b X-Received: by 2002:a05:6214:5f10:b0:8f1:1359:2af9 with SMTP id 6a1803df08f44-9081756ac27mr12248326d6.10.1785228535808; Tue, 28 Jul 2026 01:48:55 -0700 (PDT) X-Received: by 2002:a05:6214:5f10:b0:8f1:1359:2af9 with SMTP id 6a1803df08f44-9081756ac27mr12248166d6.10.1785228535349; Tue, 28 Jul 2026 01:48:55 -0700 (PDT) Received: from [192.168.120.193] ([178.235.128.140]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c1c32c9030dsm732517666b.36.2026.07.28.01.48.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Jul 2026 01:48:54 -0700 (PDT) Message-ID: <7e66567b-ab0c-4d1e-af60-9ab024f47c6c@oss.qualcomm.com> Date: Tue, 28 Jul 2026 10:48:52 +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 4/4] usb: dwc3: Notify XHCI core of tunneled status To: Thinh Nguyen , Konrad Dybcio Cc: Greg Kroah-Hartman , Mathias Nyman , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "usb4-upstream@oss.qualcomm.com" , Raghavendra Thoorpu , Mika Westerberg References: <20260715-topic-dwc3_tunneling_state-v2-0-026487a08119@oss.qualcomm.com> <20260715-topic-dwc3_tunneling_state-v2-4-026487a08119@oss.qualcomm.com> Content-Language: en-US From: Konrad Dybcio In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: TXR-bzSV0OfOUTL9ZZtvFcmHiTVW92K- X-Proofpoint-ORIG-GUID: TXR-bzSV0OfOUTL9ZZtvFcmHiTVW92K- X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI4MDA3NSBTYWx0ZWRfX8K/Qr0wwLlb8 yXnpDOBF3+WPSmMJmeQWzxcekcrc0SDAxEnQSMOOEyxCWF5WKNhsKzyJv9fih4zT+NpzxJ0g418 SM52IaApvgLvx42noIJuWDj7KRYI0xR5eZk9oRid+rcvtRUqI3yLAJhX8vLZWi0M4hqlKeRxqAg f1s42qbnB6dIsR4w/ZTgOd8ChZt03T/XL0yOZwPD3prnkUEtlx9s6bh1Q4zc2mNTb5xOsJIREDG +M90pM8Ikpl0m8CbJJURsBsMI/2tz9rGaTg1nbEujF8Vku+I2DvqOfyteRo/4eLbTGaRVLzAAuH 3nmLL1P5B3jXpTdu0Sv9P/WR/wesyBBGGXgy2gNBGncF12kmydB5MTdNFj7EkWnbej+bJAYCRVF 3JMiF+UZfiiC/zY/m3ASZ1K0WcQi5qxJAF+uJAIp4IVwe9AGJBkhD7zCxMbZ0wOG0lvvvV+YSHu 47U2U7bUs2uwWiPjOGw== X-Authority-Analysis: v=2.4 cv=PJo/P/qC c=1 sm=1 tr=0 ts=6a686cf8 cx=c_pps a=oc9J++0uMp73DTRD5QyR2A==:117 a=PRfkaYvzSr8QmIIGAkY2Sg==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=EUspDBNiAAAA:8 a=k3Ez1NyBZyIISVUJBm0A:9 a=QEXdDO2ut3YA:10 a=iYH6xdkBrDN1Jqds4HTS:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI4MDA3NSBTYWx0ZWRfX75xF6yNQ7AWY rvDD1W7txvpg1cX9aqo0fDlCBGH4RLrQ5lHDo8oiO22XZHYXd+ANsFK0pDu0B7VCFkh3LpXemV+ H2bzP8L1HFFmkwqTOG5c4H9vBdNkXcA= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-28_02,2026-07-27_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 priorityscore=1501 malwarescore=0 adultscore=0 suspectscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607280075 On 7/23/26 1:01 AM, Thinh Nguyen wrote: > On Wed, Jul 15, 2026, Konrad Dybcio wrote: >> From: Konrad Dybcio >> >> The Thunderbolt framework relies on the USB core to create device links >> for tunneled ports, so that the USB3 controller is only kept >> runtime-resumed for the duration of the tunneling. This depends on >> first knowing whether a connection is tunneled or native. >> >> Add the logic to handle that for DWC3 controllers. >> >> Signed-off-by: Konrad Dybcio >> --- >> drivers/usb/dwc3/core.c | 16 ++++++++++++++++ >> drivers/usb/dwc3/core.h | 18 ++++++++++++++++++ >> drivers/usb/dwc3/host.c | 12 ++++++++++++ >> 3 files changed, 46 insertions(+) >> >> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c >> index fd5c2cd36c59..6ee6fce4c927 100644 >> --- a/drivers/usb/dwc3/core.c >> +++ b/drivers/usb/dwc3/core.c >> @@ -162,6 +162,22 @@ void dwc3_set_prtcap(struct dwc3 *dwc, u32 mode, bool ignore_susphy) >> } >> EXPORT_SYMBOL_GPL(dwc3_set_prtcap); >> >> +enum usb_link_tunnel_mode dwc3_link_tunnel_mode(struct dwc3 *dwc, u8 port) >> +{ >> + /* Prior versions had no CIO support */ >> + if (!DWC3_VER_IS_WITHIN(DWC31, 191A, ANY)) >> + return USB_LINK_NATIVE; > > Refer on the feedback from the other patches, this should return > USB_LINK_UNKNOWN instead. My thinking here was that if there is physically no possibility of the controller carrying a tunneled connection, it must logically be native >> + >> + /* Not all DWC3 instances have CIO HW, trust the platform firmware */ >> + if (!device_property_present(dwc->dev, "usb4-host-interface")) >> + return USB_LINK_NATIVE; > > Same here. Here I can agree it's possible that the link may be either native or tunneled, but it'd require the DT to be wrong (lacking the property) on the XHCI side, while describing the USB4 router. But on a second thought, the router may be internal to the SoC, but present on a discoverable bus (e.g. PCIe), where it would appear so long as the PCIe controller is enabled, not necessarily requiring its own DT node. So I suppose UNKNOWN here really makes sense. Konrad